CoinKeeper is an expense-tracking web application designed to help you keep track of your finances. With CoinKeeper, you can easily monitor your expenses, categorize them, and gain insights into your spending habits.
This web application is live. Click here
- User registration and login with secure authentication
- Add, view, and delete expenses
- Categorize expenses into Savings, Expenditure, and Investment
- View total expenses by category for better financial insights
Node.js
: Backend runtime environmentExpress.js
: Web framework for routing and middlewareMongoDB (with Mongoose)
: NoSQL database for storing user and expense dataEJS
: Embedded JavaScript templates for rendering dynamic viewsBootstrap
: Frontend framework for responsive designbcrypt
: Library for secure password hashingjsonwebtoken
: JWT-based authentication for sessionsnode-cron
: Scheduler for automated tasks like deleting inactive usersconnect-flash
: Middleware for displaying temporary flash messages (e.g., success or error notifications)
- Node.js and npm installed
- MongoDB installed and running
- Set up environment variables
- Clone the repository:
git clone https://github.com/yourusername/coinkeeper.git
cd coinkeeper
- Install dependencies:
npm install
- Set up environment variables:
Create a .env
file in the root directory and add the following variables:
JWT_SECRET=""
MONGODB_URI=""
PORT=""
SESSION_SECRET_KEY=""
GUEST_JWT_SECRET=""
- Run the application:
npm start
The application will be available at
http://localhost:your_port.
- Navigate to http://localhost:your_port.
- Fill out the registration form and submit.
- Navigate to http://localhost:your_port/login.
- Fill out the login form and submit.
- After logging in, you will be redirected to your profile page.
- Add expenses by selecting the expense type, entering a description, and amount.
- View your total expenses by category.
- Clear all expenses using the "Clear All" (
x
) button.
- Click the
Log Out
button to log out of your account.
- Click the
Delete Account
button to delete your account permanently. Deleting your account will remove all your data, including expenses, permanently from the system.
├── config
│ └── db.js
├── controllers
│ ├── authController.js
│ └── profileController.js
├── middlewares
│ └── middleware.js
├── models
│ ├── Amount.model.js
│ ├── Guest.model.js
│ └── User.model.js
├── public
│ ├── javascript
│ │ └── script.js
│ └── stylesheet
│ └── style.css
├── routes
│ ├── authRoutes.js
│ └── profileRoutes.js
├── utils
│ ├── passwordBcrypt.js
│ ├── utils.js
│ └── zodValidation.js
├── views
│ ├── 404.ejs
│ ├── error.ejs
│ ├── login.ejs
│ ├── profile.ejs
│ └── register.ejs
├── .env
├── .env.sample
├── .gitignore
├── LICENSE
├── README.md
├── package-lock.json
├── package.json
└── server.js
- config: Contains the database connection setup.
- public: Contains static assets such as CSS and JavaScript files.
- controllers: Contains the route handlers for the application.
- views: Contains the EJS templates for rendering HTML.
- utils: Contains utility functions used throughout the application, such as password hashing and validation.
- middlewares: Contains middleware functions such as authentication.
- models: Contains Mongoose models for interacting with the MongoDB database, including User, Guest, and Amount models.
- routes: Contains route definitions for authentication and profile-related actions.
Contributions are welcome! Please fork the repository and submit a pull request.
This project is licensed under the MIT License. See the LICENSE file for details.