Skip to content

Mohitcoder5/Expense-Tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Vexa - Full-Stack MERN Expense Tracker

Vexa is a complete full-stack web application built using the MERN stack (MongoDB, Express.js, React.js, Node.js). It allows users to track their incomes and expenses through a clean, responsive user interface, providing a clear overview of their financial health.

This project features full CRUD (Create, Read, Update, Delete) functionality, a visual dashboard with charts, and a modern UI styled with TailwindCSS.

![]

✨ Key Features

  • Full CRUD for Incomes: Add, view, update, and delete income sources.
  • Full CRUD for Expenses: Add, view, update, and delete expenses.
  • Real-time Balance Calculation: Instantly see your total income, total expenses, and net balance.
  • Visual Dashboard: An interactive pie chart breaks down expenses by category for easy analysis.
  • Responsive UI: A clean, modern interface built with TailwindCSS that works on all device sizes.
  • Interactive Edit Modal: A seamless pop-up modal for editing any transaction.

πŸ› οΈ Tech Stack

  • Frontend:
    • React.js (with Vite)
    • React Hooks (for state management)
    • Axios (for API requests)
    • Recharts (for the expense summary chart)
    • TailwindCSS (for styling)
  • Backend:
    • Node.js
    • Express.js (for routing and middleware)
    • MongoDB (with Mongoose for data modeling)
    • dotenv (for environment variables)
    • cors (for cross-origin requests)

πŸ“ Project Structure

The project is organized into two main folders: backend and frontend.

/Vexa β”œβ”€β”€ /backend β”‚ β”œβ”€β”€ /config (db.js) β”‚ β”œβ”€β”€ /controllers (income.js, expense.js) β”‚ β”œβ”€β”€ /models (Income.js, Expense.js) β”‚ β”œβ”€β”€ /routes (incomes.js, expenses.js) β”‚ β”œβ”€β”€ .env (Contains environment variables) β”‚ β”œβ”€β”€ index.js (Main server file) β”‚ └── package.json β”‚ └── /frontend β”œβ”€β”€ /src β”‚ β”œβ”€β”€ /components (Balance.jsx, ExpenseChart.jsx, EditModal.jsx, etc.) β”‚ β”œβ”€β”€ App.jsx (Main app component) β”‚ β”œβ”€β”€ main.jsx (React entry point) β”‚ └── index.css (Tailwind directives) β”œβ”€β”€ package.json └── tailwind.config.js

πŸš€ Getting Started

To run this project locally, follow these steps:

Prerequisites

  • Node.js (v18 or later)
  • MongoDB (a local installation or a free MongoDB Atlas URI string)

1. Backend Setup

  1. Navigate to the backend directory:
    cd backend
  2. Install dependencies:
    npm install
  3. Create a .env file in the backend folder and add your MongoDB connection string:
    MONGO_URI=your_mongodb_connection_string_here
    PORT=5000
    
  4. Start the backend server:
    npm run dev
    The server will be running on http://localhost:5000.

2. Frontend Setup

  1. Open a new terminal and navigate to the frontend directory:
    cd frontend
  2. Install dependencies:
    npm install
  3. Install recharts (if not already installed):
    npm install recharts
  4. Start the frontend development server:
    npm run dev
    The React app will open and run on http://localhost:5173 (or a similar port).

πŸ“ API Endpoints

The backend provides the following RESTful API endpoints:

Method Endpoint Description
POST /api/v1/add-income Add a new income.
GET /api/v1/get-incomes Get all incomes.
DELETE /api/v1/delete-income/:id Delete an income by ID.
PUT /api/v1/update-income/:id Update an income by ID.
POST /api/v1/add-expense Add a new expense.
GET /api/v1/get-expenses Get all expenses.
DELETE /api/v1/delete-expense/:id Delete an expense by ID.
PUT /api/v1/update-expense/:id Update an expense by ID.

πŸ§‘β€πŸ’» Author

  • Mohit Patil

Releases

No releases published

Packages

No packages published