Skip to main content

Deployment Guide

This document covers Evatar's development environment setup, production deployment, Docker containerization, and environment variable reference.


Development Environment​

Backend​

cd backend
python3.11 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
python main.py

Frontend​

cd frontend
pnpm install
pnpm dev

Android​

cd android
./gradlew :app:assembleDebug
adb install app/build/outputs/apk/debug/app-debug.apk

Production Deployment​

Backend: Gunicorn + Uvicorn Workers​

gunicorn main:app \
--workers 4 \
--worker-class uvicorn.workers.UvicornWorker \
--bind 0.0.0.0:8421 \
--timeout 120

Frontend: Static Files + Nginx​

cd frontend
pnpm build
# Deploy frontend/dist/ to Nginx

SQLite Notes​

Evatar uses SQLite with WAL mode. Backup strategy:

sqlite3 /opt/evatar/backend/data/evatar.db ".backup '/backup/evatar-$(date +%Y%m%d).db'"

Docker Deployment​

Use docker compose up -d with the provided docker-compose.yml, Dockerfile.backend, and Dockerfile.frontend.


Environment Variables​

See Configuration for the complete environment variable reference.


Troubleshooting​

IssueSolution
Port conflictChange EVATAR_PORT or stop conflicting process
Permission errorsEnsure data/ directory is writable by the backend process
LLM API errorsCheck LLM config at GET /api/config/llm
Database lockedEnsure no external tools are accessing the DB; try WAL checkpoint
Android connection failureVerify server is running, same LAN, firewall allows port 8421
No analysis after syncVerify LLM config, check backend logs, try manual reprocess