Skip to content

Ahmad-Softwaree/finance

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

9 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ฐ FinanceTrack

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.

Next.js React TypeScript Tailwind CSS PostgreSQL


โœจ Features

๐ŸŽฏ Core Features

  • ๐Ÿ“Š 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

๐Ÿ› ๏ธ Technical Features

  • 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

๐Ÿš€ Getting Started

Prerequisites

  • Bun (Package manager - REQUIRED)
  • Node.js 20+ (Runtime)
  • PostgreSQL (Database)
  • Clerk Account (Authentication)

Installation

  1. Clone the repository

    git clone https://github.com/Ahmad-Softwaree/finance.git
    cd finance
  2. Install dependencies

    bun install
  3. Set up environment variables

    Create a .env file 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
  4. 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
  5. Run the development server

    bun run dev
  6. Open your browser

    Navigate to http://localhost:3000


๐Ÿ“ Project Structure

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

๐Ÿ—๏ธ Tech Stack

Framework & Core

UI & Styling

Authentication & State

  • Clerk - User authentication and management
  • React Query - Server state management
  • Zustand - Client state management
  • nuqs - Type-safe URL state management

Forms & Validation

Database

Internationalization

Other Tools


๐ŸŽจ UI Components

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
# ... etc

Style: New York
Icons: Lucide React only


๐ŸŒ Internationalization

Supported languages:

  • ๐Ÿ‡ฌ๐Ÿ‡ง English (en)
  • ๐Ÿ‡ธ๐Ÿ‡ฆ Arabic (ar)
  • ๐Ÿ‡ฎ๐Ÿ‡ถ Kurdish/Sorani (ckb)

Default language: Kurdish (CKB)

Translation files are located in messages/ directory.


๐Ÿ“œ Scripts

# 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 data

๐Ÿ“š Documentation

Comprehensive documentation is available in the /docs folder:


๐Ÿค Contributing

Contributions are welcome! Please follow these guidelines:

  1. Read AGENTS.md for coding standards
  2. Create a feature branch
  3. Make your changes following the project patterns
  4. Test thoroughly
  5. Submit a pull request

๐Ÿ“„ License

This project is open source and available under the MIT License.


๐Ÿ‘จโ€๐Ÿ’ป Author

Ahmad Softwaree


๐Ÿ™ Acknowledgments


Made with โค๏ธ by Ahmad Softwaree

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published