A sleek, intuitive, and user-friendly web application for streamlining the company expense reimbursement process with AI-powered chatbot assistance, OCR receipt scanning, and automated approval workflows.
- AI-Powered Chatbot: Intelligent assistant available across all roles for expense management
- OCR Receipt Scanning: Automatic extraction of amount, date, and merchant information from receipts
- Role-Based Access Control: Separate interfaces for Employee, Manager, and Admin roles
- Multi-Currency Support: Handle expenses in USD, EUR, GBP, and more
- Automated Approval Workflows: Smart routing based on expense amount and category
- Real-Time Analytics: Comprehensive expense insights and reporting
- Chatbot-Only Interface: No complex forms - just chat naturally
- Submit expenses through conversation
- Check expense status instantly
- Upload receipts with automatic OCR processing
- View personal expense history
- Track approval status
- Dashboard View: Overview of pending approvals and team statistics
- Review and approve/reject expense submissions
- View team expense analytics
- Integrated Chatbot: Quick actions through conversational interface
- Filter expenses by status, date, category
- Bulk approval capabilities
- Complete System Control: Full administrative capabilities
- User management and role assignment
- Configure approval rules based on amount thresholds
- Company-wide analytics and insights
- Department-level reporting
- Currency distribution analysis
- Monthly trend visualization
- Chatbot Support: Administrative actions through AI assistant
- Node.js 18+ and npm/bun installed
- Turso database credentials (already configured)
# Install dependencies
npm install
# or
bun install
# Run the development server
npm run dev
# or
bun devOpen http://localhost:3000 in your browser.
For testing purposes, you can create accounts or use these demo credentials:
Employee Account:
- Email:
employee@company.com - Password:
password123 - Access: Chatbot-only interface for expense submission
Manager Account:
- Email:
manager@company.com - Password:
password123 - Access: Dashboard with approvals + Chatbot
Admin Account:
- Email:
admin@company.com - Password:
password123 - Access: Full system control + Analytics + Chatbot
- Navigate to
/sign-up - Fill in your details (name, email, password)
- After signup, sign in at
/sign-in - You'll be routed to the appropriate interface based on your role
users - User accounts
- id, email, name, role, department, createdAt
expenses - Expense submissions
- id, userId, title, amount, currency, category, description, receiptUrl, status, submittedAt, createdAt, updatedAt
approvals - Approval history
- id, expenseId, approverId, status, comments, approvedAt, createdAt
approvalRules - Automated approval rules
- id, minAmount, maxAmount, requiredApprovers, autoApprove, createdAt
companySettings - System configuration
- id, key, value, createdAt
GET /api/expenses- List expenses with filters (userId, status, category, currency, search, pagination)POST /api/expenses- Create new expenseGET /api/expenses/[id]- Get single expense with detailsPATCH /api/expenses/[id]- Update expensePOST /api/expenses/[id]/approve- Approve expensePOST /api/expenses/[id]/reject- Reject expense
GET /api/users- List users with filters (role, department, search, pagination)
GET /api/analytics- Get expense analytics (total spent, by category, by status, monthly trends)
POST /api/auth/sign-in- Sign inPOST /api/auth/sign-up- Create accountPOST /api/auth/sign-out- Sign out
- Clarity: Clean, uncluttered interfaces with clear visual hierarchy
- Efficiency: Minimal clicks to complete tasks, chatbot reduces friction
- Seamless UX: Smooth transitions, real-time feedback, responsive design
- Accessibility: High contrast, readable fonts, keyboard navigation
- Shadcn/UI components for consistent design language
- Framer Motion for smooth animations
- Lucide React icons for visual clarity
- Tailwind CSS for responsive styling
The AI-powered chatbot can help with:
- "Submit new expense" - Guided expense creation
- "Check expense status" - View all expense statuses
- "Upload receipt" - OCR-powered receipt processing
- "View my expenses" - Personal expense history
- "Show pending approvals" - List of expenses awaiting approval
- "Approve expense #123" - Quick approval by ID
- "View team expenses" - Team-wide expense overview
- All employee actions
- "View analytics" - Company-wide insights
- "Manage users" - User administration
- "Configure rules" - Approval rule management
- All manager and employee actions
- Better-Auth Integration: Industry-standard authentication
- Bearer Token Authentication: Secure API access
- Role-Based Access Control: Middleware-enforced route protection
- Session Management: Secure session handling
- Password Hashing: Encrypted password storage
The application is fully responsive and works seamlessly on:
- Desktop (1920px+)
- Laptop (1280px - 1919px)
- Tablet (768px - 1279px)
- Mobile (320px - 767px)
- Framework: Next.js 15 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS v4
- UI Components: Shadcn/UI
- Database: Turso (LibSQL)
- ORM: Drizzle ORM
- Authentication: Better-Auth
- Animations: Framer Motion
- Icons: Lucide React
- Under $100: Auto-approved
- $100 - $1000: Requires 1 manager approval
- Over $1000: Requires 2 approvals (manager + admin)
draft β pending β approved/rejected
- Employees notified when expenses are approved/rejected
- Managers notified of new expense submissions
- Admins notified of high-value expenses
Pre-configured categories:
- Travel (flights, hotels, transportation)
- Meals (client dinners, team lunches)
- Office Supplies (equipment, stationery)
- Software (licenses, subscriptions)
- Other (miscellaneous expenses)
Supported currencies:
- USD (US Dollar)
- EUR (Euro)
- GBP (British Pound)
- CAD (Canadian Dollar)
- AUD (Australian Dollar)
Currency conversion and reporting available in analytics dashboard.
The system comes pre-seeded with:
- 3 users (employee, manager, admin)
- 18 sample expenses across all statuses
- 3 approval rules
- 4 company settings
- Sign in at
/sign-in - Start chatting with the AI assistant
- Say "Submit new expense" to create expense
- Upload receipt for automatic OCR processing
- Check status anytime through chat
- Sign in at
/sign-in - View Dashboard tab for pending approvals
- Review and approve/reject expenses
- Switch to Assistant tab for quick actions
- Ask chatbot "Show pending approvals"
- Sign in at
/sign-in - View Dashboard for system overview
- Check Users tab for user management
- Review Analytics tab for insights
- Use Assistant for administrative tasks
β 50% Faster Submission: Chatbot eliminates complex forms β 90% Less Data Entry: OCR auto-extracts receipt information β Instant Approvals: Automated workflows for small expenses β Real-Time Visibility: Track expenses from submission to reimbursement β Reduced Errors: AI validation catches common mistakes β Better Insights: Analytics help identify spending patterns
- Clear localStorage and cookies
- Ensure database is accessible
- Check BETTER_AUTH_SECRET in .env
- Verify TURSO credentials in .env
- Check network connectivity
- Review browser console for details
- Refresh the page
- Check browser console for errors
- Ensure you're signed in
Proprietary - All rights reserved
For issues or questions:
- Check the documentation above
- Review API responses in browser DevTools
- Contact system administrator
Built with β€οΈ using Next.js, Shadcn/UI, and Better-Auth