# Tasks Run serially: every group touches build files or shared config. ## 1. Copy modules into the repo - [x] 1.1 Copy the ten kept backend modules (core-libs, core-session, api-gateway, mobile-api, services-auth, services-system, services-counter, services-member, services-log, services-email) from Tastefully `8bd93d15`, using `git -C ~/Projects/tastefully archive 8bd93d15 | tar -x`. Verify: `ls` shows exactly those ten `solvway-*` dirs, and `find . -name node_modules -o -name target` is empty. - [x] 1.2 Copy `solvway-admin-portal` from babyboo `f64d096ea` and `solvway-customer-portal` from Tastefully `8bd93d15` the same way. Verify that `npm ci && npm test && npm run build` passes in each app, or record the pre-existing failures with their output. - [x] 1.3 Scan the copied tree for secrets: `grep -rnEi "(password|secret|apikey|api_key|token|BEGIN .*PRIVATE KEY)\s*[:=]" --include=*.yml --include=*.yaml --include=*.properties --include=*.env* --include=*.json .`. Replace every literal secret with an env placeholder. Verify: re-running the scan shows only placeholders or dev-only values. Commit with the list of replaced keys, never the values. ## 2. Single build - [x] 2.1 Set the core-libs version to `colite-v1` in `solvway-core-libs/pom.xml` (and core-session if it shares the scheme), and set `core-project.version` to `colite-v1` in every kept module pom. Verify: `grep -rn "tastefully-v1\|babyboo-v1" --include=pom.xml .` is empty. - [x] 2.2 Add a root `pom.xml` aggregator (groupId `com.solvway`, artifactId `co-lite`, packaging `pom`) listing the ten modules, core-libs and core-session first. Verify: `mvn -T 1C verify` at the root passes, and `ls ~/.m2/repository/com/solvway/core/solvway-core-libs/` still contains `tastefully-v1` with an unchanged timestamp. Do not run `mvn install` against the Tastefully or babyboo repos. - [x] 2.3 Remove gateway routes to dropped services in `solvway-api-gateway/src/main/resources/application.yml`, and any `app.services.name.*` entries only they use. Verify: the existing gateway tests pass, and `grep -nE "bonus|payment|inventory|stockist|wallet" solvway-api-gateway/src/main/resources/application.yml` is empty. ## 3. Local stack (without seed) - [x] 3.1 Extract every Pub/Sub topic and subscription name used by the kept modules: read each `PubSubConfig`, `PubSubListener` and publisher call, and resolve property values. Write them to `local/pubsub/topics.txt` as `topic subscription` lines, plus publish-only topics as `topic` lines. Verify: every `@Value("${pubsub...}")` key in the kept modules resolves to a name (none unresolved). Result: 32 unique subscriptions plus 9 publish-only topics. There are fewer than the 37 adapter constructions because Tastefully shares some subscription names across services (e.g. `new-member-add-user-subscription` in system, counter and member). This is kept as-is. - [x] 3.2 Add `application-local.yml` to each kept Spring module with the emulator host and `co-lite-local` project id. Verify: `mvn -T 1C verify` still passes. - [x] 3.3 Add `local/docker-compose.yml`: mysql:8, redis:7, the Pub/Sub emulator, a pubsub-init one-shot that reads `topics.txt`, and the eight Java services named as in design decision 4, each with `JAVA_OPTS=-Xmx384m`. Add `local/.env.example` with dev-only values for every env var listed in design Context, and git-ignore `local/.env`. Add `local/up.sh`, which runs `mvn -T 1C -DskipTests package` then `docker compose up -d --build`. Verify: with an empty MySQL (schemas created empty by an init script), `local/up.sh` brings pubsub-init to exit 0, and no service log shows a missing topic or subscription error. Result (2026-11-26): pubsub-init exit 0, 7 of 8 services start on empty schemas, and service-counter stops only on `Table 'service-counter.event' doesn't exist`, which is expected until group 4 seeds the schema. Gateway API keys are mounted from `local/appkeys.json` at `/deployments/appkeys/appkeys.json`, as in k8s. ## 4. Seed (needs the user's Tastefully dump) - [x] 4.1 Ask the user for the dump, giving them this exact command: `mysqldump --no-data --routines --triggers --skip-add-drop-table --databases service-system service-counter service-member service-log service-email > 01-schema.sql`, plus a data dump of an allow-list of reference tables. Build the allow-list from the services-system entities: role, module, system_property, location_hierarchy and the other lookup tables, each checked for personal data before it is listed. Put the files in `local/seed/`. Verify: grep the files for `INSERT INTO \`(member|user|event_attendance|orders)` and it is empty. - [x] 4.2 Write `03-colite.sql`: one company row and one admin user with the Administrator role, a bcrypt hash of the documented dev password, and the column set matching the dumped `user` table. Verify: after `docker compose down -v && local/up.sh`, `SELECT count(*) FROM \`service-system\`.user` returns 1. The admin can log in through `POST /auth/...` via the gateway (endpoint confirmed from services-auth) and gets a token. Result: `POST /auth/authenticate` through the gateway (`api-key` header) returns a JWT for `admin` / `colite-dev-admin`. A wrong password returns 200 with an empty body, which is existing Tastefully behaviour. MySQL runs with `--log-bin-trust-function-creators=1 --innodb-strict-mode=OFF` to load the dumped schema, and its healthcheck uses TCP so services wait for seeding to finish. - [ ] 4.3 Write `local/README.md`: prerequisites (JDK 21, Maven, Docker, registry login), build/up, reset (`docker compose -f local/docker-compose.yml down -v`), the dev login, and how to run one service from an IDE (stop its container, run with profile `local` and `.env` exported). Verify: a second developer follows it on a clean clone without help. If no second developer is available, re-run the documented commands verbatim on a fresh clone in a scratch dir. ## 5. Smoke check - [ ] 5.1 Add `local/smoke.sh` (design decision 8). Verify on a healthy stack: exit 0 and prints `200`. Then `docker compose stop service-counter`: exit non-zero, with the failing URL printed. - [ ] 5.2 Integration: from a fresh clone in a scratch directory, run `mvn -T 1C verify`, `local/up.sh` and `local/smoke.sh`. Verify: all three succeed and `docker compose ps` shows every service running. Paste the outputs into the PR description. ## Workflow follow-up - Code review, then push the branch and confirm the PR target with the user. - Archive the change after merge.