Web app that lets you track and split expenses among multiple users. Backend: Django REST (Django 5 + DRF) with Postgres in production and SQLite for quick local runs. Frontend: React (Vite).
- Split methods: equal, manual/exact, percentage, shares, full owed/owe, excess.
- Session auth with CSRF protection; balances per user/currency, settle-up flow, and activity log.
- CSV export per user with filename
{username}_YYYY-MM-DDTHH-MM-SS.csvordered oldest→newest (UTC timestamps). - Responsive UI (mobile-first) with bottom navigation and two-step expense form.
- Django admin at
/admin.
services:
db:
image: postgres:16
env_file: .env
volumes:
- ./db_data:/var/lib/postgresql/data
ports:
- "5433:5432"
backend:
build:
context: .
dockerfile: Dockerfile.backend
env_file: .env
working_dir: /app/fairkeep
command: >
sh -c "python manage.py migrate --noinput &&
python manage.py runserver 0.0.0.0:8000"
depends_on:
- db
ports:
- "8000:8000"
frontend:
build:
context: .
dockerfile: Dockerfile.frontend
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL}
restart: unless-stopped
depends_on:
- backend
ports:
- "5173:80"
volumes:
db_data:Place a .env in the repo root; Docker Compose picks it up automatically and passes values to the backend and frontend build. Suggested contents for local/dev:
DJANGO_SECRET_KEY=changeme
DJANGO_DEBUG=True
DJANGO_ALLOWED_HOSTS=localhost,127.0.0.1
DJANGO_CSRF_TRUSTED_ORIGINS=http://localhost:8000,http://127.0.0.1:8000
DJANGO_CORS_ORIGINS=http://localhost:5173
DJANGO_TIME_ZONE=Etc/UTC
POSTGRES_DB=fairkeep
POSTGRES_USER=fairkeep_user
POSTGRES_PASSWORD=strongpassword
POSTGRES_HOST=db
POSTGRES_PORT=5432
VITE_API_BASE_URL=http://localhost:8000/api/Adjust hosts/CORS to match your domain (e.g., https://fairkeep.fyulita.xyz) and set DJANGO_DEBUG=False plus a strong DJANGO_SECRET_KEY for production. VITE_API_BASE_URL must end with /api/.
This repo ships with docker-compose.yml tuned for local usage (Django runserver + hot-reload volume, Vite build served by Nginx).
- Create/adjust
docker-compose.ymland.envas above. - Build and start:
docker compose up --build -d
- Create a superuser:
docker compose exec backend python manage.py createsuperuser - Access:
- Backend API/admin:
http://localhost:8000/ - Frontend:
http://localhost:5173/
- Backend API/admin:
Ports are mapped for local convenience (5433 on the host → Postgres 5432 in the container). The backend mounts ./fairkeep for live reload. For production, swap python manage.py runserver.
- Backend:
cd fairkeep && python manage.py runserver(requires local dependencies fromrequirements.txt). - Frontend:
cd frontend && npm install && npm run dev -- --host. - Set
VITE_API_BASE_URLto your backend URL (defaulthttp://localhost:8000/api/).
- See
LICENSE.md.