Giter Site home page Giter Site logo

mklierman / smr-api Goto Github PK

View Code? Open in Web Editor NEW

This project forked from satisfactorymodding/smr-api

0.0 0.0 0.0 1.2 MB

Satisfactory Mod Repository (SMR) API

Home Page: https://ficsit.app

License: GNU General Public License v3.0

Go 98.01% Nix 0.05% PLpgSQL 1.63% Dockerfile 0.31%

smr-api's Introduction

SMR API GitHub Workflow Status GitHub release (latest SemVer) codecov GitHub go.mod Go version

The Satisfactory Mod Repository backend API

Running

If you are under Linux, you will need to install the following packages (or your distro's equivalent):

sudo apt update && sudo apt install -y build-essential libpng-dev

You will also need to generate the GQL server and REST docs via:

go generate -x -tags tools ./...

To start the API, execute:

go run cmd/api/serve.go

Configuration

Running the API has a lot of pre-requisites.

To run the API, you will need to have a working Postgres, Redis and Storage. There is a dev composefile that you can start via:

docker-compose -f docker-compose-dev.yml up -d

It is suggested you create a configuration file at config.json (but you can also use environment variables).

Main configuration options:

  1. Postgres (started with dev composefile)
  2. Redis (started with dev composefile)
  3. B2 or S3 (or anything S3-compatible e.g. minio (started with dev composefile))
  4. GitHub OAuth (https://github.com/settings/developers)
  5. Google OAuth (https://console.developers.google.com/)
  6. Facebook OAuth (https://developers.facebook.com/apps/)
  7. Paseto keys (generated via go run cmd/paseto/main.go)
  8. Frontend URL (needed for Google OAuth, otherwise can be ignored)
  9. VirusTotal API key (https://www.virustotal.com/gui/sign-in)

The config format can be seen in config/config.go (each dot means a new level of nesting).

After startup requires the following minio commands to be executed:

mc alias set local http://localhost:9000 minio minio123
mc admin user svcacct add local minio --access-key REPLACE_ME_KEY --secret-key REPLACE_ME_SECRET
mc anonymous set public local/smr

Contributing

Before contributing, please run the linter to ensure the code is clean and well-formed:

golangci-lint run

For some simple formatting issues you can use the --fix flag, but for more complex issues you will need to fix the code:

golangci-lint run --fix

smr-api's People

Contributors

aaomidi avatar budak7273 avatar feyko avatar porisius avatar vilsol 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.