MigrationGuide

Local Hosting Migration Guide

Complete architecture documentation and database schema for migrating the A-Z Insurance Management System from Base44 cloud to a locally hosted infrastructure — compliant with Rwanda's data residency regulations.

~70 Database Tables
React Frontend (Ready)
PostgreSQL Compatible
Recommended Local Stack
LayerTechnologyHostingNotes
Frontend (React)Vite + React (existing code — NO CHANGE)Nginx on local server
Ready to use
Backend APINode.js + Express or NestJSLocal server / Docker
Replaces Base44 functions
DatabasePostgreSQL 16+Local server or Docker
Replace Base44 DB
AuthSupabase self-hosted or KeycloakLocal server / Docker
Replace Base44 Auth
File StorageMinIOLocal server / Docker
S3-compatible local storage
AI ServicesOpenAI / Anthropic APICloud API (data in transit only)
Or use local LLMs with Ollama
Reverse ProxyNginx or CaddyLocal server
Routes traffic, SSL termination

Important Note on AI Features

AI features (quotation generation, policy wording, claims analysis) call external AI APIs (OpenAI/Anthropic). Data sent to these APIs will leave your local server. For full data residency, consider using Ollama with local LLMs (e.g., Llama 3, Mistral) — performance will be lower but data stays local.

Docker Compose (Quick Start)
version: '3.8'
services:
  postgres:
    image: postgres:16
    environment:
      POSTGRES_DB: az_insurance
      POSTGRES_USER: az_admin
      POSTGRES_PASSWORD: your_secure_password
    volumes:
      - postgres_data:/var/lib/postgresql/data
    ports:
      - "5432:5432"

  minio:
    image: minio/minio
    command: server /data --console-address ":9001"
    environment:
      MINIO_ROOT_USER: az_minio
      MINIO_ROOT_PASSWORD: your_minio_password
    volumes:
      - minio_data:/data
    ports:
      - "9000:9000"
      - "9001:9001"

  backend:
    build: ./backend          # Your Node.js API
    environment:
      DATABASE_URL: postgresql://az_admin:password@postgres:5432/az_insurance
      MINIO_ENDPOINT: minio
      OPENAI_API_KEY: your_openai_key
    ports:
      - "3001:3001"
    depends_on:
      - postgres

  frontend:
    build: ./frontend         # Your React app (npm run build)
    ports:
      - "80:80"
    depends_on:
      - backend

volumes:
  postgres_data:
  minio_data:
base44
Edit with Base44