How informatica92/match-table-system works
Project Type & Purpose
• This is a single-page, full-stack Streamlit web application (“MATCH Table System”) that lets authenticated users create, view, join, edit, and delete board-game table reservations.
• It integrates with a PostgreSQL database for persistence, Auth0 for authentication, the BoardGameGeek (BGG) API for game metadata, the Telegram Bot API for notifications, and optionally Google Maps.
File Structure Analysis
• Top-level driver: board_game_manager.py (boots the Streamlit app and wires in pages).
• app_pages/: each file is a self-contained Streamlit page (View/Join modes, Create, Map, User, Login, etc.).
• utils/: service-layer modules:
• sql_manager.py (all DB operations)
• bgg_manager.py (BGG API calls)
• telegram_notifications.py (Telegram Bot integration)
• altair_manager.py (chart/timeline generation)
• UI helpers in streamlit_utils.py
• Table-specific data wrappers in table_system_*.
• static/: images, GDPR/legal docs, history CSV.
• Config files: .streamlit/config.toml, DevContainer settings, requirements.txt.
• README outlines the environment variables (DB, Telegram, Auth0, Google Maps, general settings).
Key Components
a. Frontend (Client)
• User’s Web Browser
• Streamlit UI (pages in app_pages/)
b. Backend (Server/Container)
• Streamlit Application (Python process)
• Page Router (board_game_manager.py)
• Service Layer (utils/ modules)
c. Data Store
• PostgreSQL Database (schemas for users, propositions, logs, etc.)
d. External Services
• Auth0 (OIDC provider)
• BoardGameGeek API
• Telegram Bot API
• Google Maps (optional embedded map via URL)
Relationships & Data Flows
1. User → Browser → Streamlit UI (HTTP/WebSocket)
2. Streamlit UI → Auth0 (redirect + token exchange) → UI (user context)
3. Streamlit UI → sql_manager → PostgreSQL (CRUD for users, tables, joins, locations)
4. Streamlit UI → bgg_manager → BGG API (fetch game metadata: images, categories, mechanics)
5. Streamlit UI → telegram_notifications → Telegram Bot API (post new-table notifications)
6. Streamlit UI → altair_manager → Generates timeline/list charts → UI
7. Streamlit UI → Google Maps embed (if GMAP_MAP_URL set)
Architectural Patterns & Principles
• Container/Modular monolith: UI pages (presentation layer) orchestrate calls to a clean service layer.
• Separation of concerns:
• Presentation → app_pages/
• Business logic → utils/
• Persistence → sql_manager.py
• External integration → dedicated modules (bgg_manager.py, telegram_notifications.py)