gamelist-backend

command module
v0.0.0-...-e246b8e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 3, 2022 License: MIT Imports: 5 Imported by: 0

README

MyGameList Backend

Backend written in Go.

MyGameList family

Try it yourself

mygamelist.tk is available to try how MyGameList works. No legit email address is required, but all data is subject to change or complete removal.

Technologies

  • Gin
  • GORM
  • gRPC
  • REST
  • JWT

Running in development mode

The easiest way to run the backend is to use go get and go run server.go commands. It will serve static files and allow addition of new games via api, but if you want to use scraper, you should set FORCE_SCRAPE environment variable to 1. For example,

FORCE_SCRAPE=1 go run server.go

This will connect to scraper gRPC server on localhost and fetch the games.

Docker building and running

Build
# docker build -t backend .
Common run command
# docker run -p 8080:8080 \
    --network gamelist \
    -v <path_to_static>/ \
    -v gamelist-data:/data \
    -e SERVE_STATIC=0 \
    -e PRODUCTION_MODE=1 \
    -e STATIC_FOLDER=/static \
    -e DATABASE_DIST=/data/gamelist.db \
    -e FORCE_SCRAPE=0 \
    -e SCRAPER_GRPC_ADDRESS=scraper \
    gamelist-backend

Replace <path_to_static> with your path

If you want to add games by yourself, set PRODUCTION_MODE=0 and add them with api requests (for example, with Postman).

If you want to use scraper and used its tutorial to build and run it, just set FORCE_SCRAPE=1

API and data structure

Check api_desctiption.md and data_structure.md if you want to make api requests to the backend.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package service is a generated GoMock package.
Package service is a generated GoMock package.
test
stress
nolint Will be remade
nolint Will be remade
util

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL