Wheel Game
The Wheel Game is an interactive spinning wheel platform that allows users to create customizable wheel configurations, manage prizes, and generate shareable links for game instances.Overview
The Wheel Game is built as a standalone Next.js application with:- Multi-tenant architecture using Nile SDK for data isolation
- RESTful API with full CRUD operations
- OpenAPI specification for API documentation
- TypeScript client auto-generated from OpenAPI spec
- Material-UI components with Pegasus theme
Architecture
Deployment
- Frontend: Deployed at
sstxt.us/w*(slug-based routing) - API: Deployed at
api.sstxt.us/games/wheel/* - Dashboard: Admin interface at root
/
Database Schema
All tables are tenant-scoped for multi-tenancy:Profiles
Wheel configuration profiles that define the basic structure.| Column | Type | Description |
|---|---|---|
id_profile | UUID | Primary key |
tenant_id | UUID | Tenant identifier |
name | VARCHAR | Profile name |
version | VARCHAR | Version number |
config | VARCHAR(64) | SHA256 hash of configuration |
Prizes
Prize definitions with images.| Column | Type | Description |
|---|---|---|
id_prize | UUID | Primary key |
tenant_id | UUID | Tenant identifier |
name | VARCHAR | Prize name |
image | TEXT | URL to prize image |
Configs
SHA256-hashed configurations containing prizes, audio, volume, activation, and expiration settings.| Column | Type | Description |
|---|---|---|
id_config | VARCHAR(64) | SHA256 hash (primary key) |
tenant_id | UUID | Tenant identifier |
prizes | JSONB | Array of prize configurations |
audio | JSONB | Audio settings (wheel, present) |
volume | JSONB | Volume settings (wheel, present) |
activation | JSONB | Activation settings |
expiration | JSONB | Expiration settings |
Instances
Active game instances linking profiles, configs, and links.| Column | Type | Description |
|---|---|---|
id_instance | UUID | Primary key |
tenant_id | UUID | Tenant identifier |
id_profile | UUID | Foreign key to profiles |
id_link | UUID | Foreign key to links |
config | VARCHAR(64) | SHA256 hash reference |
status | VARCHAR | active, completed, or expired |
result | JSONB | Game result data |
Links
Shareable links mapping domains and slugs to instances.| Column | Type | Description |
|---|---|---|
id_link | UUID | Primary key |
tenant_id | UUID | Tenant identifier |
domain | VARCHAR | Domain name (e.g., sstxt.us) |
slug | VARCHAR | URL slug (e.g., w12345) |
id_instance | UUID | Foreign key to instances |
API Endpoints
All API endpoints are prefixed with/api/games/wheel/ and require a x-tenant-id header.
Profiles
GET /api/games/wheel/profiles- List all profilesPOST /api/games/wheel/profiles- Create a profileGET /api/games/wheel/profiles/{id}- Get profile by IDPATCH /api/games/wheel/profiles/{id}- Update profileDELETE /api/games/wheel/profiles/{id}- Delete profile
Prizes
GET /api/games/wheel/prizes- List all prizesPOST /api/games/wheel/prizes- Create a prizeGET /api/games/wheel/prizes/{id}- Get prize by IDPATCH /api/games/wheel/prizes/{id}- Update prizeDELETE /api/games/wheel/prizes/{id}- Delete prize
Configs
GET /api/games/wheel/configs- List all configsPOST /api/games/wheel/configs- Create a configGET /api/games/wheel/configs/{id}- Get config by hashDELETE /api/games/wheel/configs/{id}- Delete config
Instances
GET /api/games/wheel/instances- List all instancesPOST /api/games/wheel/instances- Create an instanceGET /api/games/wheel/instances/{id}- Get instance by IDPATCH /api/games/wheel/instances/{id}- Update instanceDELETE /api/games/wheel/instances/{id}- Delete instance
Links
GET /api/games/wheel/links- List all linksPOST /api/games/wheel/links- Create a linkGET /api/games/wheel/links/{id}- Get link by IDGET /api/games/wheel/links/lookup?domain={domain}&slug={slug}- Lookup by domain+slugPATCH /api/games/wheel/links/{id}- Update linkDELETE /api/games/wheel/links/{id}- Delete link
Getting Started
See the Quickstart Guide for setup instructions.Resources
- OpenAPI Spec: /docs/openapi/wheel.json
- GitHub: sendsational-inc/send-v5
- Nile Documentation: thenile.dev/docs
