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)
- Install Node and npm, choose your platform and node version, 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.ps1
For 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:dev
Above 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