Files
turn-tracker/INITIAL_BUILD_PROMPT.md
AtHeartEngineer da0e03e287 init
2025-07-21 23:02:42 -04:00

2.8 KiB

Create a web application designed for tracking turns in games, specifically optimized for Civilization 6 Play by Cloud, but with a generic and user-friendly interface to allow for other uses.Core Functionality:Lobby Creation: Users can create new lobbies.Player Limit: Each lobby should support between 2 and 10 players.Turn Order Display: Clearly display the current player's turn and the full turn order.Turn Advancement:The current player can click an "End Turn" button to advance the turn.Lobby administrators can manually advance the turn.Turn Order Management (Admin): Lobby administrators must be able to drag-and-drop players to reorder the turn sequence.Current Turn Pointer Management (Admin): Lobby administrators must be able to drag-and-drop a visual pointer (e.g., an arrow) to explicitly set whose turn it is.Lobby Invitation:Each lobby will have a unique, persistent invite link.Users must log in or create an account before they can join a lobby via an invite link.User Lobby Membership: A single user can create and be a member of multiple lobbies simultaneously.User Departure: If a user leaves a lobby, their name should remain in the turn order but be skipped during turn progression. Lobby administrators should also have the option to fully remove a player from the lobby.Lobby Admin Controls: In addition to turn management, lobby administrators should be able to:Rename the lobby.Set a password for the lobby.Kick a player from the lobby.Notifications (CRITICAL FEATURE):The application must provide browser push notifications when it is a user's turn.The frontend should poll the server for turn updates every 5 minutes.This feature should be implemented using Service Workers to enable installability and background notifications.User Authentication:Implement a basic username and password authentication system (no email required for registration or recovery).Super Admin: A "super admin" role must exist, whose credentials are set via environment variables in the Docker container. The super admin's sole function is to reset user passwords if they are lost. No other password recovery mechanism is needed or desired.Data Storage:Client-side: Use IndexedDB for any necessary client-side data persistence.Backend: Use a file-based JSON database for backend data storage to ensure data persists across server restarts.Progressive Web Application (PWA) Features:The application should be a PWA, supporting installability to the home screen and, most importantly, push notifications via Service Workers.Infrastructure & Deployment:The entire application (backend and frontend) should be packaged into a single Docker container.The application is intended for self-hosting on private hardware, behind an Nginx proxy manager for domain linking and SSL (no cloud-specific setup or services are required or desired).