A modern, mobile-first expense tracking app for splitting bills with friends, built with Next.js, TypeScript, and Tailwind CSS.
- Trip Management: Create and manage trips/events with friends
- Expense Tracking: Add and split expenses easily
- User Management: Simple user management with password authentication
- Balance Calculations: Track who owes whom with automatic calculations
- Mobile-First Design: Responsive design optimized for mobile devices
- QR Code Payments: Upload QR codes for easy payment collection
- Type Safety: Full TypeScript support
- Secure Authentication: Password-protected access with environment variable configuration
- Framework: Next.js 14 (App Router)
- Language: TypeScript
- Styling: Tailwind CSS
- State Management: Zustand
- Form Handling: React Hook Form + Zod
- Icons: Lucide React
- Font: Inter (Google Fonts)
The authentication system follows the PayLater style guide:
- Colors: Indigo primary (#2563EB), semantic colors for feedback
- Typography: Inter font family, proper hierarchy
- Spacing: 8px baseline grid system
- Components: Rounded corners (rounded-xl), subtle shadows
- Accessibility: High contrast ratios, proper focus states
- Node.js 18+
- npm or yarn
- Clone the repository
- Install dependencies:
npm install
-
Create a
.env.localfile in the root directory:# PayLater App Configuration APP_PASSWORD=YourSecurePasswordHere # Database DATABASE_URL="file:./dev.db" # Next.js NEXTAUTH_SECRET=your-secret-key-here NEXTAUTH_URL=http://localhost:3000
-
For production deployment on Vercel, set these environment variables in your Vercel dashboard:
APP_PASSWORD: Your secure production passwordDATABASE_URL: Your production database URLNEXTAUTH_SECRET: A secure random stringNEXTAUTH_URL: Your production domain
See ENVIRONMENT_SETUP.md for detailed configuration instructions.
-
Run the development server:
npm run dev
-
Open http://localhost:3000 in your browser
- Create trips with name, description, and dates
- Add members to trips easily
- View all your trips on the dashboard
- Add expenses to trips with detailed information
- Split expenses equally, by percentage, or exact amounts
- Track who paid and who owes what
- Add users by name (no authentication required)
- Manage user profiles and payment QR codes
- View user balances and payment history
src/
├── app/ # Next.js app router
│ ├── api/ # API routes
│ │ ├── trips/ # Trip management endpoints
│ │ └── users/ # User management endpoints
│ ├── dashboard/ # Main dashboard page
│ └── trips/ # Trip detail pages
├── components/ # Reusable UI components
│ ├── trip/ # Trip-related components
│ ├── user/ # User-related components
│ └── ui/ # Base UI components
└── lib/ # Utilities and stores
├── db.ts # Database connection
└── utils.ts # Utility functions
- Variants: Primary, Secondary, Danger
- Sizes: Small, Default, Large
- States: Loading, Disabled, Active
- Features: Labels, Error states, Helper text
- Validation: Real-time error display
- Accessibility: Proper ARIA labels
- Validation: Zod schema validation
- Error Handling: User-friendly error messages
- State Management: React Hook Form integration
- Password Requirements: Strong password validation
- Input Sanitization: XSS prevention
- Form Validation: Client and server-side validation
- Error Boundaries: Graceful error handling
- Responsive Layout: Works on all screen sizes
- Touch-Friendly: Large tap targets (48px minimum)
- Accessibility: Proper contrast ratios and focus states
- Performance: Optimized for mobile devices
The current implementation includes:
/api/trips- Trip creation and management/api/users- User management and profiles
- SQLite database with Prisma ORM
- Simple user model without authentication
- Trip and expense tracking models
- Client-side validation errors
- Network error handling
- Graceful fallbacks with error boundaries
- OCR receipt processing
- Real-time updates with WebSocket
- Push notifications
- PWA features (offline support)
- Advanced expense splitting options
- Export functionality for expense reports
- Follow the established style guide
- Ensure all components are mobile-first
- Add proper TypeScript types
- Include error handling
- Test on multiple devices
This project is part of the PayLater application suite.