Skip to content

A full-stack personal finance tracker that helps users monitor income, expenses, and savings with insightful reports and analytics.

Notifications You must be signed in to change notification settings

morshedalamdev/pfm-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

65 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ’° Personal Finance Management App

A full-stack personal finance tracker that helps users monitor income, expenses, and savings with insightful reports and analytics.

πŸš€ Live Demo

πŸ“‹ Features

  • βœ… Track income and expenses with custom categories
  • βœ… Set and monitor savings goals with visual progress
  • βœ… Create and manage monthly budgets
  • βœ… Generate financial reports with interactive charts
  • βœ… Automated recurring transaction management
  • βœ… Multi-period analysis (daily/weekly/monthly/yearly)
  • βœ… Secure JWT authentication with bcrypt encryption
  • βœ… Fully responsive design optimized for mobile and desktop
  • βœ… File upload support for receipts and documents
  • βœ… Email notifications for important events
  • βœ… Real-time data synchronization

πŸ› οΈ Tech Stack

Frontend (Client)

  • Framework: Next.js 16.1.1
  • Language: TypeScript 5
  • UI Library: React 19.2.3
  • Styling: Tailwind CSS 4.1.18
  • State Management: Zustand 5.0.9
  • Validation: Zod 4.3.4
  • HTTP Client: Axios 1.13.2
  • Date Handling: date-fns 4.1.0
  • Icons: Lucide React 0.562.0
  • Utilities: clsx, tailwind-merge, class-variance-authority

Backend (Server)

  • Runtime: Node.js
  • Framework: Express. js 5.2.1
  • Language: TypeScript 5.9.3
  • Database: PostgreSQL (Neon)
  • ORM: Prisma 7.2.0
  • Authentication: JWT (jsonwebtoken 9.0.3 + jose 6.1.3)
  • Password Hashing: bcrypt 6.0.0
  • Validation: Zod 4.3.4 + express-validator 7.3.1
  • Security: Helmet 8.1.0, CORS 2.8.5, express-rate-limit 8.2.1
  • File Upload: Multer 2.0.2 + Cloudinary 2.8.0
  • Email: Nodemailer 7.0.12
  • Job Scheduling: node-cron 4.2.1
  • Logging: Winston 3.19.0 + Morgan 1.10.1
  • Performance: Compression 1.8.1

πŸ“ Project Structure

pfm-app/
β”œβ”€β”€ client/                   # Frontend (Next.js)
β”‚   β”œβ”€β”€ app/                 # Next.js App Router
β”‚   β”‚   β”œβ”€β”€ (auth)/          # Authentication routes
β”‚   β”‚   β”œβ”€β”€ (dashboard)/     # Dashboard routes
β”‚   β”‚   β”œβ”€β”€ globals.css      # Global styles
β”‚   β”‚   β”œβ”€β”€ layout.tsx       # Root layout
β”‚   β”‚   └── favicon.ico      # App icon
β”‚   β”œβ”€β”€ assets/              # Static assets (images, icons)
β”‚   β”œβ”€β”€ fonts/               # Custom fonts
β”‚   β”œβ”€β”€ lib/                 # Utilities and helpers
β”‚   β”‚   └── utils.ts         # Utility functions
β”‚   β”œβ”€β”€ components. json      # shadcn/ui configuration
β”‚   β”œβ”€β”€ next.config.ts       # Next.js configuration
β”‚   β”œβ”€β”€ postcss.config.mjs   # PostCSS configuration
β”‚   β”œβ”€β”€ tsconfig.json        # TypeScript configuration
β”‚   └── package.json         # Frontend dependencies
β”‚
β”œβ”€β”€ server/                   # Backend (Express)
β”‚   β”œβ”€β”€ server.ts            # Server entry point
β”‚   β”œβ”€β”€ tsconfig.json        # TypeScript configuration
β”‚   └── package.json         # Backend dependencies
β”‚
β”œβ”€β”€ . gitignore
β”œβ”€β”€ . gitattributes
└── README.md

πŸ”§ Prerequisites

Before running this application, ensure you have:

  • Node.js: v18.0.0 or higher (Download)
  • npm: v9.0.0 or higher (comes with Node.js)
  • PostgreSQL: Local instance or Neon account
  • Git: For cloning the repository

πŸš€ Getting Started

1. Clone Repository

git clone https://github.com/morshedalamdev/pfm-app.git
cd pfm-app

πŸ–₯️ Backend Setup (Server)

Navigate to Server Directory

cd server

Install Dependencies

npm install

Start Backend Server

# Development mode (with auto-reload)
npm run dev

# Production build
npm run build

# Production mode
npm start

Backend API runs at: http://localhost:5000


🎨 Frontend Setup (Client)

Navigate to Client Directory

Open a new terminal window:

cd client

Install Dependencies

npm install

Start Frontend Development Server

# Development mode
npm run dev

# Production build
npm run build

# Production mode
npm start

Frontend runs at: http://localhost:3000


🎯 Running Both Servers

Option 1: Multiple Terminals

Terminal 1 - Backend:

cd server
npm run dev

Terminal 2 - Frontend:

cd client
npm run dev

Option 2: Using Concurrently (Root Level)

Install concurrently in project root:

# In pfm-app root directory
npm init -y
npm install concurrently --save-dev

Add scripts to root package.json:

{
  "scripts": {
    "dev": "concurrently \"npm run dev --prefix server\" \"npm run dev --prefix client\"",
    "dev:server": "npm run dev --prefix server",
    "dev:client": "npm run dev --prefix client",
    "build":  "concurrently \"npm run build --prefix server\" \"npm run build --prefix client\"",
    "start": "concurrently \"npm start --prefix server\" \"npm start --prefix client\""
  }
}

Then run from root:

npm run dev

πŸ“ Available Scripts

Server Scripts

npm run dev                # Start development server with ts-node-dev
npm run build              # Compile TypeScript to JavaScript
npm start                  # Start production server
npm run prisma:generate    # Generate Prisma Client
npm run prisma:migrate     # Run database migrations
npm run prisma:studio      # Open Prisma Studio GUI
npm test                   # Run tests in watch mode
npm run test:ci            # Run tests once (CI environment)

Client Scripts

npm run dev          # Start Next.js development server
npm run build        # Build optimized production bundle
npm start            # Start Next.js production server

πŸ”’ Security Features

  • βœ… JWT Authentication: Secure token-based authentication with jose and jsonwebtoken
  • βœ… Password Hashing: bcrypt with salt rounds for secure password storage
  • βœ… Rate Limiting: express-rate-limit to prevent API abuse
  • βœ… CORS Protection: Configured CORS for allowed origins
  • βœ… Helmet: Security headers for Express. js
  • βœ… Input Validation: Zod schemas and express-validator
  • βœ… SQL Injection Prevention: Prisma ORM with parameterized queries
  • βœ… XSS Protection: Sanitized inputs and outputs
  • βœ… Cookie Security: Secure cookie-parser configuration

πŸ“„ License

This project is licensed under the ISC License.


πŸ‘€ Author

Morshed Alam


πŸ™ Acknowledgments


πŸ“ž Support

For issues, questions, or suggestions:


🌟 Star History

If you find this project useful, please consider giving it a ⭐ on GitHub!


Made with ❀️ by Morshed Alam

About

A full-stack personal finance tracker that helps users monitor income, expenses, and savings with insightful reports and analytics.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published