Giter Site home page Giter Site logo

backend's Introduction

CFM Backend Services

These are all the services the HTTP API requires in order to work. This uses docker-compose in order to work, but every service is meant to be easily isolated if needed; as long as the dependecies are running (generally just redis and the database).

API

Documentation of the public API can be found here. Feel free to create an issue if you find any flaw (either the documentation or code)

Running

First you need to create a frontend network with the following command

docker network create --attachable --driver bridge frontend

Once that is done, that will allow you to also connect the frontend service to the nginx reverse proxy.

Then you need to create a .env file. Running the following commands will clone this repository and copy the testing environment.

git clone https://github.com/cheeseformice/backend
cd backend
cat test.env > .env

You can customize all the variables to your needs. The first time the services are run, the database(s) will generate a volume with the table structures, using the credentials provided in the environment variables. After that happens, if you need to edit the database credentials, you can either delete the generated volumes and force the services to generate new ones, or directly edit the credentials using a mysql client, by using the GRANT command.

If you have access to Atelier801's API

You can fill in A801_* environment variables with the credentials given to you. The following command will build all the needed images and start all the services.

docker-compose up --build --detach

NOTE: Atelier801's API is... HUGE! And this project works by copying it locally. It uses around 36GB of disk space (leaderboards and everything).

The first time it is run, it has to download the whole database, which can take several hours (up to 20 hours depending on your setup). After that is done, any subsequent update will take, in the worse case scenario (slow network, slow disk I/O and slow CPU) it can take up to an hour or two.

If you don't have access to Atelier801's API (or want to run tests)

This repository contains a mockupdb service, which is a mockup of Atelier801's API, containing a way smaller volume of data. This allows you to run tests and experiment with the services, locally.

To run this, you don't need to do any change to your .env file (using test.env directly should work properly), but you can tweak the configurations if you want to.

docker-compose --file docker-compose.test.yml up --build --detach

Checking the logs

Once all the services are running, you can check the logs by running the following command, which will display them in real time.

docker-compose logs --follow

backend's People

Contributors

dependabot[bot] avatar tocutoeltuco avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.