Guidance for AI coding agents working in this repository. Run everything with
Docker — the stack is a docker compose project.
Two services (see docker-compose.yml):
| Service | What it is | Host port |
|---|---|---|
backend |
FastAPI + LangChain agent (Netra) | 8000 |
frontend |
React/Vite UI served by vite preview |
5173 |
The frontend calls the backend directly via VITE_BACKEND_URL (baked at build
time) or the runtime frontend/public/config.js — there is no reverse proxy.
The backend enables CORS for this.
Important: neither Dockerfile mounts your source as a volume — both images
COPY the code at build time. There is no hot reload. To apply code edits
you must rebuild the image and recreate the container.
-
Create the environment file from the template:
cp .env.example .env
-
Fill in the required values in
.env:OPENAI_API_KEYMODELNETRA_OTLP_ENDPOINTNETRA_API_KEY
.envis gitignored — never commit it. -
Build the images and start the stack detached:
docker compose up --build -d
-
Verify:
- UI: open http://localhost:5173
- Backend:
curl http://localhost:8000/health
Because source is copied into the image at build time, edit → rebuild → recreate:
docker compose up -d --build--build rebuilds the image; up -d recreates the container from it. If the
build layer cache is stale, add --no-cache.
Env vars are injected at container start. To apply .env edits, recreate the
containers so they re-read env_file:
docker compose up -dPrefer up -d over docker compose restart, which may reuse the old env in
some compose versions.
- Stream backend logs:
docker compose logs -f backend - Stream frontend logs:
docker compose logs -f frontend - Stop and remove containers:
docker compose down
There are no named volumes; app data lives in a JSON file inside the backend
source (backend/src/backend/db/data.json), so docker compose down does not
wipe data.
- Backend fails to start with a pydantic Settings validation error — a
required variable is missing or empty in
.env(e.g.OPENAI_API_KEY,MODEL). Fix.env, thendocker compose up -d. - Port already in use —
8000or5173is taken. Check withdocker compose psand stop the conflicting process. docker composecommand not found — the Docker Compose v2 plugin is not installed; install it for your Docker distribution.