A modern, full-stack expense tracking application built with React, Express.js, and PostgreSQL. Track your income and expenses with a clean, responsive interface and secure authentication.
- π° Expense Tracker
- π Secure Authentication - User authentication powered by Clerk
- π³ Transaction Management - Add, edit, and delete income/expense transactions
- π Categorization - Organize transactions by custom categories
- π° Real-time Balance - Track your current financial status
- π± Responsive Design - Works seamlessly on desktop and mobile devices
- π¨ Modern UI - Clean interface built with Tailwind CSS and DaisyUI
- π Real-time Updates - Instant transaction updates with optimistic UI
- π Dashboard Overview - Visual representation of your financial data
- Framework: React 19 with TypeScript
- Routing: React Router v7
- Styling: Tailwind CSS v4 + DaisyUI
- State Management: Zustand
- HTTP Client: Axios
- Icons: Lucide React
- Notifications: React Hot Toast
- Build Tool: Vite
- Authentication: Clerk React
- Runtime: Bun
- Framework: Express.js
- Database: PostgreSQL
- ORM: Drizzle ORM
- Authentication: Clerk Express
- CORS: Enabled for cross-origin requests
- Logging: Morgan
- Environment: dotenv
- Package Manager: Bun
- Database Migrations: Drizzle Kit
- Linting: ESLint
- Type Checking: TypeScript
Before you begin, ensure you have the following installed:
- Bun (latest version) - Download here
- PostgreSQL (v12 or higher) - Download here
- Node.js (v18 or higher) - Download here
-
Clone the repository
git clone https://github.com/yourusername/expense-tracker.git cd expense-tracker -
Install dependencies for both frontend and backend
# Install backend dependencies cd Backend bun install # Install frontend dependencies cd ../Frontend bun install
-
Backend Environment Variables
Create a
.envfile in theBackenddirectory:# Server Configuration PORT=3000 # Database Configuration DATABASE_URL=postgresql://username:password@localhost:5432/expense_tracker # Clerk Authentication CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key CLERK_SECRET_KEY=your_clerk_secret_key
-
Frontend Environment Variables
Create a
.envfile in theFrontenddirectory:# Clerk Authentication VITE_CLERK_PUBLISHABLE_KEY=your_clerk_publishable_key # API Configuration VITE_API_URL=http://localhost:3000/api
-
Create PostgreSQL Database
createdb expense_tracker
-
Run Database Migrations
cd Backend bun run generate bun run migrate -
Optional: Open Drizzle Studio
bun run studio
-
Start the Backend Server
cd Backend bun run devThe backend will be available at
http://localhost:3000 -
Start the Frontend Development Server
cd Frontend bun run devThe frontend will be available at
http://localhost:5173
http://localhost:3000/api
GET /pingGET /transactions # Get all transactions for authenticated user
POST /transactions # Create a new transaction
PUT /transactions/:id # Update a transaction
DELETE /transactions/:id # Delete a transactionPOST /users/sync # Sync user data with Clerk
GET /users/profile # Get user profile{
"type": "expense",
"amount": "29.99",
"category": "Food & Dining",
"note": "Lunch at restaurant",
"date": "2025-09-01T12:00:00Z"
}expense-tracker/
βββ Backend/
β βββ src/
β β βββ controllers/ # Request handlers
β β βββ db/ # Database configuration and schema
β β βββ routes/ # API routes
β β βββ utils/ # Utility functions
β β βββ index.ts # Server entry point
β βββ drizzle/ # Database migrations
β βββ package.json
βββ Frontend/
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Application pages
β β βββ store/ # State management
β β βββ lib/ # Utility libraries
β β βββ App.tsx # Main application component
β βββ package.json
βββ README.md
If you find this project helpful, please consider:
- β Starring the repository
- π Reporting bugs via GitHub Issues
- π‘ Suggesting new features
- π Sharing with others
- Clerk - For seamless authentication
- Drizzle ORM - For type-safe database operations
- Tailwind CSS - For utility-first styling
- DaisyUI - For beautiful UI components
- Lucide - For beautiful icons