A modern, full-stack personal finance tracking application built with Next.js 15, featuring real-time transaction management, interactive data visualizations, and comprehensive financial analytics.
- Secure authentication with Better Auth
- Email verification and password reset functionality
- Protected routes with middleware
- Session management
- Create, read, update, and delete transactions
- Support for income and expense tracking
- Multiple transaction categories:
- Leisure, Food, Transport, Utilities, Health
- Salary, Freelance, Investments, Others
- Date-based transaction filtering
- Sortable and paginated transaction table
- Form submissions handled via Next.js Server Actions
- Expense-Income Pie Chart: Visual breakdown of income vs expenses
- Category Bar Chart: Transaction distribution by category
- Monthly Flow Chart: 12-month income and expense trends
- Interactive date range filtering
- Real-time data updates
- Empty state handling with user-friendly messages
- Modern, responsive design with Tailwind CSS
- Dark/Light theme support with next-themes
- Shadcn UI components for consistent design
- Loading states and skeleton screens
- Toast notifications with Sonner
- Smooth animations with Motion
- Progress indicator with NextJS TopLoader
- Unit Testing with Vitest
- Authentication form testing
- Transaction form validation testing
- Table component testing
- End-to-end Testing with Cypress
- Test coverage for authentication flow
- Dashboard and route protection tests
- Transaction management tests
- GitHub Actions pipeline for continuous integration
- Automated testing on pull requests
- Code quality checks
- Framework: Next.js 16.0.10
- UI Library: React 19.1.0
- Language: TypeScript 5.x
- Styling: Tailwind CSS 4
- Components: Shadcn UI + Radix UI
- Charts: Recharts 2.15.4
- Icons: Lucide React + React Icons
- Forms: React Hook Form with Server Actions
- Validation: Zod 4.1.11
- API: tRPC 11.7.0 (End-to-end typesafe API endpoints)
- Server Actions: Next.js Form Actions for form submissions
- Database: PostgreSQL (Neon)
- ORM: Drizzle ORM 0.44.6
- Authentication: Better Auth 1.3.26
- Email: Resend 6.1.2
- Date Utils: date-fns 4.1.0
- Package Manager: pnpm
- Linting: ESLint 9
- Testing:
- Vitest (Unit Testing)
- Cypress 15.5.0 (E2E Testing)
- CI/CD: GitHub Actions
- Database Tool: Drizzle Kit 0.31.5
- Type Safety: Full TypeScript coverage
- Node.js 20.x or higher
- pnpm (recommended) or npm
- PostgreSQL database (Neon recommended)
- Email service account (Resend)
git clone https://github.com/halilibrahimcelik/pennytracker.git
cd pennytrackerpnpm installCreate a .env file in the root directory:
# Database
DATABASE_URL=your_postgresql_connection_string
# Better Auth
BETTER_AUTH_SECRET=your_secret_key_here
BETTER_AUTH_URL=http://localhost:3000
# Email (Resend)
RESEND_API_KEY=your_resend_api_key
# App URL
NEXT_PUBLIC_APP_URL=http://localhost:3000Generate and run migrations:
# Generate migration files
pnpm db:generate
# Push schema to database
pnpm db:push
# (Optional) Seed the database with sample data
pnpm db:seedpnpm devOpen http://localhost:3000 in your browser.
| Script | Description |
|---|---|
pnpm dev |
Start development server with Turbopack |
pnpm build |
Build production bundle |
pnpm start |
Start production server |
pnpm lint |
Run ESLint |
pnpm test |
Run Vitest unit tests |
pnpm test:ui |
Open Vitest UI |
pnpm db:generate |
Generate Drizzle migrations |
pnpm db:push |
Push schema changes to database |
pnpm db:migrate |
Run migrations |
pnpm db:studio |
Open Drizzle Studio (database GUI) |
pnpm db:seed |
Seed database with sample data |
pnpm cy:open |
Open Cypress test runner |
pnpm cy:run |
Run Cypress tests in headless mode |
pennytracker/
โโโ src/
โ โโโ app/ # Next.js app router pages
โ โ โโโ (auth)/ # Authentication pages
โ โ โโโ dashboard/ # Dashboard pages
โ โ โโโ api/ # API routes (tRPC endpoints)
โ โ โโโ actions/ # Server actions for forms
โ โโโ components/ # React components
โ โ โโโ auth/ # Authentication components
โ โ โโโ dashboard/ # Dashboard components
โ โ โโโ features/ # Feature components
โ โ โโโ layout/ # Layout components
โ โ โโโ ui/ # Shadcn UI components
โ โโโ db/ # Database
โ โ โโโ schema.ts # Drizzle schema
โ โ โโโ migrations/ # Migration files
โ โ โโโ seed.ts # Seed script
โ โโโ lib/ # Utility libraries
โ โ โโโ auth/ # Auth configuration
โ โ โโโ trpc/ # tRPC client/server setup
โ โโโ server/ # Server-side code
โ โ โโโ routers/ # tRPC routers
โ โโโ hooks/ # Custom React hooks
โ โโโ types/ # TypeScript types
โ โโโ constants/ # App constants
โ โโโ middleware.ts # Next.js middleware
โโโ cypress/ # E2E tests
โโโ tests/ # Vitest unit tests
โ โโโ auth/ # Auth form tests
โ โโโ transactions/ # Transaction form tests
โ โโโ tables/ # Table component tests
โโโ . github/
โ โโโ workflows/ # GitHub Actions CI/CD
โโโ public/ # Static assets
โโโ ...config files
The app supports 9 transaction categories:
- Expense: Leisure, Food, Transport, Utilities, Health
- Income: Salary, Freelance, Investments
- Both: Others
- Summary Cards: Total income, total expense, and net balance
- Pie Chart: Visual breakdown of income vs expenses with customizable date range
- Bar Chart: Monthly flow showing 12-month trends
- Category Distribution: Transactions grouped by category with toggle for income/expense
- Real-time Updates: All charts and tables update immediately after CRUD operations
- Date Filtering: Custom date range selection for all analytics
- Sorting & Pagination: Efficient data handling for large transaction lists
- Responsive Design: Optimized for mobile, tablet, and desktop
- tRPC Backend: End-to-end type-safe API endpoints ensure type safety from server to client
- Server Actions: Form submissions leverage Next.js Server Actions for optimized data mutations
- Type Safety: Full TypeScript coverage across the entire API surface
Run Vitest unit tests:
# Run tests
pnpm test
# Open Vitest UI
pnpm test:ui
# Run tests in watch mode
pnpm test:watchTest coverage includes:
- Authentication form validation
- Transaction form submission logic
- Table component rendering and interactions
- Form state management
Run Cypress tests:
# Open Cypress Test Runner
pnpm cy:open
# Run tests in headless mode
pnpm cy:runTest coverage includes:
- User signup and authentication flow
- Dashboard access and data display
- Route protection
- Transaction CRUD operations
- Secure session management
- Password hashing with Better Auth
- CSRF protection with Server Actions
- SQL injection prevention with Drizzle ORM
- Type-safe API with tRPC
- Protected API routes
- Push your code to GitHub
- Import project to Vercel
- Add environment variables
- Deploy
The app can be deployed to any platform that supports Next.js:
- Netlify
- Railway
- AWS
- DigitalOcean
Ensure your environment variables are properly configured.
- User Profile Page: Dedicated page for users to manage and update their credentials
- Update email address
- Change password
- Manage notification preferences
- Delete account option
- Enhanced Analytics: Additional data visualization options
- Budget Management: Set and track monthly budgets
- Multi-currency Support: Support for multiple currencies
- Export Functionality: Export transactions to CSV/PDF
Contributions are welcome! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License.
Halil Ibrahim Celik
- GitHub: @halilibrahimcelik
- Next.js - The React Framework
- Shadcn UI - Beautiful UI components
- tRPC - End-to-end typesafe APIs
- Drizzle ORM - TypeScript ORM
- Better Auth - Authentication solution
- Recharts - Data visualization
- Vitest - Unit testing framework
For support, email or open an issue in the GitHub repository.
Built with โค๏ธ using Next.js and TypeScript