Expense Tracker is a comprehensive web application designed to help users manage their personal finances effectively. Built with Node.js and MySQL, the application provides a robust and user-friendly platform for tracking income and expenses.
- Secure login via Google OAuth2
- Protected routes and user-specific data management
- Add, edit, and delete income/expense records
- Categorize transactions (e.g., groceries, rent, entertainment)
- Add detailed notes and descriptions
- Comprehensive transaction history with filtering and sorting options
- Generate monthly and yearly financial summaries
- Analyze spending patterns
- Visual representations of financial data
- Node.js
- Express.js
- MySQL
- Sequelize ORM
- Google OAuth2
- Node.js
- MySQL
- Google OAuth2 Credentials
- Clone the repository
git clone https://github.com/viraj-gavade/Expenses-Tracker-App.git
cd Expenses-Tracker-App
- Install dependencies
npm install
- Configure environment variables
Create a
.env
file with the following variables:
DB_HOST=your_mysql_host
DB_USER=your_mysql_username
DB_PASSWORD=your_mysql_password
DB_NAME=expense_tracker
GOOGLE_CLIENT_ID=your_google_oauth2_client_id
GOOGLE_CLIENT_SECRET=your_google_oauth2_client_secret
- Set up MySQL database
mysql -u root -p
CREATE DATABASE expense_tracker;
USE expense_tracker;
- Start the development server
npm start
Access the application at http://localhost:PORT
CREATE TABLE users (
id INT PRIMARY KEY AUTO_INCREMENT,
google_id VARCHAR(255) UNIQUE NOT NULL,
name VARCHAR(255) NOT NULL,
email VARCHAR(255) UNIQUE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);
CREATE TABLE transactions (
id INT PRIMARY KEY AUTO_INCREMENT,
user_id INT NOT NULL,
type ENUM('income', 'expense') NOT NULL,
amount DECIMAL(10,2) NOT NULL,
category VARCHAR(100) NOT NULL,
description TEXT,
date DATE NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY (user_id) REFERENCES users(id) ON DELETE CASCADE
);
POST /login
: Authenticate via Google OAuth2GET /auth/google/callback
: OAuth2 callback handlerPOST /logout
: End user session
GET /transactions
: Retrieve all user transactionsPOST /add-expense
: Add new expense/incomePUT /update-expense/:id
: Update existing transactionDELETE /delete-expense/:id
: Delete transactionGET /report
: Generate financial reports
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch
git checkout -b feature/your-feature-name
- Commit your changes
git commit -m 'Add some feature'
- Push to your fork
git push origin feature/your-feature-name
- Create a Pull Request
This project is licensed under the MIT License. See the LICENSE file for details.
Viraj Gavade
- Email: [email protected]
- GitHub: @viraj-gavade