A modern, full-stack expense tracking application built with Next.js, featuring user authentication, transaction management, and budget tracking capabilities.
- User Authentication: Secure login system with NextAuth.js
- Transaction Management: Add, view, and manage your expenses
- Budget Tracking: Set monthly budgets and track spending
- Dashboard: Overview of your financial data with summaries
- Responsive Design: Works seamlessly on desktop and mobile devices
- Real-time Updates: Instant feedback and data synchronization
- Frontend: Next.js 15, React 19, TypeScript
- Styling: Tailwind CSS
- Authentication: NextAuth.js 5
- Database: PostgreSQL with Prisma ORM
- Icons: Heroicons
- Form Validation: Zod
- Development Tools: ESLint, Prettier, Husky
Before running this project, make sure you have:
- Node.js 18+ installed
- PostgreSQL database set up
- pnpm package manager (recommended)
git clone <your-repo-url>
cd expense-trackerpnpm installCreate a .env.local file in the root directory with the following variables:
# Database
DATABASE_URL="postgresql://username:password@localhost:5432/expense_tracker"
# NextAuth.js
AUTH_SECRET="your-secret-key"
AUTH_URL="http://localhost:3000"
# OAuth providers (optional)
GOOGLE_CLIENT_ID="your-google-client-id"
GOOGLE_CLIENT_SECRET="your-google-client-secret"# Generate Prisma client
pnpm prisma:generate
# Run database migrations
npx prisma db push
# (Optional) Seed the database
npx prisma db seedpnpm devOpen http://localhost:3000 with your browser to see the application.
expense-tracker/
├── app/ # Next.js app directory
│ ├── api/ # API routes
│ ├── dashboard/ # Dashboard pages
│ ├── login/ # Authentication pages
│ ├── lib/ # Utility functions
│ └── ui/ # Reusable UI components
├── prisma/ # Database schema and migrations
├── .github/ # GitHub workflows
├── .husky/ # Git hooks
└── public/ # Static assets
The application uses the following main models:
- User: User accounts with authentication and monthly budget preferences
- Transaction: Individual expense records with automatic monthly aggregation
pnpm dev- Start development server with Turbopackpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLintpnpm format- Format code with Prettierpnpm prisma:generate- Generate Prisma client
This project uses several tools to maintain code quality:
- ESLint: Code linting
- Prettier: Code formatting
- Husky: Git hooks for pre-commit checks
- lint-staged: Run linters on staged files
# View database in Prisma Studio
npx prisma studio
# Reset database
npx prisma db reset
# Create a new migration
npx prisma migrate dev --name migration_name- Push your code to GitHub
- Connect your repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push
The application can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- DigitalOcean App Platform
- AWS Amplify
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with the guidance of the Next.js Dashboard App Tutorial
- Icons provided by Heroicons
- Styling with Tailwind CSS