mancala/README.md
Halit Aksoy 0903f61455 docs: describe the Java backend
The backend README, how to run and test it, what is easy to get wrong
with the game loop and the shared data formats, and the deployment note.
The web app was played against it in Chrome: a full game with a
spectator, a reload, a restart mid-game, the replay and a game lost on
time.
2026-10-16 11:53:13 +03:00

44 lines
1.3 KiB
Markdown

### Mancala
Mancala is an open source application for playing mancala game online.
## Development
The web and mobile apps use the local `packages/mancala.js` and `packages/core` through `link:` dependencies, so build
those first:
```sh
yarn build:packages # from the repo root
```
After changing a package, rebuild it (or run `yarn dev` in it to rebuild on change); the apps pick up the new `dist`.
Postgres (games and Keycloak), Valkey (live games and caches) and Keycloak run with Docker Compose. Create
`apps/.env` once, then start them:
```sh
cd apps
cat > .env <<EOF
POSTGRES_PASSWORD=postgres
KEYCLOAK_DB_PASSWORD=keycloak
KEYCLOAK_ADMIN_PASSWORD=admin
MANCALA_DB_PASSWORD=mancala
EOF
docker compose up -d --build postgres valkey keycloak
```
Postgres is on `localhost:5433` and Valkey on `localhost:6379`; the backend's defaults point there. Then run the
backend (Java 25 and Quarkus, see `apps/backend/README.md`) and the web app:
```sh
cd apps/backend && ./mvnw quarkus:dev # port 5005
cd apps/frontend && yarn dev # port 1234
```
Docker images for the backend and frontend are built from the repo root:
```sh
docker build -f apps/backend/Dockerfile -t jhalitaksoy/mancala-backend .
docker build -f apps/frontend/Dockerfile -t jhalitaksoy/mancala-frontend .
```