Skip to content

mk-manishkumar/coinkeeper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

103 Commits
 
 
 
 
 
 
 
 

Repository files navigation

CoinKeeper

CoinKeeper is a full-stack MERN application for personal finance management. Users can register, log in, track expenses, manage savings, and visualize their financial data. The project is split into a React + TypeScript frontend and a Node.js + Express + MongoDB backend.


Deployed Link

Both frontend & backend are deployed on Vercel. For live project, Click here


Table of Contents


Features

  • User authentication (register, login, logout)
  • JWT-based session management
  • Add, view, and delete expenses
  • Categorize expenses (Savings, Expenditure, Investment)
  • Expense statistics and visualization
  • Responsive UI with React and Tailwind CSS
  • Secure password hashing and validation
  • Modular, scalable codebase
  • shadcn/ui – For prebuilt, accessible, and customizable UI components.

Tech Stack

  • Frontend: React, TypeScript, Vite, Redux Toolkit, Axios, shadcn/ui
  • Backend: Node.js, Express, MongoDB, Mongoose
  • Authentication: JWT, bcrypt
  • Validation: Zod
  • Deployment: Vercel (config included)

Project Structure

Frontend (frontend/)

  • public/ — Static assets
  • src/
    • components/ — React components
    • lib/ — Utility functions
    • pages/ — Page components
    • services/ — API services
    • store/ — Redux store & slices
  • Static files: vite.config.ts, .env.sample

Backend (backend/)

  • config/ — Database config
  • controllers/ — Route controllers
  • middlewares/ — Express middlewares
  • models/ — Mongoose models
  • routes/ — API routes
  • utils/ — Utility functions
  • Static files: server.js, .env.sample

Getting Started

Prerequisites

Environment Variables

Backend

Copy .env.sample to .env in the backend folder and fill in your values:

cp backend/.env.sample backend/.env
  • PORT=3005
  • MONGODB_URI=your_mongodb_connection_string
  • JWT_SECRET=your_jwt_secret
  • GUEST_JWT_SECRET=your_guest_jwt_secret
  • NODE_ENV=development
  • ALLOWED_ORIGINS=http://localhost:5173,

Frontend

Copy .env.sample to .env in the frontend folder and fill in your values:

cp frontend/.env.sample frontend/.env

Installation

Backend

cd backend
npm install

Frontend

cd frontend
npm install

Running Locally

1. Start MongoDB

Make sure MongoDB is running locally or update your .env with your Atlas URI.

2. Start Backend

cd backend
npm start

3. Start Frontend

cd frontend
npm run dev

Deployment

  • Both frontend and backend include vercel.json for deployment on Vercel.
  • Set environment variables in your Vercel dashboard for both projects.
  • For production, ensure CORS and secure cookie settings are properly configured.

API Endpoints

Auth

  • POST /api/v1/auth/register — Register new user
  • POST /api/v1/auth/login — Login user
  • GET /api/v1/auth/check-auth — Check if user is authenticated
  • POST /api/v1/auth/logout — Logout user

Profile & Expenses

  • GET /api/v1/profile/:username — Get user profile and expenses
  • POST /api/v1/profile/addamount — Add new expense
  • DELETE /api/v1/profile/deleteexpense/:id — Delete expense by ID
  • DELETE /api/v1/profile/deleteallexpenses — Delete all expenses
  • DELETE /api/v1/profile/deleteaccount — Delete user account

Scripts

Backend

  • npm start — Start server
  • npm run dev — Start server with nodemon

Frontend

  • npm run dev — Start Vite dev server
  • npm run build — Build for production
  • npm run preview — Preview production build

Contributing

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/YourFeature)
  3. Commit your changes (git commit -m 'Add some feature')
  4. Push to the branch (git push origin feature/YourFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License.


Contact

For questions or collaboration, reach out to me on Twitter/x

About

CoinKeeper is an expense tracking web application designed to help you keep track of your finances. With CoinTracker, you can easily monitor your expenses, categorize them, and gain insights into your spending habits.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors