Skip to content

oof2win2/fagc-backend

 
 

Repository files navigation

fagc-backend

Contents

Introduction

The backend for the Factorio Anti-Grief community

View API in Postman

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.

Installation

⬆️ Head back up

  1. Install MongoDB as the database. You can use one of two methods:
    1. 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
    2. 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.
  2. Set up your config.js file according to the config.example.js file.
  3. Run the program with one of:
    1. nodemon
    2. pm2 start pm2.config.js
    3. node .

TODO:

  • 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 99.7%
  • Other 0.3%