OPS-01 — Local development stack & seed data
docker compose (Postgres, Redis, MinIO, Mailpit), .env validation, demo seed (products, resellers, delegates, a tour) usable by everyone.
| Field | Details |
|---|---|
| Task code | OPS-01 |
| Phase | P0 — Foundations (cadrage, UX/UI, architecture & contract) |
| Product scope | V1 |
| Status | Done (Sun 18 Oct 2026) |
| Start | Sun 18 Oct 2026 |
| Due | Sun 18 Oct 2026 |
| Responsible | Anis — Full-stack developer |
| Co-responsible | — |
| Effort | 0.25 person-day(s) planned · 1 from scratch · size XS |
| Area · app | DevOps · ops |
| Depends on | SRV-02 |
| Unblocks | — |
| Milestones | — |
Summary
docker compose (Postgres, Redis, MinIO, Mailpit), .env validation, demo seed (products, resellers, delegates, a tour) usable by everyone.
Description
Everyone (Anis, Imad on the mobile side, Akram for reviews) needs a local stack that matches staging and a demo dataset that exercises the real flows (OPS-01, cahier §13.1). This task provides a docker compose stack — PostgreSQL 17 on :5442, Redis 7 on :6390, MinIO on :9100/9101 with buckets created at start, Mailpit on :8125 — Zod-validated .env files per app through packages/env, and a demo seed on top of the reference seeds of SRV-02. The demo data covers the 17 Oct decisions: resellers of each customer type (SUPER_GROS, DEMI_GROS, DETAIL) and one pending validation, products with three prices and attribute values, in-stock and out-of-stock variants, two delegates with zones and a tour for today, staff users per role, a support region. Out of scope: staging/production infrastructure (OPS-02).
Subtasks
| # | Subtask | Owner |
|---|---|---|
| 1 | docker-compose.yml with Postgres 17 (:5442), Redis 7 (:6390), MinIO (:9100 API, :9101 console) and Mailpit (:8125), named volumes and health checks | Anis |
| 2 | MinIO init container creating hoco-public (anonymous read) and hoco-private buckets with CORS for pre-signed uploads | Anis |
| 3 | packages/env schemas per process (api, worker, dashboard, web) failing fast with a readable error on missing or invalid variables; .env.example files | Anis |
| 4 | Demo seed: ~50 products across the three brands with variants, three prices, VAT, attribute values and images | Anis |
| 5 | Demo seed: resellers per customer type and status, one PENDING_VALIDATION account, two delegates with zones, today's tour with 5 visits, staff users per role | Anis |
| 6 | Dev simulators for SMS (OTP printed to the server log) and push (logged), emails captured by Mailpit | Anis |
| 7 | Root scripts: pnpm dev, pnpm db:reset (drop, migrate, seed), pnpm stack:up/down | Anis |
| 8 | Check the demo accounts and data against the mobile flows (reseller sign-in, delegate tour) | Imad |
Deliverables
- docker-compose.yml and docker/minio-init.sh at the repository root
- packages/env/src/{server,worker,dashboard,web}.ts and .env.example per app
- packages/db/src/seed/demo.ts and documented demo credentials in /docs/workflow (local setup page)
Acceptance criteria
-
pnpm stack:up && pnpm db:reset && pnpm devbrings up a working stack on a clean machine - Starting the server with a missing DATABASE_URL fails at boot with a message naming the variable
- The demo seed contains at least one reseller of each CustomerType and one out-of-stock variant
- An OTP requested locally appears in the server log; a staff email appears in Mailpit
- A file uploaded through a pre-signed URL lands in the hoco-private bucket
Requirements covered
| Requirement | Title | Release |
|---|---|---|
| OPS-01 | Three environments: development, pre-production (client acceptance), production | V1 |
Test measures
- CI job that runs db:reset against a service container to prove migrations and seeds apply
- Manual check by Imad: sign in with a demo reseller and a demo delegate against the local server
Risks
- Port clashes with other local projects — non-default ports (5442, 6390, 9100, 8125) are already chosen and configurable in .env
KPI
- Delivered by Sun 18 Oct 2026 within 0.25 person-day(s).
- Every acceptance criterion above demonstrated before hand-off; linked requirements' acceptance criteria pass.
- Zero open critical defects, permission gaps or data-integrity regressions at sign-off.
Generated from content/plan/tasks.json by scripts/generate-team-tasks.mjs. Dates are computed by the scheduler (Sunday–Thursday weeks, holidays excluded) — change the plan, not this page.
SRV-03 — API contract v1 — oRPC contract package, OpenAPI export & mock server
Every V1 endpoint as a typed contract (Zod request/response, errors, pagination) in packages/contracts; OpenAPI 3.1 generated and published; Prism mock server so Imad builds against it the same day.
SRV-04 — Server foundation — Express + oRPC, errors, logging, rate limits, API reference
HTTP app skeleton: oRPC OpenAPI handler under /v1, error envelope, request ids, pino logging, CORS, rate limiting, Idempotency-Key middleware, /health, /openapi.json and the Scalar reference.