a.k.a. SI reclamation
To use the project locally, make sure the following tools are installed:
- pnpm β for dependency management
- Docker β for running PostgreSQL locally
- Gitleaks β for pre-commit secret detection
To run the project locally, youβll need a .env file at the root of the repo.
You can start by copying the example:
cp .env.example .envand edit .env as needed (at least the PG_* variables). you can create an application for the login here to complete the required informations on the frontend .env
Additional environment variables:
LOG_EXTRA_CONTEXT- Include extra context in logs (tags, comma separated, e.g.,foo=bar,baz=bat)TRUSTED_IP_HEADERS- Comma-separated list of trusted IP headers (e.g.,x-forwarded-for,x-real-ip)
pnpm installdocker compose up
# if first launch (if no migrations add --name <name>)
pnpm db:migratepnpm db:generatepnpm build:backendpnpm devcreate your account and project on this url
- Setup your env var with the given Client ID and Client Secret
- Setup
http://localhost:5173/api/auth/callbackon login url redirection - Setup
http://localhost:5173/loginon logout url redirection
apps/
βββ frontend β React app using TanStack Router + DSFR + RPC client
βββ backend β API server using Hono + Zod + OpenAPI
packages/
βββ ui β Design system / reusable components (Storybook)
| Command | Description |
|---|---|
pnpm dev |
Start frontend + backend in parallel |
pnpm dev:frontend |
Start frontend (@sirena/frontend) |
pnpm dev:backend |
Start backend (@sirena/backend) with .env |
pnpm dev:backend-utils |
Start backend-utils (@sirena/backend-utils) |
pnpm dev:common |
Start common (@sirena/common) |
pnpm dev:ui |
Start storybook (@sirena/ui) |
pnpm build:backend |
Build backend to dist/ (RPC + OpenAPI ready) |
pnpm build:frontend |
Build frontend to dist/ |
pnpm build:backend-utils |
Build backend-utils to dist/ |
pnpm build:common |
Build common to dist/ |
pnpm db:migrate |
Run dev migrations (@sirena/backend) with .env |
pnpm db:migrate:resolve |
Run dev migrations (@sirena/backend) with .env |
pnpm db:generate |
Generate Prisma client from schema (@sirena/backend) with .env |
pnpm db:seed |
Apply seeds to the database (@sirena/backend) with .env |
pnpm db:deploy |
Deploy pending migrations to DB (@sirena/backend) with .env |
pnpm db:studio |
Open Prisma Studio (@sirena/backend) with .env |
pnpm db:reset |
Reset the database (@sirena/backend) with .env |
pnpm backend:codegen |
Generate clients for graphql requests |
pnpm test:e2e |
Run end-to-end tests for frontend (@sirena/frontend) |
pnpm test:e2e:ui |
Run end-to-end tests with UI for frontend (@sirena/frontend) |
pnpm test:unit |
Run unit tests across all packages |
pnpm lint |
Run lint script in all packages (via pnpm -r) |
pnpm lint:staged |
Run staged file linter in each workspace |
pnpm gitleaks:detect-secrets |
Scan staged files for secrets using Gitleaks |
pnpm gitleaks:update-ignored-secrets |
Update the list of ignored secrets for Gitleaks scripts |
pnpm prepare |
Install Husky Git hooks (called automatically by pnpm install) |
- pnpm β Fast, efficient monorepo package manager.
- Docker β Used to run PostgreSQL locally.
- tsc β ESM build system for the backend.
- tsx β Instantly run TypeScript files (used for dev/start/scripts).
- biome β All-in-one linter, formatter, and type checker.
- dotenv-cli β Load
.envfiles when running scripts. - gitleaks β Secret scanner that prevents committing API keys or credentials.
- Biome β Used for formatting, linting, and type checking.
- Recommended: install the Biome VSCode extension
- Hono β Fast, typed web framework.
- Prisma β Type-safe ORM for database modeling and access.
- Zod β Runtime schema validation.
- zod-openapi β Generate OpenAPI schemas from Zod.
- graffle β Client to make Graphql calls.
- graphql-codegen β Client to generate code for Graphql schemas.
- React β UI library used in the frontend app.
- react-dsfr β Design system based on the French governmentβs DSFR.
- @tanstack/react-query β Data fetching and caching.
- @tanstack/react-router β Fully typed SPA routing.
- Vite β Fast dev/build tool.
| Package | Description |
|---|---|
@sirena/ui |
Reusable design system components (with Storybook) |
@sirena/backend |
Main Hono backend with OpenAPI + RPC |
@sirena/common |
package sharing elements from backend end frontend |
@sirena/backend-utils |
package for exporting element to other projects |
@sirena/frontend |
Full React SPA using TanStack Router + Query |
docker compose -f docker-compose.prod.yaml up-
main: Main development branch- All feature branches are created from
main - Automatic deployment to development environment
- Should never be deleted
- All feature branches are created from
-
validation: Validation branch- Merge from
mainat the end of sprints (or more frequently if needed) - Deployment to validation environment
- Hotfixes in validation are pushed to this branch
- Hotfixes must be backported to
mainvia a PR and merge - Should never be deleted
- Merge from
-
production: Production branch- Merge from
validationfor production deployments - Deployment to production environment
- Hotfixes in production are pushed to this branch
- Hotfixes must be backported to
validationthenmainvia PRs and merges - Should never be deleted
- Merge from