feat: monorepo migration phase 3
App checks / changes (push) Canceled after 0s
App checks / tournament (push) Canceled after 0s
App checks / shifts (push) Canceled after 0s

This commit is contained in:
jfmcarreira committed 2026-10-07 11:38:43 +01:00
1 parent e92ae5064c
commit 561b6a2da9
79 files changed
+4514 -1541

No files matched your search

+29 -9
View File
@@ -1,8 +1,10 @@
# Tournament
Phase 1 retains the legacy Vue/Fastify application under `src/client`, `src/server`
and `src/shared`. The planned `frontend/` and Python `backend/` split follows the
API compatibility port; the current backend remains independently runnable.
The FastAPI backend lives in `backend/app`, with app-specific SQLAlchemy models,
Alembic history, Pydantic schemas, domain services and routers. Vue continues to
use `src/client` and `src/shared` with its existing `/api/...` contract. The final
frontend directory move and removal of retired TypeScript server sources are
tracked as cleanup work in the migration plan.
Shared CRR assets and CSS come from `packages/crr-brand` through Vite's
`@crr-brand` alias. Tokens/base/components load before `src/client/styles.css`;
@@ -21,7 +23,7 @@ make tournament-frontend-dev
```
Copy `apps/tournament/.env.example` to `apps/tournament/.env` and configure
`ADMIN_PASSWORD` and `SESSION_SECRET`. The backend listens on port 8080 and Vite
`ADMIN_PASSWORD` and `SESSION_SECRET`. Uvicorn listens on port 8080 and Vite
on 5173. Development data is stored in `apps/tournament/tournament.sqlite`.
Use consistent `APP_BASE_PATH` and `VITE_BASE_PATH`; `/jogo/` remains the example
deployment prefix, while both support `/`.
@@ -33,9 +35,27 @@ docker compose up --build tournament
Compose loads `apps/tournament/.env`; `TOURNAMENT_BASE_PATH` in the root shell
controls both the frontend build path and backend path (default `/jogo/`). The
`tournament-data` volume contains `/data/tournament.sqlite`. The image is
`crr-tournament`; the current app version remains `1.0.0` in `package.json`.
`crr-tournament`; app version `1.0.0` is recorded in the frontend package and
backend project metadata. The image builds Vue with Node 22 and runs Python 3.13
as UID/GID 1000, matching the old container's database ownership.
Run checks with Node 22+; the CI/container target is Node 22. The legacy package
has no lint script. Its tests cover HTTP/auth/SSE/sub-path behavior and the
deterministic tournament services. Python migration fixtures live in
`migration/fixtures/` at the repository root.
Tests require Node 22+ and uv. `make tournament-test` runs backend pytest,
frontend/shared tests, Vue typechecking and the preserved legacy compatibility
assertions against actual Python services and HTTP/SSE servers. Those assertions
live in `migration/contracts`; their transports are generated only in ignored
`.migration/` staging. CI uses Node 22/Python 3.13 and does not execute snapshots.
Node backend dependencies (Fastify, better-sqlite3 and Zod) have been removed.
## Existing SQLite data
Startup upgrades empty databases with Alembic. Pre-Alembic databases are validated
against all nine legacy tables, columns, defaults, checks, unique/index definitions
and foreign keys before being stamped at `0001_baseline`. Adoption preserves
their schema and rows; there is no export/import. An incompatible schema stops
startup before stamping. SQLite foreign keys, WAL and a 5000 ms busy timeout are
configured on every connection. Migration/stamp operations are transactional.
Keep `SESSION_SECRET` unchanged during cut-over so existing HMAC/base64url admin
sessions remain valid. Cookie name/path, HttpOnly, Strict SameSite, HTTPS behavior
and seven-day lifetime are preserved. `TRUST_PROXY` controls forwarded headers.
Deployments under `/jogo/` retain the legacy proxy-prefix stripping behavior.