Open source game server with authentication, users, lobbies, server scripting and an admin portal.
Game + Backend = Gamend
Discord | Elixir Docs | API Docs | Guides | Starter Template
To start your server:
- Run
mix setupto install and setup dependencies.
Now you can visit localhost:4000 from your browser.
This application supports two authentication methods:
Traditional session-based authentication for browser flows:
- Email/password registration and login
- Discord OAuth
- Apple Sing In
- Google OAuth
- Steam OpenID
- Facebook OAuth
- Session tokens stored in database
- Managed via cookies and Phoenix sessions
Modern JWT authentication using access + refresh tokens (industry standard):
Token Types:
- Access tokens: Short-lived (15 minutes), used for API requests
- Refresh tokens: Long-lived (30 days), used to obtain new access tokens
User management:
- Multiple sign-in flows supported: Email/password, device tokens (SDK), and OAuth (Discord / Google / Facebook / Apple).
- Per-user profile metadata as JSON
- Account lifecycle: registration, login, password reset, and account deletion endpoints.
Social features:
- Friend requests with accept / reject / block flows.
Matchmaking and lobbies:
- Host-managed behavior, max users, hidden/locked states, and password protection.
- Public APIs are provided for listing, creating, joining, leaving, updating and kicking.
Extendable server behavior:
- Hooks on server events (eg. on_user_login, on_lobby_created)
How to deploy Starter Template
- Fork this repo (or create a Dockerfile like this):
FROM ghcr.io/appsinacup/game_server:latest
WORKDIR /app
COPY modules/ ./modules/- Go to fly.io and deploy (select the forked repo).
- Set secrets all values in
.env.example. Run locallyfly secrets syncandfly secrets deploy(in case secrets don't deploy/update). - Configure all things from Guides page.
- Monthly cost (without Postgres) will be about 5$.
To install precommit hooks, run:
bin/setup-git-hooksTo skip, run:
SKIP_PRECOMMIT=1 git commit