Overall architecture
The project boils down to three applications (the web, the API, the database) running in , on two servers: one for dev, one for prod. A GitLab pipeline tests, builds and deploys them.
At a glance
| Topic | Detail |
|---|---|
| Web | 16, React 19, Node 22 |
| API | 4.2 + , Python 3.11, in prod |
| Database | 17 |
| Servers | 2 Ubuntu on Google Cloud: trinity-dev, trinity-prod |
| Traffic entry | v3.6, HTTPS via |
| Orchestration | in dev, in prod |
| CI/CD | GitLab CI, self-hosted |
| Server configuration | , secrets in |
What runs in production
- The browser calls
trinity.jostud.com. Traefik receives the request and passes it to the web container. - The web builds the page on the server (). To do so, it calls the API at the
API_URLaddress. - The API reads and writes products in PostgreSQL, then answers in .
- The browser receives a complete HTML page. It never talks to the API directly.
The details of this path are in The path of a request.
The machines and the services around them
- Each environment has its own VM, with its own Traefik, database and deploy runner.
- In prod, the API and the web run as two instances: Swarm spreads the requests and replaces them one at a time.
- The runners fetch work from GitLab: nothing comes into the servers from GitLab.
- GitLab copies the repository to GitHub for the school, and sends pipeline durations to Datadog.
The machines, the firewall and DNS are described in Infrastructure, and each connection in Flow matrix.
How code goes live
- The CI runner runs the , test and build jobs, each in a throwaway container.
- Each server also has a deploy runner, which runs the deployment directly on the machine.
- Prod pulls the already-built from the . Dev rebuilds them on the spot.
All the details: The pipeline and Dev and prod environments.
The parts
| Part | Role | Start with |
|---|---|---|
| Web front end | Display and manage products | Overview |
| API | Store products and expose them | Overview |
| DevOps | Test, build, deploy, host | Overview |