A modern, professional expense tracking web application built with Next.js 14, TypeScript, and Tailwind CSS. Track your personal finances, analyze spending patterns, and manage your budget with an intuitive, responsive interface.
- Add Expenses: Record expenses with date, amount, category, and description
- Edit & Delete: Modify or remove existing expenses with confirmation dialogs
- Smart Filtering: Filter expenses by category, date range, and search query
- Data Persistence: All data is stored locally in your browser using localStorage
- Dashboard Overview: View total spending, monthly expenses, and transaction counts
- Category Breakdown: Visual breakdown of spending by category with percentages
- Top Category Tracking: Identify where you spend the most
- Monthly Trends: Visualize spending patterns over the last 6 months
- Recent Expenses: Quick view of your latest transactions
- π Food
- π Transportation
- π¬ Entertainment
- ποΈ Shopping
- π Bills
- π¦ Other
- CSV Export: Download your expense data for external analysis
- Form Validation: Smart validation ensures data integrity
- Responsive Design: Works seamlessly on desktop, tablet, and mobile
- Modern UI: Clean, professional interface with smooth transitions
- Loading States: Visual feedback during data operations
- Error Handling: Graceful error handling throughout the app
- Node.js 18.x or higher
- npm 9.x or higher
- Clone the repository:
git clone https://github.com/kriszwart/expensetracker.git
cd expensetracker- Install dependencies:
npm install- Run the development server:
npm run dev- Open your browser and navigate to:
http://localhost:3000
npm run build
npm start- Click on "Add Expense" in the navigation bar
- Fill in the expense details:
- Date: Select the date of the expense (defaults to today)
- Amount: Enter the amount in USD (e.g., 25.50)
- Category: Choose from the available categories
- Description: Provide a brief description (minimum 3 characters)
- Click "Add Expense" to save
The form validates all inputs and provides clear error messages if any field is invalid.
- Navigate to "Expenses" from the navigation bar
- Use the filters to narrow down expenses:
- Search: Search by description, category, or amount
- Category: Filter by specific category or view all
- Date Range: Set start and end dates
- Quick Filters: Use "All Time" or "This Month" buttons
- View the total amount for filtered expenses
- Export filtered results to CSV using the "Export CSV" button
- Go to the "Expenses" page
- Click the βοΈ (edit) icon on any expense
- Modify the details in the modal that appears
- Click "Update Expense" to save changes
- Go to the "Expenses" page
- Click the ποΈ (delete) icon on any expense
- Confirm the deletion in the dialog
- The expense will be permanently removed
The dashboard provides an at-a-glance view of your finances:
- Summary Cards: Key metrics like total spending, monthly spending, total transactions, and top category
- Category Breakdown: Visual bars showing spending distribution across categories
- Recent Expenses: Latest 5 transactions for quick reference
- Monthly Trend: Bar chart showing spending patterns over recent months
- Framework: Next.js 14 with App Router
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: React Context API + Custom Hooks
- Data Storage: localStorage (browser-based)
- Icons: Unicode Emojis
- Build Tool: Next.js built-in compiler
expensetracker/
βββ app/ # Next.js app directory
β βββ page.tsx # Dashboard page
β βββ layout.tsx # Root layout with providers
β βββ globals.css # Global styles
β βββ add/ # Add expense page
β βββ expenses/ # Expenses list page
βββ components/ # React components
β βββ Navigation.tsx # Main navigation bar
β βββ Container.tsx # Layout container
β βββ ExpenseProvider.tsx # Context provider
β βββ ExpenseForm.tsx # Expense form with validation
β βββ ExpenseFilters.tsx # Filter controls
β βββ ExpenseListItem.tsx # Single expense item
β βββ SummaryCard.tsx # Dashboard summary cards
β βββ CategoryBreakdown.tsx # Category visualization
β βββ RecentExpenses.tsx # Recent expenses list
β βββ SpendingChart.tsx # Monthly trend chart
βββ hooks/ # Custom React hooks
β βββ useExpenses.ts # Expense management hook
βββ types/ # TypeScript type definitions
β βββ index.ts # All type definitions
βββ utils/ # Utility functions
β βββ localStorage.ts # localStorage operations
β βββ formatters.ts # Date and currency formatters
β βββ expenseCalculations.ts # Analytics calculations
β βββ categoryHelpers.ts # Category utilities
βββ README.md # This file
The application follows modern design principles:
- Simplicity: Clean, uncluttered interface focusing on essential features
- Consistency: Uniform styling and interaction patterns throughout
- Accessibility: Semantic HTML and keyboard-friendly navigation
- Responsiveness: Adapts beautifully to all screen sizes
- Feedback: Visual confirmation for all user actions
- Performance: Optimized for fast load times and smooth interactions
All expense data is stored locally in your browser's localStorage. No data is sent to any external servers. Your financial information stays completely private and under your control.
To clear all data:
- Open browser developer tools (F12)
- Go to Application/Storage tab
- Find localStorage
- Delete the
expense_tracker_datakey
To test all features, try this workflow:
-
Add Sample Expenses:
- Add 5-10 expenses with different categories and dates
- Try different amounts and descriptions
- Validate that form validation works (try invalid inputs)
-
Test Dashboard:
- Verify summary cards show correct totals
- Check category breakdown displays properly
- Confirm recent expenses appear in the list
- Ensure monthly trend chart renders
-
Test Filtering:
- Search for specific expenses
- Filter by different categories
- Set date ranges
- Try the quick filter buttons
-
Test Edit/Delete:
- Edit an expense and verify changes persist
- Delete an expense with confirmation
- Verify data updates across all pages
-
Test Export:
- Export expenses to CSV
- Open the CSV file to verify data format
-
Test Responsiveness:
- Resize browser window to test different breakpoints
- Test on mobile device or using device emulation
Potential features for future versions:
- Multiple user accounts with authentication
- Cloud storage and sync across devices
- Budget setting and tracking
- Recurring expenses
- Receipt photo uploads
- Advanced charts (pie charts, line graphs)
- Expense categories customization
- Multi-currency support
- Data import from CSV/Excel
- Dark mode
- Expense sharing and splitting
- Payment method tracking
- Tags and custom fields
This project is licensed under the MIT License - see the LICENSE file for details.
Feel free to fork this project and submit pull requests for any improvements!
For issues or questions, please open an issue in the repository.
Built with β€οΈ using Next.js, TypeScript, and Tailwind CSS