# Co-Lite local stack Runs the whole Co-Lite backend on your machine: MySQL, Redis, the Pub/Sub emulator and the eight Java services, with the same service names as Kubernetes. Everything here is dev-only. ## Prerequisites - JDK 21 and Maven 3.9+ - Docker with Compose v2 - Access to the base image registry: `docker login gitea.containerverse.dev` - About 6 GB of free RAM ## Start From the repository root: ```sh local/up.sh ``` This copies `local/.env.example` to `local/.env` (git-ignored) if it is missing, builds every module with `mvn -T 1C -DskipTests package`, and starts the stack. The services take about a minute to boot after MySQL finishes seeding. Then check it: ```sh local/smoke.sh ``` It prints `smoke: OK` when admin login, a service-counter read and a public mobile-api call all succeed. | What | Where | |---|---| | mobile-api | http://localhost:8080 (header `api-key: colite-local-app-key`) | | api-gateway | http://localhost:8081 (header `api-key: colite-local-gateway-key-000000000000`) | | MySQL | localhost:3307, user `root`, password `colite-dev` | | Admin login | `admin` / `colite-dev-admin` | ## Reset Deletes the database volume; the next start reseeds from `local/seed/`: ```sh docker compose -f local/docker-compose.yml down -v local/up.sh ``` ## Seed data `local/seed/` is loaded only when the MySQL volume is empty, in file-name order: - `00-schemas.sql`: creates the five service schemas. - `01-schema.sql`: table structure from a Tastefully schema-only dump. - `02-reference.sql`: allow-listed reference rows (roles, modules, lookups, messages). - `03-colite.sql`: the Co-Lite company and the dev admin login. Never put Tastefully customer data (members, users, attendance, orders) in these files. ## Rebuild one service after a change ```sh mvn -T 1C -B -q -DskipTests -pl solvway-services-counter -am package docker compose -f local/docker-compose.yml up -d --build service-counter ``` `-am` builds the core library alongside the module; a module cannot be built alone because the `colite-v1` core library is not installed in `~/.m2` by default. Services reach each other by container name (`service-system`, `api-gateway` and so on), so a service run from an IDE outside Docker cannot join the stack. Run it inside the stack and attach a debugger instead: add `-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005` to `JAVA_OPTS` for that service and publish port 5005.