A modern, feature-rich expense tracking application built with Next.js 15, TypeScript, and Tailwind CSS. This application allows users to record, categorize, and analyze their daily expenses with intelligent insights and beautiful visualizations.
- User Authentication: Secure login and registration system
- Expense Management: Add, edit, and delete expenses with ease
- Categorization: Organize expenses by categories (Food, Transportation, Shopping, etc.)
- Real-time Updates: Instant reflection of changes across the application
- Data Analytics: Comprehensive spending insights with charts and graphs
- Spending Overview: Total spending, average expense, and expense count
- Category Breakdown: Pie chart showing spending distribution
- Monthly Trends: Bar chart displaying spending patterns over time
- CSV Export: Download expense data for external analysis
- Recent Transactions: Quick view of latest expenses
- Modern Design: Clean, minimalistic interface with deep blues and golden yellows
- Responsive Layout: Mobile-friendly design that works on all devices
- Smooth Animations: Subtle transitions and hover effects
- Intuitive Navigation: Easy-to-use interface with clear visual hierarchy
- Next.js 15 with App Router
- TypeScript 5 for type safety
- Tailwind CSS 4 for styling
- shadcn/ui component library
- Recharts for data visualization
- Lucide React for icons
- date-fns for date formatting
- Next.js API Routes for serverless functions
- Prisma ORM for database management
- SQLite for data storage
- bcryptjs for password hashing
- ESLint for code quality
- TypeScript for static typing
- Hot Reload for development efficiency
expense-tracker/
βββ src/
β βββ app/
β β βββ api/
β β β βββ auth/
β β β β βββ login/
β β β β βββ register/
β β β βββ expenses/
β β β βββ summary/
β β βββ dashboard/
β β βββ summary/
β β βββ layout.tsx
β β βββ page.tsx
β βββ components/
β β βββ ui/ # shadcn/ui components
β βββ contexts/
β β βββ AuthContext.tsx
β βββ lib/
β βββ db.ts # Prisma client
β βββ utils.ts
βββ prisma/
β βββ schema.prisma # Database schema
βββ public/
- Node.js 18+ installed
- npm or yarn package manager
-
Clone the repository
git clone <repository-url> cd expense-tracker
-
Install dependencies
npm install
-
Set up the database
npm run db:push
-
Start the development server
npm run dev
-
Open your browser Navigate to http://localhost:3000
The application uses a simple yet powerful database structure:
id: Unique identifieremail: User email (unique)name: User's namecreatedAt: Account creation dateupdatedAt: Last update date
id: Unique identifieramount: Expense amountcategory: Expense categorydate: Expense datenotes: Optional notesuserId: Foreign key to users tablecreatedAt: Entry creation dateupdatedAt: Last update date
The application uses a simple authentication system:
- Registration: Users can create an account with name, email, and password
- Login: Existing users can sign in with their credentials
- Session Management: User sessions are maintained using localStorage
- Protected Routes: Dashboard and summary pages require authentication
POST /api/auth/register- Create a new user accountPOST /api/auth/login- Authenticate user
GET /api/expenses?userId={id}- Get all expenses for a userPOST /api/expenses- Create a new expensePUT /api/expenses/{id}- Update an existing expenseDELETE /api/expenses/{id}- Delete an expense
GET /api/summary?userId={id}- Get spending analytics and summary
- Primary Blue:
#3B82F6(Blue 600) - Secondary Amber:
#F59E0B(Amber 500) - Background: Gradient from blue-50 to amber-50
- Text: Blue-900 for headings, blue-700 for body text
- Headings: Bold, large font sizes with blue-900 color
- Body Text: Regular weight with blue-700 color
- UI Elements: Consistent sizing and spacing
- Cards: Semi-transparent with blur effect
- Buttons: Blue primary, amber accents
- Forms: Clean inputs with blue focus states
- Charts: Custom colors matching the theme
npm run dev- Start development servernpm run build- Build for productionnpm run start- Start production servernpm run lint- Run ESLintnpm run db:push- Push database schema changesnpm run db:generate- Generate Prisma clientnpm run db:migrate- Run database migrationsnpm run db:reset- Reset database
- Add Expenses: Simple form with amount, category, date, and notes
- Edit Expenses: Click the edit button to modify existing entries
- Delete Expenses: Remove expenses with confirmation dialog
- Category Selection: Choose from predefined categories or add custom ones
- Overview Cards: Key metrics displayed prominently
- Spending Charts: Visual representation of spending patterns
- Category Analysis: Detailed breakdown by category
- Monthly Trends: Track spending over time
- Responsive Design: Works seamlessly on mobile, tablet, and desktop
- Loading States: Visual feedback during data operations
- Error Handling: User-friendly error messages
- Smooth Transitions: Subtle animations for better UX
-
Build the application:
npm run build
-
Start the production server:
npm run start
Create a .env file with:
DATABASE_URL="file:./dev.db"
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Google OAuth Integration: Sign in with Google account
- Advanced Analytics: AI-powered spending insights
- Budget Management: Set and track budget limits
- Recurring Expenses: Automatic expense tracking
- Multi-currency Support: Handle different currencies
- Mobile App: Native mobile application
- Data Export: Multiple export formats (PDF, Excel)
- Collaboration: Shared accounts for families
This project is licensed under the MIT License.
If you encounter any issues or have questions, please:
- Check the existing documentation
- Search for similar issues
- Create a new issue with detailed information
Built with β€οΈ using Next.js 15, TypeScript, and Tailwind CSS