2024-06-16 23:31:33 +03:00
|
|
|
# Mancala Frontend
|
2024-03-24 03:13:40 +03:00
|
|
|
|
2024-06-16 23:31:33 +03:00
|
|
|
The web user interface for the Mancala project, written in React.
|
|
|
|
|
|
|
|
|
|
## Getting Started
|
|
|
|
|
|
|
|
|
|
### Install Packages
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
yarn install
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Start in Development Mode
|
2024-03-24 03:13:40 +03:00
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
yarn dev
|
2024-06-16 23:31:33 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
### Development Dependencies
|
|
|
|
|
|
2026-10-14 02:22:13 +03:00
|
|
|
This package links the local packages `@mancala/core` and `mancala.js`. Build them first with `yarn build:packages` in the repo root.
|
|
|
|
|
|
|
|
|
|
### Login
|
|
|
|
|
|
|
|
|
|
Every visitor has a Keycloak session (see `apps/keycloak`): the first visit logs in as a new guest without any
|
|
|
|
|
form, and the account menu on the home page lets guests log in or sign up. Run Keycloak locally with
|
|
|
|
|
`docker compose up keycloak` in `apps/`; the dev server must run on port 1234, which the `mancala-web` client allows.
|
|
|
|
|
|
|
|
|
|
| Build variable | Default |
|
|
|
|
|
|---|---|
|
|
|
|
|
| `SERVER_ADDRESS` | `http://localhost:5005` |
|
|
|
|
|
| `WS_SERVER_ADDRESS` | `ws://localhost:5005` |
|
|
|
|
|
| `KEYCLOAK_URL` | `http://localhost:8080` |
|
2024-12-08 22:47:02 +03:00
|
|
|
|
|
|
|
|
### Docker Build
|
|
|
|
|
|
2026-10-14 02:22:13 +03:00
|
|
|
From the repo root:
|
|
|
|
|
|
2024-12-08 22:47:02 +03:00
|
|
|
```bash
|
2026-10-14 02:22:13 +03:00
|
|
|
docker build -f apps/frontend/Dockerfile --build-arg SERVER_ADDRESS=http://localhost:5000 --build-arg WS_SERVER_ADDRESS=ws://localhost:5000 --build-arg KEYCLOAK_URL=http://localhost:8080 -t mancala-frontend .
|
2024-12-08 22:47:02 +03:00
|
|
|
```
|