A platform for distributing the Rules for the Narrative Skirmish game Khora, and tools for players to manage their games, missions, squads etc.
Built using:
Backend
- Node
- Typescript
- Koa
- OpenApi
- JOI
Frontend
- Lit
First step is to run
npm installThis will use NPM workspaces to install all of the root and subpackage dependencies. Note: All packages have their own NPM scripts for compilation, tests etc.
To start typescript compilation in dev mode run
npm run ts -- --watchTo start rollup compilation in dev mode run
cd ./apps/website
npm run rollup -- --watchThe dev server uses docker compose, and pm2 with watch mode
docker-compose upComponents that will be shared between projects exist within the packages/ui folder and can be viewed with storybook.
The API launches on port 3000 The website launches on port 3001
Tests can be run from the root of the repo with
npm run testYou can also provide the workspace to run individual packages.
The project uses OpenAPI format config (although exported from TS as const objects). When passed to the createResource function you'll get a fully type safe API that provides both the types configured in the request, as well as the expected response and status code.
Further the OpenAPI config is converted to a JOI schema and used by Koa-Joi-Router to validate both the request and response.
There is a type helper that can be exported and then consumed by the client to generate a typesafe request API using fetch on the frontend.