Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Daya Singh committed Jun 24, 2023
2 parents 3a44add + b0ef77e commit ad8fdc3
Show file tree
Hide file tree
Showing 20 changed files with 440 additions and 65 deletions.
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ The application is designed to be simple, intuitive, and user-friendly. It provi

# Screenshots

More detailed information like [Screenshots](./screenshots.md), about the application extensive [Features](./userguide.md#features), and intutive usage can be found in the [User Guide](./userguide.md) and [Screenshots](./screenshots.md) file.
More detailed information like [Screenshots](./screenshots.md), a [Demo Video](./media/hackathon_video.webm) about the application extensive [Features](./userguide.md#features), and intutive usage can be found in the [User Guide](./userguide.md) and [Screenshots](./screenshots.md) file.

<video src=./media/hackathon_video.webm controls="controls" style="max-width: 730px;">
</video>

# Development Details

Expand Down Expand Up @@ -48,15 +51,17 @@ The project is developed from scratch by the team members and no code was copied

| Name | Github Handle | Role | Image |
| --- | --- | --- | --- |
| Vipul Taneja | @vipulTaneja | Team Lead | ![Vipul](./media/Vipul.png) |
| Gourav | @dayalubana | Full Stack Developer | ![Gourav](./media/Gourav.png) |
| Daya Singh | @champgourav007 | Full Stack Developer | ![Daya](./media/Daya.png) |
| Chaitanya | @Chaitanya31612 | Full Stack Developer | ![Chaitanya](./media/Chaitanya.png) |
| [Vipul Taneja](https://www.linkedin.com/in/vipultaneja) | @vipulTaneja | Team Lead | ![Vipul](./media/Vipul.png) |
| [Gourav Kumar Singh](https://www.linkedin.com/in/gourav-kumar-singh-246b4621b/) | @champgourav007 | Full Stack Developer | ![Gourav](./media/Gourav.png) |
| [Daya Singh](https://www.linkedin.com/in/daya-singh10/) | @dayalubana | Full Stack Developer | ![Daya](./media/Daya.png) |
| [Chaitanya Gupta](https://www.linkedin.com/in/guptachaitanya/) | @Chaitanya31612 | Full Stack Developer | ![Chaitanya](./media/Chaitanya.png) |

## Data Model

The application consists of the following entities:

![data model](./media/data-model.png)

1. Transaction:
- ID: String or Number
- Description: String
Expand Down
10 changes: 9 additions & 1 deletion frontend/src/App.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { Route, Routes, useNavigate } from "react-router-dom";
import { DashboardPage, FinancesPage, HomePage, NotFoundPage, CategoryPage } from "./pages";
import {
DashboardPage,
FinancesPage,
HomePage,
NotFoundPage,
CategoryPage,
} from "./pages";
import { useEffect } from "react";
import Swal from "sweetalert2";
import { loadUser, setAuthToken } from "./apis";

import { useAuth } from "./contexts/AuthContext";
import PrivateRoutes from "./routes/PrivateRoutes";
import AccountsPage from "./pages/AccountsPage";

function App() {
const navigate = useNavigate();
Expand Down Expand Up @@ -49,6 +56,7 @@ function App() {
<Route path="/dashboard" element={<DashboardPage />} />
<Route path="/finances" element={<FinancesPage />} />
<Route path="/categories" element={<CategoryPage />} />
<Route path="/accounts" element={<AccountsPage />} />
</Route>

<Route path="*" element={<NotFoundPage />} />
Expand Down
39 changes: 35 additions & 4 deletions frontend/src/Components/Common/NavbarComponent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,11 @@ import {
import { useAuth } from "../../contexts/AuthContext";
import CreateForm from "../Form/CreateForm";
import { FormBuilder } from "../../utils/constants";
import { useParams } from "react-router-dom";

const NavbarComponent = () => {
const params = useParams();
console.log("params", params, window.location.pathname);
const { currentUser, loggedIn, setLoggedIn } = useAuth();
console.log(FormBuilder["AddTransaction"]);

Expand All @@ -31,10 +34,38 @@ const NavbarComponent = () => {
style={{ maxHeight: "100px" }}
navbarScroll
>
<Nav.Link href="/">Dashboard</Nav.Link>
<Nav.Link href="/finances">Transactions</Nav.Link>
<Nav.Link href="#">Accounts</Nav.Link>
<Nav.Link href="/categories">Categories</Nav.Link>
<Nav.Link
href="/"
style={{
color: window.location.pathname === "/dashboard" && "white",
}}
>
Dashboard
</Nav.Link>
<Nav.Link
href="/finances"
style={{
color: window.location.pathname === "/finances" && "white",
}}
>
Transactions
</Nav.Link>
<Nav.Link
href="/accounts"
style={{
color: window.location.pathname === "/accounts" && "white",
}}
>
Accounts
</Nav.Link>
<Nav.Link
href="/categories"
style={{
color: window.location.pathname === "/categories" && "white",
}}
>
Categories
</Nav.Link>
<Nav.Link href="#">Reports</Nav.Link>
<Nav.Link href="#">Settings</Nav.Link>
</Nav>
Expand Down
131 changes: 127 additions & 4 deletions frontend/src/Components/Finances/FinancesTable.jsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,131 @@
import React from "react";
import { Modal } from "react-bootstrap";
import React, { useState } from "react";
import { Modal, Button, Form, Container, Table } from "react-bootstrap";

const FinancesTable = () => {
return <div></div>;
const FinancesTable = (props) => {
const {
amount,
setAmount,
transactionType,
setTransactionType,
description,
setDescription,
category,
setCategory,
date,
setDate,
show,
setShow,
handleClose,
} = props;

// const [show, setShow] = useState(false);

// const handleClose = () => setShow(false);

const renderTableRows = () => {
console.log("data", props.data);
return props.data.map((item) => (
<tr key={item.id}>
<td>{item.type}</td>
<td>{item.name}</td>
<td>{item.category}</td>
<td>{item.date}</td>
<td>{item.amount}</td>
</tr>
));
};

return (
<div>
<Modal show={show} onHide={handleClose}>
<Modal.Header closeButton>
<Modal.Title>Create Transaction</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={props.handleSubmit}>
<Form.Group controlId="amount">
<Form.Label>Amount</Form.Label>
<Form.Control
type="number"
placeholder="Enter amount"
value={amount}
onChange={(e) => setAmount(e.target.value)}
/>
</Form.Group>
<Form.Group controlId="transactionType">
<Form.Label>Transaction Type</Form.Label>
<Form.Control
as="select"
value={transactionType}
onChange={(e) => setTransactionType(e.target.value)}
>
<option value="Income">Income</option>
<option value="Expense">Expense</option>
</Form.Control>
</Form.Group>
<Form.Group controlId="category">
<Form.Label>Category</Form.Label>
<Form.Control
type="text"
placeholder="Enter category"
value={category}
onChange={(e) => setCategory(e.target.value)}
/>
</Form.Group>
<Form.Group controlId="description">
<Form.Label>Description</Form.Label>
<Form.Control
type="text"
placeholder="Enter description"
value={description}
onChange={(e) => setDescription(e.target.value)}
/>
</Form.Group>
<Form.Group controlId="date">
<Form.Label>Date</Form.Label>
<Form.Control
type="date"
value={date}
onChange={(e) => setDate(e.target.value)}
/>
</Form.Group>
</Form>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleClose}>
Close
</Button>
<Button variant="primary" onClick={props.handleSubmit}>
Save Transaction
</Button>
</Modal.Footer>
</Modal>

<div className="d-flex justify-content-between align-items-center">
<h1>{props.name}</h1>

<Button variant="primary" onClick={() => setShow(true)}>
Add Transaction
</Button>
</div>

<br />
<Container>
<Table striped bordered hover>
<thead>
<tr>
<th>Type</th>
<th>Name</th>
<th>Category</th>
<th>Date</th>
<th>Amount</th>
</tr>
</thead>
<tbody>{renderTableRows()}</tbody>
</Table>
</Container>
</div>
);
};

export default FinancesTable;
2 changes: 1 addition & 1 deletion frontend/src/Components/Finances/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export { default as SearchFilters } from "./SearchFilters";
export { default as TableComponent } from "./TableComponent";
export { default as FinancesTable } from "./FinancesTable";
export { default as FinanceTable } from "./FinancesTable";
120 changes: 120 additions & 0 deletions frontend/src/pages/AccountsPage.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
import React, { useState } from "react";
import NavbarComponent from "../Components/Common/NavbarComponent";
import {
Button,
Card,
Col,
Container,
Row,
Modal,
Form,
} from "react-bootstrap";

const AccountsPage = () => {
const [bankName, setBankName] = useState("");
const [accountNumber, setAccountNumber] = useState("");
const [balance, setBalance] = useState("");
const accounts = [
{ bankName: "PNB", accountNumber: "1234", balance: "$34" },
{ bankName: "SBI", accountNumber: "1234", balance: "$34" },
{ bankName: "HDFC", accountNumber: "1234", balance: "$34" },
];

const [show, setShow] = useState(false);

const handleClose = () => setShow(false);
return (
<div>
<Modal show={show} onHide={handleClose}>
<Modal.Header closeButton>
<Modal.Title>Create Transaction</Modal.Title>
</Modal.Header>
<Modal.Body>
<Form onSubmit={() => {}}>
<Form.Group controlId="amount">
<Form.Label>Account Name</Form.Label>
<Form.Control
type="number"
placeholder="Enter account name"
value={bankName}
onChange={(e) => setBankName(e.target.value)}
/>
</Form.Group>
<Form.Group controlId="transactionType">
<Form.Label>Account Code</Form.Label>
<Form.Control
type="number"
placeholder="Enter account code"
value={accountNumber}
onChange={(e) => setAccountNumber(e.target.value)}
/>
</Form.Group>
<Form.Group controlId="category">
<Form.Label>Account Type</Form.Label>
<Form.Control
type="text"
placeholder="Account type"
value={balance}
onChange={(e) => setBalance(e.target.value)}
/>
</Form.Group>
</Form>
</Modal.Body>
<Modal.Footer>
<Button variant="secondary" onClick={handleClose}>
Close
</Button>
<Button variant="primary" onClick={() => {}}>
Save Transaction
</Button>
</Modal.Footer>
</Modal>
<NavbarComponent />
<br />
<br />
<Container>
{" "}
{/* <h1>Accounts</h1> <br /> */}
<div className="d-flex justify-content-between align-items-center">
<h1>Accounts</h1>

<Button variant="primary" onClick={() => setShow(true)}>
Add Transaction
</Button>
</div>
<br />
<Row>
{" "}
{accounts.map((account, index) => (
<Col key={index} xs={12} md={6} lg={4}>
{" "}
<Card>
{" "}
<Card.Body>
{" "}
<Card.Title>
<div
style={{
display: "flex",
justifyContent: "space-between",
}}
>
<div>{account.bankName}</div>
<div>
<input type="radio" />
</div>
</div>
</Card.Title>{" "}
<Card.Text>Account Number: {account.accountNumber}</Card.Text>{" "}
<Card.Text>Balance: {account.balance}</Card.Text>{" "}
</Card.Body>{" "}
</Card>{" "}
</Col>
))}{" "}
</Row>{" "}
</Container>
</div>
);
};

export default AccountsPage;
10 changes: 9 additions & 1 deletion frontend/src/pages/DashboardPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,15 @@ const DashboardPage = () => {
</Col>
</Row>
<Row>
<div style={{ display: "flex", justifyContent: "space-evenly" }}>
<div
style={{
display: "flex",
justifyContent: "space-evenly",
backgroundColor: "#0000001a",
height: "25rem",
borderRadius: "5rem",
}}
>
<div style={{ width: "50%" }}>
<BarChart />
</div>
Expand Down
Loading

0 comments on commit ad8fdc3

Please sign in to comment.