# Tech stack

## Pinned versions

| Layer          | Tech         | Pinned                          |
| -------------- | ------------ | ------------------------------- |
| Runtime base   | Ubuntu       | 24.04                           |
| Backend        | Python       | 3.13                            |
| Backend        | FastAPI      | 0.121+                          |
| Backend        | Uvicorn      | latest                          |
| Frontend       | Node.js      | 22.13 (build); 22 (LTS) runtime |
| Frontend       | TypeScript   | 5.2+                            |
| Frontend       | React        | 18                              |
| Frontend       | React Flow   | 11                              |
| Frontend       | Tailwind CSS | v4                              |
| Frontend       | Vite         | 5                               |
| Database       | PocketBase   | 0.36.4                          |
| Database       | SQLite       | (bundled with PB)               |
| Reverse proxy  | Nginx        | Alpine 3.22                     |
| Eval framework | DeepEval     | 3.8.4                           |
| MCP runtime    | fastmcp      | latest                          |
| Observability  | Langfuse     | v3 (optional)                   |

## Dockerfile shape

4-stage build:

```mermaid
flowchart LR
    PB[pocketbase-stage<br/>Alpine 3.22] --> Final
    FE[frontend-builder<br/>Node 22.13-slim] --> Final
    BE[backend-builder<br/>Ubuntu 24.04] --> Final
    Final[Final runtime<br/>Ubuntu 24.04 + Nginx]
```

Non-root runtime user. `pocketbase`, frontend bundle, and backend wheels are copied into the final stage; no build tools ship to production.

## Required CI tools

| Tool                                      | Job                | Blocks merge?        |
| ----------------------------------------- | ------------------ | -------------------- |
| Ruff (lint + format)                      | `backend-quality`  | Yes                  |
| Mypy                                      | `backend-quality`  | Yes                  |
| Pytest (≥ 70% coverage)                   | `backend-quality`  | Yes                  |
| tsc                                       | `frontend-quality` | Yes                  |
| ESLint                                    | `frontend-quality` | Yes                  |
| Vitest                                    | `frontend-quality` | Yes                  |
| Vite build                                | `frontend-quality` | Yes                  |
| Gitleaks v8.28+                           | `secret-scan`      | Yes                  |
| pip-audit `--strict`                      | `dependency-audit` | Yes                  |
| npm audit `--audit-level=high --omit=dev` | `dependency-audit` | Yes                  |
| Trivy (HIGH+CRITICAL)                     | `container-scan`   | Yes                  |
| Syft (SPDX-JSON)                          | `sbom`             | Soft (artifact only) |

## External dependencies

| Service                   | Role                         | Required?         |
| ------------------------- | ---------------------------- | ----------------- |
| LLM gateway (your choice) | chat completions, embeddings | **Required**      |
| Langfuse                  | tracing, score dashboards    | Optional          |
| GHCR                      | image distribution           | Required for prod |
| Dependabot                | dep updates                  | Recommended       |

See [Architecture / Security](/architecture/security.md) for the trust-zone view of these dependencies.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.edge.nyami.fr/architecture/stack.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
