This is a REST API for the Altzone game. For more detailed API description and additional instructions see the wiki pages
Production https://altzone.fi/api (prod branch)
Latest release https://devapi.altzone.fi/latest-release (main branch)
Dev https://devapi.altzone.fi (dev branch)
Teacher pages https://devapi.altzone.fi/teacher (dev branch)
- First make sure to pick the required versions of npm and node, currently the project works fully on at least version 25.3.0 but not on version 20.0 or older at all.
- Install Node and npm, choose your platform and node version (should be 25.3.0, 20.0 doesn't work), which should be LTS here.
- Install docker. Instructions can be found here.
- Clone the API repo from GitHub https://github.com/Alt-Org/Altzone-Server.git.
- Open a cloned repo in the IDE and install required dependencies with.
npm install
-
First, you need to set up the DB. So please run a script for it from the project root folder:
For Windows (PowerShell):
powershell -ExecutionPolicy Bypass -File .\init-db-on-windows.ps1For Linux (Bash):
bash ./init-db-on-linux.sh
-
Then start MongoDB, Redis and Mosquitto docker services (it will take couple minutes for the first time)
docker compose up
Start the API in dev (watch) mode by running the command in terminal
npm run start:devAbove command will compile TS to JS and create a dist folder with compiled code. This folder should not be removed.
The API will be accessible on your machine on http://localhost:8080/
- Stop API by pressing Ctrl+C with focused terminal.
- Stop DB and all other Docker services by pressing Ctrl+C (couple times to force) and run:
docker compose down
