Single-service app with FastAPI + React.
- React is built to static files with Vite.
- FastAPI serves API routes under
/api/*. - FastAPI also serves the frontend static build (
frontend/dist). - Production runs as one container and one process (
uvicorn).
- Python 3.11
- Node 20+
- npm
./scripts/dev.sh- Frontend:
http://localhost:5173 - Backend API:
http://localhost:8000/api - Docs:
http://localhost:8000/docs
Vite proxies /api to http://localhost:8000 in development.
docker build -t turtlector:latest .docker run --rm -p 8000:8000 \
-e GEMINI_API_KEY=... \
-e OPENAI_API_KEY=... \
-e GOOGLE_APPLICATION_CREDENTIALS=/app/credentials/google.json \
-v /absolute/path/google.json:/app/credentials/google.json:ro \
turtlector:latestThen open:
- App:
http://localhost:8000/ - Health:
http://localhost:8000/health - Docs:
http://localhost:8000/docs
In Coolify:
- Create an
Applicationfrom this repo. - Choose build type
Dockerfile(not Nixpacks). - Dockerfile path:
./Dockerfile. - Exposed/internal port:
8000. - Set environment variables:
GEMINI_API_KEYOPENAI_API_KEY(if used)GOOGLE_APPLICATION_CREDENTIALS(path inside container)
- Mount Google credentials JSON as a read-only file matching that path.
- Deploy.
- Chat:
POST /api/chat/send - Health:
GET /health