The backend for the Factorio Anti-Grief community
This README is focused solely on the installation instructions and the workings of the API. If you would like an explanation for this API, please see this.
- Install MongoDB as the database. You can use one of two methods:
- Use MongoDB Atlas. This is a completely free service offered by MongoDB. It is however limited to 350MB of storage (you won't realistically reach that quickly) and can be hosted further away than you can host it yourself, which results in higher latency. Set an instance up here, they offer a free and paid tier
- Set up your own MongoDB instance locally. This is more tedious as you install the database on your own system. It however has the advantage of generally being lower-latency with regards to the bot and API, as there is a much smaller physical distance separating the two (and also less electronics). Install according to this guide for free
- Either of the installations must be a replica set so that change streams can be used. By default, this is already set up on Atlas but needs to be done according to this guide.
- Set up your
config.js
file according to theconfig.example.js
file. - Run the program with one of:
nodemon
pm2 start pm2.config.js
node .
- Maybe migrate the bot's config database to the API and make the bot not use the config database entirely?
- Use
fastify-helmet
- Firgure out how to use
yup
with response validation