Skip to content

Latest commit

 

History

History
100 lines (84 loc) · 2.75 KB

README.md

File metadata and controls

100 lines (84 loc) · 2.75 KB

Expense-tracker-App

This is a full-stack expense tracker application built with the MERN stack (MongoDB, Express, React, Node.js). This App allows the user to track their expenses by creating, reading, updating and deleting expense entries. This project contains two main structures: as a backend entry and a frontend.

Features

  • Add , track, update and delete expenses
  • View a list of all expenses

Project Set-up

Backend

server.js: Entry point of the backend server. routes/expenseRoutes.js: Defines the API routes for managing expenses. controllers/expenseController.js: Contains the logic for handling API requests.

  1. Navigate to the backend folder:

    cd backend
  2. Install dependencies:

    npm install
  3. Create a .env file and add your MongoDB URI:

    MONGO_URI=your_mongodb_connection_string
    
  4. Run the server:

    npm run dev

Frontend

src/App.js: Main React component for the application. public: Contains static files and the HTML template.

  1. Navigate to the frontend folder:

    cd frontend
  2. Install dependencies:

    npm install
  3. Run the React app:

    npm start

Steps to run the application

  1. Ensure all the necessary directores and files are created.

  2. Navigate to the root root directory and install concurrently:

    npm install concurrently
  3. Navigate to the root directory to start both servers using the following command:

    npm start

This command will use concurrently to start both the frontend and backend servers. The frontend will be available at http://localhost:3000 and the backend will be running on http://localhost:5000.

License

This project is licensed under the MIT License - see the LICENSE file for details.

API Endpoints

Get All Expenses URL: /api/expenses Method: GET Response: Array of expense objects Get Expense by ID URL: /api/expenses/:id Method: GET Response: Expense object Create Expense URL: /api/expenses Method: POST Body: JSON object containing description, amount, and date Response: Created expense object Update Expense URL: /api/expenses/:id Method: PUT Body: JSON object containing description, amount, and date Response: Updated expense object Delete Expense URL: /api/expenses/:id Method: DELETE Response: 204 No Content Project Structure server.js: Entry point of the backend server. routes/expenseRoutes.js: Defines the API routes for managing expenses. controllers/expenseController.js: Contains the logic for handling API requests.

Contributions are welcome to this project

Any bugs, or issues , or any contributions are welcome, please feel free to suggest any changes or troubleshooting.