Skip to content

satisfactorymodding/smr-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

The Satisfactory Mod Repository backend API - a Go-based service providing REST and GraphQL endpoints for mod management.

Quick Start

Prerequisites

Setup

# Install tools and start development services
mise install
# If this command fails, ensure you have Docker running and configured correctly
mise run setup

# Generate code and start API
mise run generate
mise run api

If running api produces errors about the database fails to apply migrations, you may have switched branches without cleaning up after database changes you were working on. The easiest way to get back from this state is to delete the postgres Docker container and delete all not-in-use volumes so it creates a fresh one.

Development Commands

# Code generation (run after schema changes)
mise run generate

# Start API server
mise run api

# Testing
mise run test
mise run coverage

# Linting
mise run lint

# Environment management
mise run setup     # Start PostgreSQL, Redis, MinIO
mise run teardown  # Stop services

Database Access

The development docker compose also includes a pgadmin container for testing database related stuff exposed at http://localhost:5433/. The credentials are specified in docker-compose-dev.yml.

Once logged in, add a server. The "Host name/address" should be postgres, username should be postgres, password should be POSTGRES_PASSWORD from docker-compose.yml.

You can view tables via Servers >(name)> Databases > postgres > Schemas > public > Tables.

Architecture

Tech Stack:

  • Framework: Echo v4 with middleware
  • Database: PostgreSQL with Ent ORM
  • GraphQL: gqlgen with custom resolvers
  • Authentication: Multi-provider OAuth + PASETO tokens
  • Storage: S3-compatible (MinIO for dev)
  • Background Processing: Temporal.io workflows
  • Monitoring: OpenTelemetry tracing

Key Components:

  • REST API at /v1/
  • GraphQL at /v2/ with playground
  • Swagger docs at /swagger/
  • Generated code in generated/
  • Database schemas in db/schema/

Configuration

Create config.json or use environment variables with REPO_ prefix.

Required services:

  1. PostgreSQL - Database (dev: port 5432)
  2. Redis - Cache/sessions (dev: port 6379)
  3. MinIO - Object storage (dev: ports 9000/9001)
  4. OAuth providers - GitHub, Google, Facebook
  5. PASETO keys - Generate with go run cmd/paseto/main.go
  6. VirusTotal API key - For mod scanning

Development services are started automatically with mise run setup. MinIO configuration is included in the setup task.

See config/config.go for full configuration structure.

Development Workflow

  1. Code Generation: Always run mise run generate after modifying:

    • GraphQL schemas (schemas/*.graphql)
    • Database schemas (db/schema/*.go)
    • Swagger annotations
  2. Database Changes: Use Atlas migrations

    • SQL migrations in migrations/sql/
    • Code migrations in migrations/code/
  3. Testing: Tests require development services running

    mise run setup  # Start services
    mise run test   # Run tests

Contributing

Before submitting:

mise run lint     # Check code quality
mise run test     # Run test suite
mise run generate # Regenerate if needed

Development patterns:

  • Use Ent ORM for database operations
  • Implement GraphQL resolvers for complex queries
  • Use Temporal workflows for background processing
  • Follow structured logging with slog
  • Use context for request tracing

About

Satisfactory Mod Repository (SMR) API

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors 10

Languages