splitwise/README.md
Yadunand Prem f9d5f8b404
fix: update schema to fix multiple primary key issues and switch to node-postgres
- Replace primaryKey constraints with uniqueIndex where needed
- Fix schema for Auth, Contacts, Exchange Rates, Expense Participants, and Accounts tables
- Add missing import for uniqueIndex
- Switch from postgres.js to node-postgres (pg) for Drizzle
- Add proper type safety with TypeScript
- Add graceful shutdown of database connections
2025-05-27 18:01:40 -04:00

2.0 KiB

Splitwise Application

A Splitwise-style expense-splitting application with double-entry bookkeeping and multi-currency support.

Getting Started with Docker

The application is containerized using Docker, making it easy to set up and run locally.

Prerequisites

  • Docker
  • Docker Compose

Running the Application

  1. Clone the repository:

    git clone <repository-url>
    cd splitwise
    
  2. Start the database and backend services:

    docker-compose up -d
    
  3. Generate and run database migrations:

    # Generate migrations from schema
    docker-compose run backend bun run db:generate
    
    # Run migrations
    docker-compose run --profile migration migration
    
  4. Access the application:

Useful Commands

Start specific services:

# Start only the database
docker-compose up -d postgres

# Start Drizzle Studio for database management
docker-compose --profile studio up drizzle-studio

# Run migrations
docker-compose --profile migration up migration

View logs:

# All services
docker-compose logs -f

# Specific service
docker-compose logs -f backend

Rebuild containers:

docker-compose build

Stop all services:

docker-compose down

Reset everything (including database volume):

docker-compose down -v

Development

Project Structure

  • /backend - Backend API built with Bun, Hono, and Drizzle ORM
  • /frontend - Frontend application (to be implemented)
  • /docs - Project documentation

Tech Stack

Backend

  • Runtime: Bun
  • Framework: Hono (TypeScript-first web framework)
  • Database: PostgreSQL
  • ORM: Drizzle
  • Authentication: better-auth
  • Validation: Zod

Frontend (planned)

  • Framework: React with TypeScript
  • Build Tool: Vite
  • Styling: TailwindCSS with Shadcn UI
  • State Management: Zustand
  • Data Fetching: TanStack Query