Thanks to visit codestin.com
Credit goes to github.com

Skip to content

angelabera/BudgetBuddy

Repository files navigation

πŸ’° BudgetBuddy - Expense Tracker

A modern, full-stack expense tracking application built with Next.js, React, TypeScript, and MongoDB. BudgetBuddy helps you manage your finances with an intuitive interface, beautiful visualizations, and powerful tracking features.

✨ Features

πŸ” Authentication

  • User Registration - Create a new account with email, password, and personal details
  • User Login - Secure JWT-based authentication
  • Protected Routes - Middleware-protected dashboard and expense pages
  • Session Management - Auto-logout with token expiration

πŸ“Š Dashboard

  • Expense Overview - Real-time summary of total spending and budget
  • Visual Charts - Pie chart for expense breakdown by category and Line chart for daily spending trends
  • Budget Tracking - Set and monitor monthly budget with visual progress indicator
  • Quick Stats - View total spent, remaining budget, and highest spending category

πŸ’³ Expense Management

  • Add Expenses - Create new expense entries with title, amount, category, and date
  • View Expenses - Browse all expenses in a clean, organized table
  • Edit Expenses - Modify existing expense details inline
  • Delete Expenses - Remove unwanted expense records
  • Category Filter - Filter expenses by category
  • Search - Find expenses by title
  • Sorting - Sort by date or amount

🎨 User Interface

  • Dark Theme - Modern glassmorphic design
  • Responsive Design - Works on desktop and mobile
  • Animated Backgrounds - Beautiful blob animations
  • Smooth Interactions - Hover effects and transitions

πŸš€ Tech Stack

Frontend

  • Framework: Next.js 16.0.7 (React 19.2.1)
  • Language: TypeScript 5
  • Styling: Tailwind CSS 4
  • Charts: Chart.js 4.5.1 with react-chartjs-2 5.3.1
  • State Management: React Hooks & Context API

Backend

  • Runtime: Node.js
  • Framework: Next.js API Routes
  • Authentication: JWT (JSON Web Tokens) 9.0.2
  • Password Security: bcryptjs 2.4.3

Database

  • Database: MongoDB 7.0.0
  • ODM: Mongoose 8.20.0

πŸ“¦ Installation

Prerequisites

  • Node.js (v18 or higher)
  • npm or yarn
  • MongoDB Atlas account (or local MongoDB)

Setup Steps

  1. Clone the repository
git clone https://github.com/angelabera/BudgetBuddy.git
cd BudgetBuddy
  1. Install dependencies
npm install
  1. Set up environment variables
# Copy the example environment file
cp .env.example .env.local

# Edit .env.local with your actual values
# Required variables:
# MONGO_URI - Your MongoDB connection string
# JWT_SECRET - A secure random string for JWT tokens
  1. Run the development server
npm run dev
  1. Open in browser Navigate to http://localhost:3000

πŸš€ Deployment

Environment Variables for Production

When deploying to platforms like Vercel, Netlify, or Railway, set these environment variables in your deployment platform's dashboard:

  • MONGO_URI - Your MongoDB Atlas connection string
  • JWT_SECRET - A secure, random string (at least 32 characters)

Supported Platforms

  • Vercel (Recommended): Connect your GitHub repo and deploy automatically
  • Netlify: Drag & drop or connect via Git
  • Railway: Connect GitHub repo for seamless deployment
  • Heroku: Use the Heroku CLI or Git deployment

Build Commands

npm run build    # Build for production
npm run start    # Start production server

πŸ“– Usage

Getting Started

  1. Sign Up - Create a new account on the register page
  2. Login - Enter your credentials to access the dashboard
  3. View Dashboard - See your expense summary and charts
  4. Add Expense - Click "Add Expense" button to track spending
  5. Manage Expenses - View, edit, or delete expenses
  6. Set Budget - Update your monthly budget
  7. Logout - End your session

Demo Credentials

πŸ”‘ Key Components

Pages

  • / - Dashboard
  • /login - Authentication
  • /register - Account creation
  • /expenses - Expense management
  • /add-expense - New expense form

API Routes

  • POST /api/auth/register - Registration
  • POST /api/auth/login - Login
  • GET /api/expenses - Fetch expenses
  • POST /api/expenses - Create expense
  • PUT /api/expenses - Update expense
  • DELETE /api/expenses - Delete expense

πŸ›‘οΈ Security Features

βœ… JWT Authentication with secure token management
βœ… Password hashing with bcryptjs
βœ… Protected routes with middleware
βœ… HTTP-Only cookies for session storage
βœ… Server-side validation
βœ… Environment variables for sensitive data
βœ… TypeScript for type safety
βœ… Input sanitization and validation

🎨 Design Highlights

  • Glassmorphic UI - Semi-transparent cards with backdrop blur
  • Gradient Accents - Beautiful gradient buttons
  • Dark Mode - Easy on the eyes
  • Smooth Animations - Beautiful transitions
  • Clean Data - Emoji-stripped categories

πŸ“Š Visualizations

  • Pie Chart - Expense distribution by category
  • Line Chart - Daily spending trends
  • Color Coded - Easy identification

πŸš€ Recent Updates

  • βœ… Security Enhancements: Environment variables properly secured with .env.example template
  • βœ… Type Safety: Added TypeScript type definitions for all dependencies
  • βœ… Dependency Updates: Updated to latest stable versions of Next.js, React, and MongoDB
  • βœ… Authentication middleware with protected routes
  • βœ… Emoji stripping from category names for cleaner data
  • βœ… Enhanced UI: 2-column layout for register page and improved dashboard
  • βœ… Functional logout with proper session management
  • βœ… Deployment Ready: Configured for easy deployment to Vercel, Netlify, etc.

🀝 Contributing

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

πŸ“ Development

Available Scripts

npm run dev      # Start development server
npm run build    # Build for production
npm run start    # Start production server
npm run lint     # Run ESLint

Project Structure

BudgetBuddy/
β”œβ”€β”€ app/                 # Next.js app directory
β”‚   β”œβ”€β”€ api/            # API routes
β”‚   β”œβ”€β”€ components/     # Reusable components
β”‚   β”œβ”€β”€ context/        # React context providers
β”‚   └── ...             # Page components
β”œβ”€β”€ lib/                # Utility functions and database
β”œβ”€β”€ models/             # Mongoose models
β”œβ”€β”€ public/             # Static assets
└── ...                 # Config files

πŸ‘€ Author

Angela Bera


Made with πŸ’™ by Angela Bera

Happy budgeting! πŸ’Έ

About

Full-stack expense tracker project using Next.js + MongoDB

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages