Smart Expense Management Platform with Real-Time Analytics
FinanceTrack is a modern, full-stack expense management application built with Next.js 16, featuring a comprehensive dashboard with monthly analytics, secure authentication, multi-language support, and a beautiful UI powered by shadcn/ui and Tailwind CSS 4. Track your income and expenses, visualize your financial data with interactive charts, and manage your budget efficiently.
- ๐ Interactive Dashboard - Comprehensive overview with monthly income/expense charts
- Visual bar charts showing income vs expenses for 12 months
- Summary cards displaying total income, expenses, and balance
- Year filter to view historical data (last 10 years)
- Real-time data updates
- IQD currency formatting with comma separators
- ๐ณ Transaction Management - Track and categorize your financial transactions
- Create, read, update, and delete transactions
- Categorize transactions as income or expense
- Multi-language descriptions (English, Arabic, Kurdish)
- Date tracking for each transaction
- Type filtering (Income/Expense)
- Pagination for large datasets
- Search functionality
- ๐ Category Management - Organize your finances with custom categories
- Create and manage custom categories
- Assign types (Income/Expense) to categories
- Multi-language category names
- Category-based transaction grouping
- Type filtering
- Pagination support
- ๐ Secure Authentication - Powered by Clerk
- Email/password authentication
- Social login support (Google, GitHub)
- Protected routes with middleware
- User profile management
- Session management
- ๐ Multi-language Support - Fully internationalized
- English (en)
- Arabic (ar) with RTL support
- Kurdish/Sorani (ckb)
- Language toggle in header
- All content translated including UI, forms, and notifications
- ๐จ Modern UI/UX - Beautiful and responsive interface
- Built with shadcn/ui components
- Tailwind CSS 4 for styling
- Mobile-first responsive design
- Smooth animations with Motion
- Lucide React icons throughout
- ๐ Dark/Light Mode - Seamless theme switching
- System preference detection
- Manual theme toggle
- Persistent theme selection
- Chart colors adapt to theme
- โก Real-time Updates - Instant data synchronization
- React Query for efficient caching
- Optimistic updates
- Background refetching
- Toast notifications for actions
- Server-First Architecture - Optimized performance
- React Server Components (RSC) for initial data fetching
- Server Actions for mutations
- Minimal client-side JavaScript
- Efficient data streaming
- Type Safety - Full TypeScript coverage
- Strict type checking
- Zod schema validation
- Type-safe API routes
- Type-safe URL parameters with nuqs
- Database - PostgreSQL with Drizzle ORM
- Relational database design
- Migrations for schema changes
- Type-safe queries
- User-specific data isolation
- Form Handling - Robust and validated
- React Hook Form integration
- Zod validation schemas
- Client and server-side validation
- Multi-language error messages
- State Management - Efficient and scalable
- React Query for server state
- Zustand for client state
- nuqs for URL state
- Cookies-next for persistent data
- Error Handling - Comprehensive error management
- Custom error handler utility
- Toast notifications
- Error boundaries
- User-friendly error messages
- Bun (Package manager - REQUIRED)
- Node.js 20+ (Runtime)
- PostgreSQL (Database)
- Clerk Account (Authentication)
-
Clone the repository
git clone https://github.com/Ahmad-Softwaree/finance.git cd finance -
Install dependencies
bun install
-
Set up environment variables
Create a
.envfile in the root directory:# Database (Neon PostgreSQL recommended) DATABASE_URL="postgresql://user:password@host/database" # Clerk Authentication NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key # Clerk URLs NEXT_PUBLIC_CLERK_SIGN_IN_URL=/sign-in NEXT_PUBLIC_CLERK_SIGN_UP_URL=/sign-up NEXT_PUBLIC_CLERK_AFTER_SIGN_IN_URL=/dashboard NEXT_PUBLIC_CLERK_AFTER_SIGN_UP_URL=/dashboard
-
Set up the database
# Generate Drizzle client bun run db:push # Optional: Seed database with sample data bun run db:seed # Optional: Open Drizzle Studio to view data bun run db:studio
-
Run the development server
bun run dev
-
Open your browser
Navigate to http://localhost:3000
finance/
โโโ app/ # Next.js App Router
โ โโโ [locale]/ # Internationalized routes
โ โ โโโ (auth)/ # Protected routes (requires authentication)
โ โ โ โโโ dashboard/ # Main dashboard with charts
โ โ โ โ โโโ page.tsx # Dashboard overview
โ โ โ โ โโโ transactions/ # Transaction management
โ โ โ โ โโโ categories/ # Category management
โ โ โโโ (root)/ # Public routes
โ โ โ โโโ sign-in/ # Clerk sign-in page
โ โ โ โโโ sign-up/ # Clerk sign-up page
โ โ โโโ layout.tsx # Locale-specific layout
โ โ โโโ page.tsx # Home/landing page
โ โ โโโ providers.tsx # Client-side providers
โ โโโ api/ # API routes
โ โโโ dashboard/ # Dashboard API
โ โ โโโ monthly-stats/ # Monthly statistics endpoint
โ โโโ transactions/ # Transaction CRUD endpoints
โ โโโ category/ # Category CRUD endpoints
โโโ components/ # React components
โ โโโ ui/ # shadcn/ui primitives ONLY
โ โโโ layouts/ # Layout components (Header, Footer, Breadcrumbs)
โ โโโ sections/ # Page sections (Hero)
โ โโโ forms/ # Form components (TransactionForm, CategoryForm)
โ โโโ cards/ # Card components (TransactionCard, CategoryCard)
โ โโโ shared/ # Shared utilities (Filters, Modals, Pagination)
โ โโโ table/ # Table components
โโโ containers/ # Container components (Dashboard, Transactions, Categories)
โโโ lib/ # Utility functions and configurations
โ โโโ react-query/ # React Query setup
โ โ โโโ actions/ # Server actions (transaction, category, dashboard)
โ โ โโโ queries/ # Query hooks
โ โ โโโ keys.ts # Query keys
โ โโโ config/ # API configuration
โ โโโ store/ # Zustand stores
โ โโโ enums.ts # Global enums and constants
โ โโโ urls.ts # API endpoint URLs
โ โโโ utils.ts # Utility functions
โ โโโ functions.ts # Helper functions
โ โโโ error-handler.ts # Error handling utilities
โโโ hooks/ # Custom React hooks
โ โโโ usePaginationQueries.tsx # Pagination state
โ โโโ useTypeQuery.tsx # Type filter state
โ โโโ useYearQuery.tsx # Year filter state
โ โโโ useSearchQuery.tsx # Search state
โโโ i18n/ # Internationalization
โ โโโ routing.ts # i18n routing config
โ โโโ request.ts # Server-side i18n
โ โโโ navigation.ts # Client-side i18n navigation
โโโ messages/ # Translation files
โ โโโ en.json # English translations
โ โโโ ar.json # Arabic translations
โ โโโ ckb.json # Kurdish translations
โโโ drizzle/ # Database
โ โโโ drizzle.ts # Drizzle client
โ โโโ seed.ts # Database seeding
โ โโโ db/ # Database schema
โ โโโ schema.ts # Table definitions
โโโ docs/ # Comprehensive documentation
โ โโโ component-organization.md
โ โโโ ui-components.md
โ โโโ authentication.md
โ โโโ data-fetching-error-handling.md
โ โโโ internationalization.md
โ โโโ theme-dark-light-mode.md
โ โโโ cookie-management.md
โ โโโ url-parameters.md
โ โโโ motion.md
โโโ types/ # TypeScript type definitions
โ โโโ types.ts # Application types
โ โโโ global.ts # Global type declarations
โโโ validation/ # Zod validation schemas
โ โโโ transaction.validation.ts
โ โโโ category.validation.ts
โโโ providers/ # React context providers
โ โโโ query-provider.tsx # React Query provider
โ โโโ theme-provider.tsx # Theme provider
โโโ proxy.ts # Clerk middleware configuration
โโโ drizzle.config.ts # Drizzle configuration
โโโ AGENTS.md # AI agent coding standards
- Next.js 16 - React framework with App Router
- React 19 - UI library
- TypeScript 5 - Type safety
- Bun - Fast package manager and runtime
- Tailwind CSS 4 - Utility-first CSS framework
- shadcn/ui - Re-usable component library
- Lucide React - Beautiful icons
- Motion - Smooth animations
- Clerk - User authentication and management
- React Query - Server state management
- Zustand - Client state management
- nuqs - Type-safe URL state management
- React Hook Form - Form state management
- Zod - Schema validation
- PostgreSQL - Relational database
- Drizzle ORM - Type-safe ORM with migrations
- Neon - Serverless PostgreSQL (recommended)
- next-intl - i18n for Next.js App Router
- next-themes - Dark/light mode
- cookies-next - Cookie management
- Sonner - Toast notifications
- Recharts - Data visualization and charts
- currency.js - Currency formatting (IQD)
- dayjs - Date manipulation
This project uses shadcn/ui exclusively. To add new components:
npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add dialog
# ... etcStyle: New York
Icons: Lucide React only
Supported languages:
- ๐ฌ๐ง English (
en) - ๐ธ๐ฆ Arabic (
ar) - ๐ฎ๐ถ Kurdish/Sorani (
ckb)
Default language: Kurdish (CKB)
Translation files are located in messages/ directory.
# Development
bun run dev # Start development server on http://localhost:3000
# Build
bun run build # Build for production
bun run start # Start production server
# Linting
bun run lint # Run ESLint
# Database
bun run db:push # Push Drizzle schema to database
bun run db:studio # Open Drizzle Studio (database GUI)
bun run db:seed # Seed database with sample dataComprehensive documentation is available in the /docs folder:
- Component Organization - Component structure and organization
- UI Components - shadcn/ui usage guide
- Authentication - Clerk setup and patterns
- Data Fetching - Server Actions + React Query
- Internationalization - next-intl setup
- Theme Management - Dark/light mode
- Cookie Management - cookies-next usage
- URL Parameters - nuqs for URL state
- Motion/Animations - Animation patterns
Contributions are welcome! Please follow these guidelines:
- Read AGENTS.md for coding standards
- Create a feature branch
- Make your changes following the project patterns
- Test thoroughly
- Submit a pull request
This project is open source and available under the MIT License.
Ahmad Softwaree
- GitHub: @Ahmad-Softwaree
- Portfolio: Ahmad's Portfolio