A modern expense-splitting and subscription-sharing application built with a clean, scalable architecture.
splitable/
├── apps/
│ ├── api/ # Express.js backend
│ └── web/ # React frontend
├── packages/
│ └── shared/ # Shared types, enums, validation
├── infra/
│ └── docker/ # Docker configurations
└── docs/ # Documentation
Backend:
- Node.js + Express.js + TypeScript
- PostgreSQL with Drizzle ORM
- JWT authentication (access + refresh tokens)
- REST API architecture
Frontend:
- React + TypeScript
- Tailwind CSS
- React Query for server state
- Zustand for client state
- React Router for navigation
Infrastructure:
- Docker + Docker Compose
- Nginx (production)
- PostgreSQL
- Redis (caching/sessions)
- Node.js 20+
- npm 10+
- Docker & Docker Compose
- PostgreSQL (or use Docker)
-
Clone and install dependencies:
git clone <repo-url> cd splitable npm install
-
Start the database:
cd infra/docker docker-compose up -d -
Configure environment:
cp apps/api/.env.example apps/api/.env # Edit .env with your settings -
Run database migrations:
npm run db:generate npm run db:migrate
-
Start development servers:
npm run dev
This starts:
- API server at
http://localhost:3001 - Web app at
http://localhost:5173
- API server at
For a full Docker development environment:
cd infra/docker
docker-compose -f docker-compose.yml up -dThis starts:
- PostgreSQL at
localhost:5432 - Redis at
localhost:6379 - MailHog (SMTP) at
localhost:1025(Web UI atlocalhost:8025)
src/
├── config/ # Environment configuration
├── controllers/ # Request handlers
├── database/
│ └── schema/ # Drizzle schema definitions
├── middleware/ # Express middleware
├── routes/ # API routes
├── services/ # Business logic
└── utils/ # Utilities and helpers
src/
├── components/ # Reusable UI components
│ ├── auth/ # Auth-related components
│ └── ui/ # Base UI components
├── contexts/ # React contexts
├── layouts/ # Page layouts
├── lib/ # Utilities and API client
├── pages/ # Page components
└── stores/ # Zustand stores
src/
├── enums/ # Shared enumerations
├── types/ # TypeScript interfaces
├── validation/ # Zod schemas
└── constants/ # Shared constants
The application uses JWT-based authentication with:
- Access tokens: Short-lived (15 minutes)
- Refresh tokens: Long-lived (7 days) with rotation
- Password hashing: bcrypt with 12 rounds
- Rate limiting: On auth endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/v1/auth/register |
Create account |
| POST | /api/v1/auth/login |
Login |
| POST | /api/v1/auth/refresh-token |
Refresh access token |
| POST | /api/v1/auth/logout |
Logout |
| POST | /api/v1/auth/verify-email |
Verify email |
| POST | /api/v1/auth/forgot-password |
Request password reset |
| POST | /api/v1/auth/reset-password |
Reset password |
| GET | /api/v1/auth/me |
Get current user |
Key entities:
- users: User accounts and profiles
- groups: Expense groups
- group_members: Group memberships with roles
- expenses: Expense records
- expense_participants: Expense splits
- debts: Debt records between users
- payments: Payment records
- subscriptions: Shared subscription services
- notifications: User notifications
- activity_logs: Audit trail
Tailwind CSS-based design system with:
- Buttons: Primary, secondary, outline, ghost, danger variants
- Inputs: With labels, error states, helper text
- Cards: Header, body, footer sections
- Avatars: With initials fallback
- Badges: Status indicators
Dark mode support built-in.
-
Complete API endpoints:
- User profile management
- Group CRUD operations
- Expense creation and splitting
- Debt management
- Payment workflow
-
Frontend features:
- Expense creation form
- Group management
- Debt settlement flow
- Real-time notifications
-
Infrastructure:
- Email service integration
- File upload service
- Background job processing
- Mobile apps (React Native)
- Push notifications
- Multi-currency support with exchange rates
- CSV/PDF export
- OAuth providers (Google, Apple)
- Debt simplification algorithm
- Receipt OCR
# Run all tests
npm test
# Run with coverage
npm run test:coverage# Build all packages
npm run build
# Build Docker images
docker-compose -f infra/docker/docker-compose.prod.yml build
# Deploy
docker-compose -f infra/docker/docker-compose.prod.yml up -dMIT License - see LICENSE file for details.