API Reference game_server_web v#1.0.938

Copy Markdown

Modules

The entrypoint for defining your web interface, such as controllers, components, channels, and so on.

Public-facing achievements page.

Admin LiveView for listing and managing users.

Health check endpoint for the API.

OpenAPI specification for the Game Server API.

Plug to assign current_scope from Guardian's loaded user resource.

Handles authentication errors for the Guardian pipeline.

Guardian implementation for JWT-based authentication.

Guardian pipeline for optional API JWT authentication.

Guardian pipeline for API JWT authentication.

A tiny runtime SVG loader for hero-style icons stored under priv/static/heroicons/.

Tracks active WebSocket channel and WebRTC peer connections using a Registry with :duplicate keys.

Serves static assets (images, etc.) from the blog or changelog directories.

Provides core UI components.

This module is invoked by your endpoint in case of errors on HTML requests.

This module is invoked by your endpoint in case of errors on JSON requests.

Periodic cleaner for old geo traffic minute buckets.

A module providing Internationalization with a gettext-based API.

Provides translation completeness statistics for a given locale.

Channel for per-group realtime events.

Channel for broadcasting global group list events.

Shared helpers for safely parsing controller parameters.

Compatibility facade for the host-owned layout shell.

Public-facing leaderboards view.

Shared helpers for LiveView rate limiting and client IP extraction.

Channel for broadcasting global lobby list events.

Channel for lobby realtime events.

LiveView on_mount hook that sets the Gettext locale from the session.

on_mount helper for LiveView that ensures :theme is assigned on the socket. LiveViews can rely on @theme being present whether rendering via an HTTP request or a websocket socket lifecycle.

LiveView on_mount hook that registers the LiveView process with GameServerWeb.ConnectionTracker when the socket is connected.

This module contains pages rendered by PageController.

Small helper to build pagination meta for API list endpoints.

Channel for party realtime events.

LiveView wrapper that embeds the Godot web export (/game/index.html) inside the app layout so the navbar is visible.

Plug to serve ACME HTTP-01 challenge files for Let's Encrypt certificate validation.

Reads the phx_theme cookie (set by the client-side theme switcher) and assigns :color_mode so that the root layout can render the data-theme attribute server-side, preventing a Flash of Unstyled Content (FOUC) when the user has selected dark mode.

Serves blog & changelog images directly from the endpoint plug pipeline, bypassing the code-reloader and full browser pipeline.

Runtime CORS plug that delegates to Corsica using values read from application environment at startup. This allows PHX_ALLOWED_ORIGINS to be configured at runtime (via config/runtime.exs).

Plug that gates routes behind environment-variable feature flags.

Adds Cross-Origin headers required by Godot 4 web exports.

Resolves the client's country and stores it on conn.assigns[:country].

Plug that blocks requests from banned IP addresses.

Plug that assigns the resolved theme map into conn.assigns.theme so templates and LiveViews can render provider-driven copy alongside the host-owned branding assets.

Extracts an optional locale prefix from the URL path (e.g. /es/settings) and sets the Gettext locale accordingly.

Authentication for the /metrics endpoint.

Plug that rate-limits incoming HTTP requests per client IP.

Extracts the real client IP from proxy headers and sets conn.remote_ip.

A plug that logs the total request duration at the end of the request. This runs before the Router and captures the entire pipeline duration.

Ensures the current API request is performed by an admin user.

Sets baseline security headers on every response.

A small Plug that sets Sentry scope information for each request.

Prometheus metrics exporter using PromEx.

Custom PromEx plugin that exports geo-traffic Prometheus metrics.

ETS-backed rate limiter powered by Hammer.

Computes Subresource Integrity (SRI) hashes for static assets.

Error response schema

Health check response schema

Describes the payload stored in OAuthSession.data when a session completes or errors.

Schema describing the response for OAuth session status checks

Helpers for session / cookie based authentication and LiveView mounts.

Channel for sending per-user realtime updates (e.g. metadata changes).

Manages a server-side WebRTC PeerConnection for a single user.

Mix Tasks

Exports all PO translations and theme JSON config for a locale to CSV.

Imports translations from a CSV file back into PO files and theme JSON config.