Skip to content

appsinacup/game_server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gamend banner


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 setup to install and setup dependencies.

Now you can visit localhost:4000 from your browser.

Authentication

This application supports two authentication methods:

Browser Authentication (Session-based)

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

API Authentication (JWT)

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

Users

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.

Friends

Social features:

  • Friend requests with accept / reject / block flows.

Lobbies

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.

Server scripting (Elixir)

Extendable server behavior:

  • Hooks on server events (eg. on_user_login, on_lobby_created)

Client SDK

How to deploy Starter Template

  1. Fork this repo (or create a Dockerfile like this):
FROM ghcr.io/appsinacup/game_server:latest

WORKDIR /app

COPY modules/ ./modules/
  1. Go to fly.io and deploy (select the forked repo).
  2. Set secrets all values in .env.example. Run locally fly secrets sync and fly secrets deploy (in case secrets don't deploy/update).
  3. Configure all things from Guides page.
  4. Monthly cost (without Postgres) will be about 5$.

Git hooks

To install precommit hooks, run:

	bin/setup-git-hooks

To skip, run:

	SKIP_PRECOMMIT=1 git commit

About

Open source game server with authentication, user management, lobbies, server scripting, and admin portal

Topics

Resources

License

Stars

Watchers

Forks

Packages