You can try Open Audit on: https://open-audit-dusky.vercel.app/
An intelligent expense management platform that uses AI to extract data from receipts, detect fraud, calculate taxes, and provide actionable financial insights.
# Clone the repository
git clone https://github.com/<your-org>/OpenAudit.git
cd OpenAudit
# Install backend dependencies and start backend server
cd backend
npm install
npm run dev
# In a new terminal, install frontend dependencies and start frontend server
cd ../frontend/open_audit
npm install
npm run devThe backend runs on http://localhost:5000 and the frontend runs on http://localhost:5173.
- Upload receipts in PDF, JPEG, and PNG formats
- AI-powered extraction using Google Gemini API
- Automatic vendor, amount, date, and category extraction
- Duplicate receipt detection
- Fraud flagging system
- Old regime vs. new regime tax computation (Indian tax system)
- Support for deductions (80C investments, HRA, standard deductions)
- HRA exemption calculations
- Real-time tax savings comparison
- JWT-based authentication with bcrypt password hashing
- Role-based access control (user/admin roles)
- Secure profile management
- Protected routes and endpoints
- View all uploaded receipts with detailed breakdown
- Track total expenses
- Identify and manage flagged receipts
- Analytics on spending patterns
Backend:
- Node.js + Express.js v5.2.1 (REST API)
- PostgreSQL (via Neon cloud database)
- Google Generative AI (Gemini 1.5-flash)
- Multer for file uploads and storage
- JWT (jsonwebtoken) for authentication
- bcrypt for password hashing
Frontend:
- React 19.2.4 with TypeScript
- React Router v7.14.0 for navigation
- Axios v1.15.0 for HTTP requests
- Tailwind CSS v3.4.1 for styling
- React Context API for state management
- Node.js v18 or higher
- PostgreSQL database (Neon recommended for cloud)
- Google Gemini API key (get it from Google AI Studio)
- npm or yarn
First, create your PostgreSQL database:
# Using Neon (cloud)
# Create a project at https://neon.tech and copy the connection string
# Or using local PostgreSQL
createdb open_auditInitialize the database schema:
cd app
psql <DATABASE_URL> -f database/schema.sqlcd app/backend
# Install dependencies
npm install
# Create .env file
cat > .env << EOF
PORT=5000
DATABASE_URL=postgresql://user:password@host:port/database
GEMINI_API_KEY=your_gemini_api_key_here
JWT_SECRET=your_super_secret_jwt_key_here
EOF
# Start the development server
npm run devCreate a
.envfile inbackend/with the values above before starting the server.DATABASE_URLshould point to your PostgreSQL instance,GEMINI_API_KEYmust be valid, andJWT_SECRETis used for auth token signing.
The backend will run on http://localhost:5000
cd app/frontend/open_audit
# Install dependencies
npm install
# Start the development server
npm run devThe frontend will run on http://localhost:5173
app/
├── backend/
│ ├── config/
│ │ └── db.js # PostgreSQL connection pool
│ ├── controllers/
│ │ ├── receiptController.js # Receipt upload & fetch handlers
│ │ ├── authController.js # Auth handlers
│ │ └── taxController.js # Tax calculation handlers
│ ├── middleware/
│ │ ├── authMiddleware.js # JWT verification
│ │ └── upload.js # Multer configuration
│ ├── models/
│ │ ├── user.js # User model with bcrypt
│ │ ├── receipt.js # Receipt data model
│ │ └── tax.js # Tax calculation model
│ ├── routes/
│ │ ├── authRoutes.js # /api/auth endpoints
│ │ ├── receiptRoutes.js # /api/upload, /api/receipts
│ │ └── taxRoutes.js # /api/tax endpoints
│ ├── services/
│ │ ├── geminiServices.js # AI receipt extraction
│ │ ├── authService.js # JWT token management
│ │ └── fraudDetection.js # Fraud detection logic
│ ├── uploads/ # Uploaded receipt files
│ ├── index.js # Express app setup
│ └── package.json
│
├── frontend/
│ └── open_audit/
│ ├── src/
│ │ ├── components/
│ │ │ ├── Navbar.tsx # Navigation bar
│ │ │ └── ProtectedRoute.tsx # Route protection wrapper
│ │ ├── contexts/
│ │ │ └── AuthContext.tsx # Global auth state
│ │ ├── pages/
│ │ │ ├── LoginPage.tsx
│ │ │ ├── RegisterPage.tsx
│ │ │ ├── DashboardPage.tsx
│ │ │ ├── UploadPage.tsx
│ │ │ ├── AdminPage.tsx
│ │ │ └── TaxPage.tsx
│ │ ├── App.tsx # Main app component
│ │ ├── main.tsx # Entry point
│ │ ├── index.css
│ │ └── App.css
│ ├── vite.config.ts
│ ├── tsconfig.json
│ └── package.json
│
├── database/
│ └── schema.sql # PostgreSQL schema
└── README.md
| Method | Endpoint | Body | Description |
|---|---|---|---|
| POST | /api/auth/register |
{name, email, password} |
Register new user |
| POST | /api/auth/login |
{email, password} |
Login user, returns JWT |
| GET | /api/auth/profile |
- | Get logged-in user profile (requires auth) |
| Method | Endpoint | Body | Description |
|---|---|---|---|
| POST | /api/upload |
multipart/form-data (receipt) |
Upload receipt for processing (requires auth) |
| GET | /api/receipts |
- | Get all user receipts (requires auth) |
| Method | Endpoint | Body | Description |
|---|---|---|---|
| POST | /api/tax/calculate |
{annualIncome, investments, otherDeductions, rentPaid} |
Calculate tax for both regimes (requires auth) |
| GET | /api/tax/history |
- | Get tax calculation history (requires auth) |
All endpoints except /api/auth/register and /api/auth/login require JWT authentication:
Authorization: Bearer <jwt_token>
Supported formats:
- PDF (application/pdf)
- JPEG (image/jpeg)
- PNG (image/png)
- Maximum file size: 10MB
The system extracts:
- Vendor/Store name
- Total amount
- Purchase date
- Category (inferred)
- Item details
- Confidence score
The system flags receipts for:
- Unusually high amounts (> ₹10,000)
- Missing critical fields
- Duplicate transactions (same vendor + amount)
- Invalid or suspicious data patterns
- Basic deductions: 80C, HRA, standard deduction
- HRA exemption based on rent paid vs. basic salary
- Progressive tax slabs
- Higher standard deduction (₹75,000)
- Simplified without 80C/HRA deductions
- Competitive tax rates
Terminal 1 - Backend:
cd app/backend
npm run devTerminal 2 - Frontend:
cd app/frontend/open_audit
npm run dev- Authentication:
backend/services/authService.js,backend/middleware/authMiddleware.js - Receipt Processing:
backend/services/geminiServices.js,backend/controllers/receiptController.js - Database Pool:
backend/config/db.js - Frontend State:
frontend/src/contexts/AuthContext.tsx
| Issue | Solution |
|---|---|
| Backend won't start | Check DATABASE_URL and ensure PostgreSQL is running |
| Port 5000 in use | Change PORT in .env or kill the process using the port |
| Receipt extraction fails | Verify GEMINI_API_KEY is valid; check file format/size |
| Database connection error | Verify connection string and network access to database |
| Frontend auth errors | Clear browser localStorage and .env JWT_SECRET |
| CORS errors | Backend must be running on http://localhost:5000 |
- Deploy to Heroku, Railway, Render, or DigitalOcean
- Set environment variables on deployment platform
- Ensure PostgreSQL database is accessible
- Build:
npm run build - Deploy to Vercel, Netlify, or similar
- Update API URL to production backend
The system includes mock data generation for testing without Gemini API key configured.
- Fork the repository
- Create a feature branch
- Commit changes
- Push to branch
- Create Pull Request
# Backend
PORT=5000
DATABASE_URL=postgresql://user:password@host:port/database
GEMINI_API_KEY=your_gemini_api_key
JWT_SECRET=your_secret_key_min_32_chars
# Frontend (optional, if using .env)
VITE_API_URL=http://localhost:5000- Google Gemini API Docs
- Express.js Documentation
- React Documentation
- PostgreSQL Documentation
- Tailwind CSS
MIT License - Feel free to use this project for learning and commercial purposes.
Built during the FantomCode Hackathon 2026
**Happy Auditing! **
PORT=5000
DATABASE_URL=postgresql://username:password@localhost:5432/open_audit
GEMINI_API_KEY=your_api_key_here # Optional
- Start the server:
npm run dev- Navigate to frontend directory:
cd app/frontend/open_audit- Install dependencies:
npm install- Start the development server:
npm run dev- Open the frontend at
http://localhost:5173 - Upload a receipt image
- View extracted data in the dashboard
- Check for flagged receipts
POST /api/upload- Upload receiptGET /api/receipts- Get all receipts
app/
├── backend/
│ ├── controllers/
│ ├── models/
│ ├── routes/
│ ├── services/
│ └── index.js
├── frontend/open_audit/
│ ├── src/
│ │ ├── pages/
│ │ └── App.tsx
└── database/
└── schema.sql