Skip to content

taberj-git/coursera-expense-tracker-ai

Repository files navigation

Expense Tracker

A modern, professional expense tracking web application built with Next.js 14, TypeScript, and Tailwind CSS.

Features

Core Functionality

  • Add Expenses: Create new expenses with date, amount, category, and description
  • View Expenses: Clean, organized list of all expenses with visual category badges
  • Delete Expenses: Remove expenses with confirmation dialog
  • Data Persistence: All data is stored in localStorage for persistent storage

Filtering & Sorting

  • Category Filter: Filter expenses by category (Food, Transportation, Entertainment, Shopping, Bills, Other)
  • Date Range Filter: Filter expenses by start and end date
  • Search: Search expenses by description
  • Sort: Sort expenses by date (ascending or descending)

Dashboard & Analytics

  • Summary Cards: View total expenses count, total amount spent, and average expense
  • Category Breakdown: Visual breakdown of spending by category with percentage bars
  • Recent Expenses: Quick view of the 5 most recent expenses

Design

  • Modern UI: Clean, professional design with smooth transitions
  • Responsive: Works seamlessly on desktop and mobile devices
  • Color-Coded Categories: Each category has a unique color scheme
  • Interactive Elements: Hover effects, animations, and visual feedback

Tech Stack

  • Framework: Next.js 14 with App Router
  • Language: TypeScript
  • Styling: Tailwind CSS
  • Storage: localStorage (browser-based)

Getting Started

Prerequisites

  • Node.js 18+ installed
  • npm or yarn package manager

Installation

  1. Clone the repository:
git clone <repository-url>
cd expense-tracker-ai
  1. Install dependencies:
npm install
  1. Run the development server:
npm run dev
  1. Open your browser and navigate to:
http://localhost:3000

Usage

Adding an Expense

  1. Navigate to the "Expenses" tab
  2. Fill out the expense form with:
    • Date: When the expense occurred
    • Amount: How much was spent
    • Category: Select from predefined categories
    • Description: Brief description of the expense
  3. Click "Add Expense"

Viewing the Dashboard

  1. Click the "Dashboard" tab
  2. View:
    • Total number of expenses
    • Total amount spent
    • Average expense amount
    • Spending breakdown by category
    • Recent expenses

Filtering Expenses

  1. Go to the "Expenses" tab
  2. Use the filter bar to:
    • Select a specific category
    • Set a date range
    • Search by description
  3. Click "Clear All" to reset filters

Deleting an Expense

  1. Find the expense in the list
  2. Click the trash icon
  3. Confirm deletion in the dialog

Project Structure

expense-tracker-ai/
├── app/
│   ├── layout.tsx          # Root layout with metadata
│   ├── page.tsx             # Main application page
│   └── globals.css          # Global styles
├── components/
│   ├── Dashboard.tsx        # Dashboard with analytics
│   ├── ExpenseForm.tsx      # Form to add expenses
│   ├── ExpenseItem.tsx      # Individual expense display
│   ├── ExpenseList.tsx      # List of expenses with filters
│   └── FilterBar.tsx        # Filtering controls
├── types/
│   └── expense.ts           # TypeScript type definitions
├── utils/
│   ├── storage.ts           # localStorage utility functions
│   └── expense-helpers.ts   # Helper functions for expenses
└── public/                  # Static assets

Categories

The application supports the following expense categories:

  • 🍔 Food: Restaurant meals, groceries, snacks
  • 🚗 Transportation: Gas, public transit, ride-sharing
  • 🎬 Entertainment: Movies, concerts, subscriptions
  • 🛍️ Shopping: Clothing, electronics, general shopping
  • 💳 Bills: Utilities, rent, subscriptions
  • 📦 Other: Miscellaneous expenses

Data Storage

All expense data is stored in the browser's localStorage. This means:

  • ✅ Data persists across sessions
  • ✅ No server or database required
  • ✅ Fast and responsive
  • ⚠️ Data is local to your browser
  • ⚠️ Clearing browser data will delete expenses

Browser Compatibility

The application works on all modern browsers that support:

  • ES6+ JavaScript
  • localStorage API
  • CSS Grid and Flexbox

Future Enhancements

Potential features for future versions:

  • Export data to CSV/PDF
  • Multiple currency support
  • Budget tracking and alerts
  • Recurring expenses
  • Charts and graphs
  • Cloud sync with database
  • Multi-user support

License

This project is open source and available under the MIT License.

Support

For issues, questions, or contributions, please open an issue on the repository.

About

Modern expense tracking application built with Next.js 14, TypeScript, and Tailwind CSS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors