This is the backend API for BudgetWise, a modern full-stack expense tracker application. It is built with Node.js and Express.js and provides a secure RESTful API for all frontend operations.
- Secure Authentication: JWT-based authentication for user registration and login, with password hashing using bcrypt.
- Protected Routes: Middleware to protect sensitive endpoints and ensure users can only access their own data.
- Full CRUD API: Complete Create, Read, Update, and Delete functionality for user expenses.
- Scalable Architecture: Organized with a modular structure (routes, middleware) for easy maintenance and future expansion.
- Database Integration: Connects to a PostgreSQL database for reliable and persistent data storage.
- Runtime: Node.js
- Framework: Express.js
- Database: PostgreSQL
- Authentication: JSON Web Tokens (JWT), bcryptjs
- Language: JavaScript (ES Modules)
To run this project locally:
-
Clone the repository.
-
Install dependencies:
npm install
-
Set up your PostgreSQL database and create the
usersandexpensestables using thedatabase.sqlscript. -
Create a
.envfile in the root directory and add your database credentials and a JWT secret:DB_USER=your_username DB_HOST=localhost DB_NAME=your_database_name DB_PASSWORD=your_password DB_PORT=5432 JWT_SECRET=your_super_secret_key
-
Start the server:
node index.js