Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EFUzfj5akPxyikzGc2iAHM
3.2 KiB
local-dev-stack Specification
Purpose
Lets a developer build, start, seed and check the whole Co-Lite backend on their own machine, with no shared environment.
Requirements
Requirement: Single build for all backend modules
The repository SHALL build and test every kept backend module with one Maven command run from the repository root.
Scenario: Root build succeeds
- GIVEN a fresh clone with JDK 21 and Maven installed
- WHEN the developer runs
mvn -T 1C verifyat the repository root - THEN every kept module compiles and its tests pass
Requirement: Isolated core library version
The Co-Lite core library MUST be published under a version distinct from every other Solvway project on the same machine.
Scenario: Local install does not overwrite other projects
- GIVEN Tastefully's
tastefully-v1core library is in the local Maven repository - WHEN the developer installs Co-Lite's core library
- THEN it is stored as version
colite-v1 - AND the
tastefully-v1artifact is unchanged
Requirement: One command starts the local stack
The repository SHALL start MySQL, Redis, the Pub/Sub emulator and every kept backend service locally with one documented command.
Scenario: Stack starts healthy
- WHEN the developer runs the documented start command
- THEN every service container reaches a running, healthy state
- AND no service logs a startup failure about a missing topic, subscription, schema or dropped service
Requirement: Local database is seeded on first start
The local stack SHALL create the kept service schemas, their reference data, one company and one admin user on first start of an empty database.
Scenario: Empty database is seeded
- GIVEN the local MySQL volume is empty
- WHEN the stack starts
- THEN the schemas
service-system,service-counter,service-member,service-logandservice-emailexist with their tables - AND one company and one admin user exist
Scenario: Seed contains no customer data
- WHEN the seed files are committed
- THEN they contain table definitions and reference rows only, with no Tastefully member, attendance, order or user rows
Requirement: Local stack can be reset
The repository SHALL provide a documented command that deletes local data and reseeds from scratch.
Scenario: Reset restores the seeded state
- GIVEN the developer has changed data in the local database
- WHEN they run the documented reset command and start the stack again
- THEN the database holds only the seeded data
Requirement: End-to-end smoke check
The repository SHALL include a smoke check that logs in as the seeded admin through the gateway, reads from services-counter through the gateway, and calls a public mobile-api endpoint, confirming each succeeds against MySQL.
Scenario: Smoke check passes on a healthy stack
- GIVEN the stack is running and seeded
- WHEN the developer runs the smoke check
- THEN it exits with status 0 and prints HTTP status 200 for each call
Scenario: Smoke check fails loudly
- GIVEN services-counter is stopped
- WHEN the developer runs the smoke check
- THEN it exits with a non-zero status and names the failing call