KakeiBuddy Deployment Guide

This guide covers local Docker and Render deployment for the FastAPI backend.

Local Docker Compose

From the repository root:

docker compose up --build

This uses:

The backend is exposed at http://localhost:8000.

Dockerfile Options

There are two backend-oriented Dockerfiles:

File Purpose
Dockerfile Root image that copies both backend/ and model/, installs AI-related packages, and runs from /app/backend
backend/Dockerfile Simpler backend-only image intended for running from the backend directory

Prefer the root Dockerfile when AI policy artifacts from both backend and model directories may be needed. Prefer backend/Dockerfile only when building strictly inside backend/.

Backend Database Modes

The backend chooses database configuration in this order:

  1. DATABASE_URL.
  2. PostgreSQL variables: DB_HOST, DB_USER, DB_PASSWORD or DB_PASSWORD_FILE, DB_NAME, DB_PORT.
  3. Local SQLite fallback: sqlite+aiosqlite:///./sql_app.db.

For production, use PostgreSQL. Local SQLite is best for development only.

Render Deployment

render.yaml defines:

Required Render secrets:

Generated or linked values:

Production Checklist

Mobile Build Notes

The Expo app can be run locally with:

cd mobile
npm start

For native development:

npm run android
npm run ios

Before building a production mobile app, configure:

Documentation Site

The documentation website is published from the docs/ folder on the main branch.

GitHub Pages settings:

Source: Deploy from a branch
Branch: main
Folder: /docs
Custom domain: docs.kakeibuddy.me

DNS for the custom domain should include:

Type: CNAME
Name: docs
Value: lizantoinette.github.io