This project is a web application designed to manage financial transactions related to borrowing and giving among users. It provides functionalities for tracking borrowed and given amounts, viewing user details, and managing expenses. The application allows users to add and update records for borrowing and giving, and view summary information including incomplete amounts.
-
User Management
- Add, update, and view user details.
- Each user can have a list of borrowed and given items.
-
Borrowing Management
- Track items borrowed by users, including amount, date, and completion status.
- View a list of all borrowed items and their details.
-
Giving Management
- Track items given to users, including amount, date, and completion status.
- View a list of all given items and their details.
-
Expense Management
- Track and view expenses with associated amounts.
-
Summary Views
- View the total incomplete borrowed and given amounts for each user.
- Display the total amounts for borrowed and given items on the home page.
-
Frontend:
- React: JavaScript library for building user interfaces. It enables the creation of reusable UI components and manages the application's state.
- React Router DOM: For routing and navigation within the application.
- CSS: Used for styling the components and providing a responsive layout.
-
Backend:
- Local Storage: Used for storing user data and application state in the browser.
src/
Components/
AddBorrow.jsx
: Component for adding a borrowed item.AddGive.jsx
: Component for adding a given item.UpdateBorrow.jsx
: Component for updating borrowed items.UpdateGive.jsx
: Component for updating given items.BorrowPopup.jsx
: Component for displaying a list of borrowed items.GivePopup.jsx
: Component for displaying a list of given items.AddUserPopup.jsx
: Component for adding new users.
pages/
Home.jsx
: The main page displaying summary information and links to other pages.User.jsx
: Page for viewing and managing details of a specific user.Users.jsx
: Page for listing all users and their incomplete amounts.
style/
home.css
: Styling for the home page.user.css
: Styling for the user details page.users.css
: Styling for the users list page.
App.jsx
: Main application component that sets up routing.index.js
: Entry point for the React application.
- Displays summary information for borrowed, given amounts, and expenses.
- Contains buttons to navigate to the users page and open popups for borrowed and given items.
- Lists all users with their incomplete borrowed and given amounts.
- Allows adding new users through a popup.
- Shows details for a specific user, including lists of borrowed and given items.
- Provides options to add and update borrowed and given items.
- Components for adding and updating borrowed and given items.
- Include forms for inputting item details such as name, amount, and date.
- Popups displaying lists of borrowed and given items.
- Allows viewing details of the items.
- Popup for adding new users to the application.
-
Loading Data:
- Data is loaded from local storage on component mount using the
useEffect
hook.
- Data is loaded from local storage on component mount using the
-
User Management:
- Users are added and managed through popups. User data is stored in local storage.
-
Borrowing and Giving:
- Users can add, update, and view borrowed and given items. Items are stored in local storage with their details.
-
Viewing Incomplete Amounts:
- The application calculates incomplete borrowed and given amounts using JavaScript array methods (
filter
,reduce
) and displays them on the users page.
- The application calculates incomplete borrowed and given amounts using JavaScript array methods (
-
Expense Tracking:
- Expenses are tracked separately and displayed on the home page.
-
Installation:
- Clone the repository.
- Navigate to the project directory.
- Run
npm install
to install dependencies.
-
Development Server:
- Run
npm start
to start the development server. - Open
http://localhost:3000
in a browser to view the application.
- Run
-
Build:
- Run
npm run build
to create a production build of the application.
- Run
- Error: Cannot read properties of undefined (reading 'map')
- Ensure data is properly initialized and passed to components.
- Verify that local storage data is correctly formatted and parsed.