Add server architecture initial plan and legal TODO
- Draft full server architecture in Server/initial-plan.md covering all services: Gateway, Auth, Game, Chat, Collection, Bazaar, Admin, Leaderboard, Content, Web, and CDN/Asset Pipeline - Tech stack decisions: PostgreSQL, Redis, NATS, gRPC, Ceph (RADOSGW), Kubernetes, Stripe (implemented but disabled) - Chat persistence: 30-day PostgreSQL hot window, cold archive to remote MySQL - Leaderboard: Redis Sorted Sets for live rankings, PostgreSQL for history - Asset pipeline: Admin card builder → Ceph origin → CDN → client - Create Shared/legal.md with prioritized legal TODO list covering TOS, EULA, Privacy Policy, GDPR, Stripe/PCI compliance, CCPA, Cookie Policy, and COPPA Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
This commit is contained in:
@@ -0,0 +1,390 @@
|
||||
# SOR Server Architecture — Initial Plan
|
||||
|
||||
## Overview
|
||||
|
||||
The server is composed of purpose-built services communicating over an internal TCP network. Clients connect exclusively through the Gateway via WebSocket. All inter-service communication is TCP-based.
|
||||
|
||||
**Scale target**: hundreds of thousands of concurrent users. Every service is designed for horizontal scaling from the start.
|
||||
|
||||
---
|
||||
|
||||
## Tech Stack
|
||||
|
||||
All components are open-source and self-hosted. No licensing fees.
|
||||
|
||||
| Component | Choice | License |
|
||||
|---|---|---|
|
||||
| Primary database | PostgreSQL | PostgreSQL License |
|
||||
| Session store / live game state / rankings | Redis (Community Edition) | BSD 3-Clause |
|
||||
| Async event bus (inter-service fan-out) | NATS | Apache 2.0 |
|
||||
| Synchronous inter-service RPC | gRPC + Protobuf | Apache 2.0 |
|
||||
| Container orchestration | Kubernetes | Apache 2.0 |
|
||||
| Client transport | WebSocket | Open standard |
|
||||
| Object storage (CDN origin) | Ceph (via RADOSGW S3 API) | LGPL v2.1 |
|
||||
| Chat cold storage (archive) | Remote MySQL (third-party hosted, unlimited storage deal) | N/A |
|
||||
|
||||
**Payment processing** is the one mandatory third-party service. Accepting real-money card payments requires PCI DSS compliance and direct card network relationships — this cannot be built in-house. Stripe is the recommended processor (per-transaction fee only, no monthly license). The integration will be **implemented but disabled** until real-money features are ready to launch. All other payment handling logic (wallets, currency conversion, transaction records) is built internally in the Bazaar service.
|
||||
|
||||
---
|
||||
|
||||
## Topology
|
||||
|
||||
```
|
||||
[ Thick Client ] [ Web Browser ]
|
||||
| |
|
||||
+-------(WebSocket)------+
|
||||
|
|
||||
[ GATEWAY ] ←──── Redis Pub/Sub (client push delivery)
|
||||
|
|
||||
gRPC (sync) + NATS (async fan-out)
|
||||
| | | | | | | |
|
||||
[AUTH] [GAME] [CHAT] [COLL] [BAZ] [ADMIN] [WEB] [LDRBD]
|
||||
| | | | | | | |
|
||||
+-------+-------+-------+-------+-------+-------+-------+
|
||||
[ PostgreSQL ] [ Redis ] [ NATS ] [ Ceph/CDN ]
|
||||
[ MySQL archive (chat cold) ]
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Shared Infrastructure
|
||||
|
||||
### Redis
|
||||
Scoped to: session management, client push delivery, live game state, and runtime config. Not used for inter-service event routing (that is NATS).
|
||||
|
||||
- **Session store** — Gateway resolves session tokens on WS connect; cached in-process for the life of that connection after first lookup
|
||||
- **Client push (Pub/Sub)** — The final hop from services to connected clients. Services publish to Redis channels; each Gateway instance subscribes to channels for its connected clients and delivers over WebSocket. This is the only pub/sub use of Redis.
|
||||
- **Active game state** — Hot game data for sub-millisecond read/write; flushed to PostgreSQL on game completion
|
||||
- **Live leaderboard rankings** — Redis Sorted Sets for O(log N) rank reads and writes
|
||||
- **Runtime config / feature flags** — Admin writes; all services read on startup and poll periodically
|
||||
|
||||
### NATS
|
||||
Async event bus for all inter-service fan-out. Chosen over RabbitMQ for its lower latency, simpler operations, and native support for both pub/sub and request/reply patterns in one system. Apache 2.0.
|
||||
|
||||
- **Async fan-out** — One service publishes an event (e.g., game ended, purchase completed); multiple services subscribe independently without the publisher needing to know its consumers
|
||||
- **Request/reply** — Used where synchronous responses are needed but gRPC is too heavy (e.g., lightweight internal queries)
|
||||
- **JetStream** — NATS persistence layer; used for events that must survive a service restart (e.g., currency grants, match result recording)
|
||||
|
||||
Separation of concerns:
|
||||
- **NATS** — service-to-service async events
|
||||
- **Redis Pub/Sub** — final delivery from services to connected WebSocket clients (via Gateway)
|
||||
- **gRPC** — direct synchronous service-to-service RPC
|
||||
|
||||
### PostgreSQL
|
||||
Chosen over MySQL for this project. Key reasons: superior JSONB support (card/ability definitions map naturally to structured JSON), better concurrency under write-heavy load (MVCC), cleaner window functions for leaderboard and analytics queries, and stronger standards compliance as schema complexity grows.
|
||||
|
||||
Each service owns a dedicated schema. No cross-service DB queries — services talk to each other via TCP only.
|
||||
|
||||
| Service | Schema | Contents |
|
||||
|-------------|---------------|----------|
|
||||
| Auth | `auth` | Users, credentials, OAuth tokens |
|
||||
| Collection | `collection` | Card inventory, decks |
|
||||
| Bazaar | `bazaar` | Shop listings, marketplace, transactions, currency ledger |
|
||||
| Game | `game` | Match history, ratings, replays |
|
||||
| Chat | `chat` | Active messages (30-day hot window; archived to MySQL after) |
|
||||
| Admin | `admin` | Audit logs, admin accounts, config history |
|
||||
| Content | `content` | Card definitions, asset metadata, CDN asset references |
|
||||
| Leaderboard | `leaderboard` | Historical ranking snapshots, season records |
|
||||
|
||||
---
|
||||
|
||||
## Services
|
||||
|
||||
---
|
||||
|
||||
### Gateway
|
||||
|
||||
**Role**: Single point of entry for all client connections (thick client and web browser).
|
||||
|
||||
**Transport**: WebSocket inbound from clients; TCP outbound to internal services.
|
||||
|
||||
**Stateful/Stateless**: Hybrid — *stateful per connection, stateless per session*.
|
||||
|
||||
WebSocket connections are bound to a specific TCP socket on a specific machine — you cannot move an open connection. The Gateway is therefore inherently stateful in that it holds open sockets. However, all session state lives in Redis, not in the Gateway process.
|
||||
|
||||
**How it works**:
|
||||
- Each instance maintains an in-process map: `connectionId → { userId, sessionToken, subscriptions }`
|
||||
- On WS handshake: resolves session token against Redis → caches result in-process for the life of that connection. No Redis round-trip on subsequent messages.
|
||||
- On client disconnect + reconnect: any Gateway instance can pick them up by re-resolving their session token from Redis.
|
||||
- For server push: services publish to Redis pub/sub channels; each Gateway instance subscribes to channels for its currently connected clients and delivers events over WebSocket.
|
||||
|
||||
**Responsibilities**:
|
||||
- Authenticate and authorize incoming connections via session token
|
||||
- Route client messages to the correct downstream service
|
||||
- Subscribe to Redis pub/sub; deliver pushed events to connected clients
|
||||
- Heartbeat / connection keepalive
|
||||
- Rate limiting at the connection level
|
||||
- Relay admin commands from privileged clients to the Admin service
|
||||
|
||||
**Scaling**:
|
||||
Horizontal. Load balancer uses session-affinity (sticky sessions) for the WebSocket upgrade — once a connection is established it stays on that instance for its lifetime. New connections are distributed across instances freely. Gateway instances carry no durable business state; scaling in/out only affects which instance holds active sockets. Clients reconnect transparently via Redis session resolution.
|
||||
|
||||
**Database**: Redis only (no direct PostgreSQL access).
|
||||
|
||||
---
|
||||
|
||||
### Auth
|
||||
|
||||
**Role**: Login, registration, account management, OAuth (social login providers).
|
||||
|
||||
**Stateless**: Pure request/response. No persistent in-process state.
|
||||
|
||||
**Responsibilities**:
|
||||
- Register new accounts (email + password)
|
||||
- Login: validate credentials → issue session token → write to Redis with TTL
|
||||
- OAuth: redirect to provider → callback → create or link account → issue session token
|
||||
- Account management: email change, password reset, display name, profile
|
||||
- Token refresh and revocation
|
||||
- Internal endpoint: validate session token (called by Gateway on WS handshake)
|
||||
|
||||
**Token format**: Opaque session tokens. Full session state lives in Redis (userId, permissions, TTL). Tokens are immediately revocable by deleting the Redis key. No JWT — avoids revocation complexity for a server-authoritative game where sessions must be killable instantly (ban, forced logout, admin action).
|
||||
|
||||
**Scaling**: Fully stateless. Horizontal with no affinity requirement.
|
||||
|
||||
**Database**: PostgreSQL (`auth`), Redis (session tokens with TTL).
|
||||
|
||||
---
|
||||
|
||||
### Game
|
||||
|
||||
**Role**: All game sessions — matchmaking, game state, turn processing, win conditions, ratings.
|
||||
|
||||
**Note**: The Game service is the most complex and robust service in the system. A full design draft will be done separately once all other services are spec'd.
|
||||
|
||||
**Stateful**: Active sessions carry state. Hot state lives in Redis; completed game data flushed to PostgreSQL.
|
||||
|
||||
**Responsibilities** (high-level):
|
||||
- Matchmaking queue and pairing
|
||||
- Initialize game sessions; deal opening hands; set up board state
|
||||
- Validate and process player actions (move, attack, channel, use ability, end turn)
|
||||
- Apply game rules and resolve effects (driven by the ability/effect engine defined in context-files)
|
||||
- Publish state delta events to Redis pub/sub → Gateway delivers to players
|
||||
- Detect end-of-game; compute ratings; flush to PostgreSQL
|
||||
- Reconnect handling: send current state snapshot to reconnecting player
|
||||
|
||||
**Scaling**: TBD in the Game service design draft.
|
||||
|
||||
**Database**: Redis (active game state, matchmaking queue), PostgreSQL (`game` — match history, ratings, replays).
|
||||
|
||||
---
|
||||
|
||||
### Chat
|
||||
|
||||
**Role**: Real-time messaging — lobby, in-game chat, direct messages, and future guild/party channels.
|
||||
|
||||
**Stateless processing**: Chat service receives messages, validates, persists, publishes to Redis pub/sub. Delivery is handled by Gateway.
|
||||
|
||||
**Responsibilities**:
|
||||
- Channel management (create, join, leave, list)
|
||||
- Message routing via Redis pub/sub
|
||||
- Message persistence: all messages written to PostgreSQL for the duration of the session; retained for admin review and moderation purposes
|
||||
- Moderation: profanity filter hooks, mute, ban (enforced at write time)
|
||||
|
||||
**Persistence policy**:
|
||||
- Messages written to PostgreSQL (`chat`) on send
|
||||
- **30-day hot window**: messages older than 30 days are archived out of PostgreSQL
|
||||
- **Cold archive**: archived messages moved to the remote third-party MySQL instance (unlimited storage); kept indefinitely for moderation and legal review
|
||||
- Primary use: if a player is reported, staff pulls the session log from hot or cold storage as needed
|
||||
- Retention and GDPR/privacy policy to be defined before public launch
|
||||
|
||||
**Scaling**: Fully stateless. Horizontal. Pub/sub fanout is handled by Redis; Chat service only processes and routes.
|
||||
|
||||
**Database**: Redis (pub/sub), PostgreSQL (`chat` — messages, channels).
|
||||
|
||||
---
|
||||
|
||||
### Collection
|
||||
|
||||
**Role**: Player card collection and deck management.
|
||||
|
||||
**Stateless**: Pure request/response.
|
||||
|
||||
**Responsibilities**:
|
||||
- Read player card inventory
|
||||
- Create, update, delete decks
|
||||
- Validate deck legality (card count limits, banned list, format restrictions)
|
||||
- Grant or revoke cards (called by Bazaar on purchase; by Admin for manual grants)
|
||||
|
||||
**Scaling**: Fully stateless. Horizontal.
|
||||
|
||||
**Database**: PostgreSQL (`collection` — card_inventory, decks, deck_cards).
|
||||
|
||||
---
|
||||
|
||||
### Bazaar
|
||||
|
||||
**Role**: In-game shop and player-to-player marketplace.
|
||||
|
||||
**Stateless**: Request/response with transactional DB operations for consistency.
|
||||
|
||||
**Currency model**:
|
||||
Two currency types:
|
||||
- **Earned currency (soft)** — gained through gameplay (wins, quests, events). Spent in shop and marketplace.
|
||||
- **Real-money currency (hard)** — purchased with real money via Stripe. Spent directly in shop, or converted to earned currency at a defined rate.
|
||||
|
||||
Players can: spend earned currency, spend hard currency, or purchase earned currency with hard currency (real money → earned conversion). All currency flows are atomic DB transactions with a full ledger for audit.
|
||||
|
||||
**Responsibilities**:
|
||||
- Shop: fixed-price card and item purchases in both currency types
|
||||
- Marketplace: player-to-player listings, bids, buyouts (earned currency only)
|
||||
- Real-money purchase flow: initiate Stripe payment → webhook confirms → credit hard currency to player wallet
|
||||
- Earned currency purchase: deduct hard currency → credit earned currency (conversion rate configurable by Admin)
|
||||
- Transaction history and receipt generation
|
||||
- Currency management: all debit/credit operations are atomic PostgreSQL transactions to prevent double-spend
|
||||
|
||||
**Scaling**: Stateless compute. Database is the coordination point. Read replicas for browsing/search; primary for all transaction writes.
|
||||
|
||||
**Database**: PostgreSQL (`bazaar` — listings, transactions, currency_ledger, wallets).
|
||||
|
||||
---
|
||||
|
||||
### Admin
|
||||
|
||||
**Role**: Dual-purpose — hosts the admin web dashboard and processes incoming admin commands. Also serves as the card content authoring tool and asset pipeline entry point.
|
||||
|
||||
**Responsibilities**:
|
||||
- **Admin web UI**: internal web application; player management, session visibility, economy metrics, config management
|
||||
- **Card builder**: admin UI tool for creating and editing card definitions (stats, abilities, genus, affinity, costs); card data written to the `content` schema via the Content service
|
||||
- **Asset management**: upload card art, UI assets, 3D models, and animations directly from the admin UI; assets are pushed to Ceph (CDN origin) and their metadata (filename, CDN URL, card association) recorded in `content`; clients download assets from the CDN
|
||||
- **Admin command processing**: privileged client commands relayed by Gateway; validated, executed, and logged
|
||||
- **Player actions**: ban, mute, grant/revoke cards, force-end game, system announcements
|
||||
- **Config management**: write feature flags and runtime config to Redis
|
||||
- **Audit logging**: all admin actions logged with actor, timestamp, and full payload
|
||||
|
||||
**Access**: NOT publicly routable. Internal network or VPN only. Admin auth is a separate credential layer on top of normal Auth.
|
||||
|
||||
**Scaling**: Low-traffic. Single instance sufficient initially; stateless and horizontally scalable.
|
||||
|
||||
**Database**: PostgreSQL (`admin` — audit_logs, admin_users, config_history), Redis (runtime config / feature flags — write side).
|
||||
|
||||
---
|
||||
|
||||
### Leaderboard
|
||||
|
||||
**Role**: Real-time and historical player rankings.
|
||||
|
||||
**Stateless processing**: Ranking logic is stateless; all ranking state lives in Redis Sorted Sets for live data and PostgreSQL for historical snapshots.
|
||||
|
||||
**Responsibilities**:
|
||||
- Maintain live rankings by multiple dimensions (overall rating, wins, win streak, season rank, etc.)
|
||||
- Receive match result events via NATS → update Redis Sorted Sets atomically
|
||||
- Serve rank reads: O(log N) lookups from Redis for live rankings
|
||||
- Periodic snapshots: flush current standings to PostgreSQL at end of season or on a schedule
|
||||
- Expose ranked queries to Web and client (top N, player rank and percentile, nearby players in ranking)
|
||||
|
||||
**Scaling**: Stateless compute. Redis Sorted Sets handle concurrent ranking updates efficiently. Horizontal scaling of the compute layer behind a load balancer.
|
||||
|
||||
**Database**: Redis (live Sorted Sets per ranking dimension), PostgreSQL (`leaderboard` — historical snapshots, season records).
|
||||
|
||||
---
|
||||
|
||||
### Content
|
||||
|
||||
**Role**: Canonical store for card definitions and game asset metadata. Serves the card library to clients and the admin card builder.
|
||||
|
||||
**Stateless**: Pure request/response.
|
||||
|
||||
**Responsibilities**:
|
||||
- Store and serve card definitions (all fields from card-design.md: stats, abilities, genus, affinity, costs, etc.) as structured data
|
||||
- Store asset metadata: for each card, the CDN URLs for card art, 3D model, animations, UI elements
|
||||
- Serve card library to clients (full card catalog, filterable)
|
||||
- Serve individual card definitions to Game service during game session initialization
|
||||
- Receive card creation/update calls from Admin card builder; write to `content` schema
|
||||
|
||||
**Scaling**: Stateless. Horizontal. Card definitions are read-heavy — Redis caching layer in front of PostgreSQL for frequently accessed card data.
|
||||
|
||||
**Database**: PostgreSQL (`content` — card_definitions, card_assets, asset_metadata). Redis (card definition cache).
|
||||
|
||||
---
|
||||
|
||||
### CDN / Asset Pipeline
|
||||
|
||||
**Role**: Infrastructure layer for storing and delivering all game assets (card art, UI assets, 3D models, animations).
|
||||
|
||||
This is not a service but an infrastructure component managed through the Admin UI.
|
||||
|
||||
**How it works**:
|
||||
1. Admin uploads asset (art, model, animation) via Admin web UI
|
||||
2. Admin service pushes the file to **Ceph** via the RADOSGW S3-compatible API
|
||||
3. Admin service writes asset metadata (filename, type, CDN URL, associated card ID) to `content` schema via Content service
|
||||
4. CDN layer sits in front of Ceph RADOSGW as the public edge — clients always pull from CDN, never directly from Ceph origin (see Open Questions for CDN edge decision)
|
||||
5. Client downloads assets from CDN URLs stored in card definitions; initial sync on game launch, incremental updates on patch
|
||||
|
||||
**Components**:
|
||||
- **Ceph** — Distributed object storage origin. Self-hosted. LGPL v2.1. Object storage exposed via Ceph Object Gateway (RADOSGW) which provides an S3-compatible API — no vendor lock-in. Ceph also supports block and file storage, giving room to expand storage needs without adding new systems.
|
||||
- **CDN edge** — Caches and delivers assets globally. Sits in front of Ceph RADOSGW. Options TBD (see Open Questions).
|
||||
|
||||
**Asset types**:
|
||||
- Card art (2D, per card)
|
||||
- 3D models and animations (per unit/spirit)
|
||||
- UI assets (icons, backgrounds, effects)
|
||||
- Audio (TBD)
|
||||
|
||||
---
|
||||
|
||||
### Web
|
||||
|
||||
**Role**: Public-facing game website.
|
||||
|
||||
**Responsibilities**:
|
||||
- Landing page, news, patch notes, update announcements
|
||||
- Account creation and management in-browser (calls Auth service)
|
||||
- Thick client download links
|
||||
- Web client entry point
|
||||
- Leaderboard display (calls Leaderboard service)
|
||||
- Card library browser (calls Content service — read-only)
|
||||
- Lore, media, community links
|
||||
|
||||
**Stateless**: Static and server-rendered pages. All dynamic data is fetched from internal services — Web holds no data directly.
|
||||
|
||||
**Deployment**: Built and deployed entirely separately from the server stack. Hosted in its own Kubernetes namespace with no shared deployments. Communicates with backend services through the same Gateway as any other client.
|
||||
|
||||
**Scaling**: Fully stateless. CDN for static assets. Horizontal for server-rendered pages.
|
||||
|
||||
**Database**: None. All data via internal service calls.
|
||||
|
||||
---
|
||||
|
||||
## Transport Layer
|
||||
|
||||
| Connection | Protocol | Notes |
|
||||
|---|---|---|
|
||||
| Client → Gateway | WebSocket | Persistent, full-duplex |
|
||||
| Gateway → Services (sync) | gRPC over TCP | Request routing, auth validation |
|
||||
| Service → Service (sync) | gRPC over TCP | Direct RPC; schema-defined via Protobuf |
|
||||
| Service → Service (async) | NATS | Event fan-out; multiple services can subscribe to one event |
|
||||
| Services → Gateway (push) | Redis Pub/Sub | Final delivery hop to connected clients via Gateway subscriptions |
|
||||
| Admin → Ceph | HTTP (RADOSGW S3 API) | Asset upload |
|
||||
| Client → CDN | HTTPS | Asset download (card art, models, animations) |
|
||||
|
||||
**Framing**:
|
||||
- gRPC uses Protobuf — strongly typed, code-generated, binary. All service contracts defined as `.proto` files and versioned.
|
||||
- NATS messages use Protobuf or MessagePack — TBD when service contracts are defined.
|
||||
- Game state deltas (high-frequency) may use a compact binary format over NATS if gRPC overhead is measurable at scale.
|
||||
|
||||
---
|
||||
|
||||
## Decided
|
||||
|
||||
| Decision | Choice | Notes |
|
||||
|---|---|---|
|
||||
| Primary database | PostgreSQL | JSONB, concurrency, analytics; over MySQL |
|
||||
| Async event bus | NATS | Lightweight, low-latency, pub/sub + request/reply; Apache 2.0 |
|
||||
| Sync inter-service RPC | gRPC + Protobuf | Schema-first, code-generated, binary |
|
||||
| Object storage (CDN origin) | Ceph (RADOSGW) | Self-hosted, S3-compatible, LGPL v2.1 |
|
||||
| Auth token format | Opaque session tokens in Redis | Instantly revocable; avoids JWT revocation complexity |
|
||||
| Currency model | Soft (earned) + Hard (real money) | Real money → earned conversion supported |
|
||||
| Payment processing | Stripe (third-party, implemented but disabled) | PCI compliance not DIY-able; enabled when real-money launch is ready |
|
||||
| Web client | Full game client via WebSocket | Built separately; own Kubernetes namespace |
|
||||
| Chat hot storage | PostgreSQL, 30-day window | Active messages; archived after 30 days |
|
||||
| Chat cold archive | Remote MySQL (third-party, unlimited storage) | Long-term audit/moderation storage |
|
||||
|
||||
---
|
||||
|
||||
## Open Questions
|
||||
|
||||
1. **Game service design**: Deferred — will be drafted separately as the most complex service. Sharding strategy, session coordinator, matchmaking design, and reconnect flow all TBD.
|
||||
|
||||
2. **CDN edge layer**: What sits in front of Ceph RADOSGW for client-facing delivery? Options: self-hosted Nginx with caching, Cloudflare (free tier covers most cases), or BunnyCDN (low cost, high performance). Decision needed before asset pipeline is built.
|
||||
|
||||
3. **Legal / GDPR / compliance**: See `Shared/legal.md` for all outstanding legal TODOs including GDPR, privacy policy, EULA, TOS, and Stripe compliance requirements.
|
||||
|
||||
+104
@@ -0,0 +1,104 @@
|
||||
# Legal TODO
|
||||
|
||||
This file tracks all outstanding legal, compliance, and policy requirements. None of these need to be resolved before internal development, but all must be addressed before any public launch or real-money feature enablement.
|
||||
|
||||
---
|
||||
|
||||
## Priority Order
|
||||
|
||||
| Priority | Item | Required Before |
|
||||
|---|---|---|
|
||||
| P0 | Privacy Policy | Any user data collection (even closed beta) |
|
||||
| P0 | Terms of Service | Any public access |
|
||||
| P0 | EULA | Thick client distribution |
|
||||
| P1 | GDPR compliance | Any users in the EU/EEA |
|
||||
| P1 | Stripe / payment compliance | Real-money feature enablement |
|
||||
| P2 | CCPA compliance | Any users in California |
|
||||
| P2 | Cookie Policy | Web client / website |
|
||||
| P3 | COPPA | If under-13 users are permitted |
|
||||
|
||||
---
|
||||
|
||||
## Terms of Service (TOS)
|
||||
|
||||
- [ ] Draft TOS covering: account rules, prohibited conduct, content ownership, service availability, suspension/termination rights
|
||||
- [ ] Define what constitutes a bannable offense (feeds into Admin tooling)
|
||||
- [ ] Address virtual currency: no real-world cash value, no refunds on earned currency, Stripe purchase refund policy
|
||||
- [ ] Jurisdiction and governing law (choose state/country for dispute resolution)
|
||||
- [ ] Age requirement (minimum age — likely 13, or 18 for real-money purchases)
|
||||
|
||||
---
|
||||
|
||||
## End User License Agreement (EULA)
|
||||
|
||||
- [ ] Required before thick client is distributed publicly
|
||||
- [ ] Cover: license grant (limited, non-transferable), restrictions (no reverse engineering, no cheating tools, no redistribution), termination
|
||||
- [ ] Embedded in installer or presented on first launch with required acceptance
|
||||
- [ ] Separate from TOS or combined — TBD
|
||||
|
||||
---
|
||||
|
||||
## Privacy Policy
|
||||
|
||||
- [ ] Required before any user data is collected (name, email, IP, gameplay data)
|
||||
- [ ] Must cover: what data is collected, how it is used, how long it is retained, with whom it is shared (Stripe, any analytics), how users can request deletion
|
||||
- [ ] Chat log retention policy must be explicitly stated (30-day hot, long-term cold archive — reason and access policy must be disclosed)
|
||||
- [ ] Contact information for privacy requests
|
||||
|
||||
---
|
||||
|
||||
## GDPR (EU/EEA)
|
||||
|
||||
- [ ] **Right to erasure (Right to be forgotten)**: must be able to delete all user PII on request; define which data can be truly deleted vs. anonymized (e.g., transaction records may need to be kept for financial/legal reasons)
|
||||
- [ ] **Data portability**: must be able to export a user's data in machine-readable format on request
|
||||
- [ ] **Consent**: define consent flow for data collection; explicit opt-in for marketing
|
||||
- [ ] **Data retention limits**: document and enforce retention periods per data category (auth data, gameplay data, chat logs, transaction records)
|
||||
- [ ] **DPA (Data Processing Agreement)**: required if using any EU-based users with third-party processors (Stripe, any analytics)
|
||||
- [ ] **Chat archive**: cold archive in remote MySQL — GDPR deletion requests must propagate to cold storage; design the deletion pipeline before launch
|
||||
- [ ] Appoint a Data Protection contact point (can be internal)
|
||||
|
||||
---
|
||||
|
||||
## Stripe / Payment Compliance
|
||||
|
||||
- [ ] Stripe account setup and terms acceptance (Stripe Connected Accounts or standard Stripe account — TBD on business entity)
|
||||
- [ ] **PCI DSS**: Stripe handles card data; our scope is SAQ A (minimal) as long as we never touch raw card numbers. Confirm no card data touches our servers.
|
||||
- [ ] **Refund policy**: define refund rules for hard currency purchases (Stripe chargebacks, voluntary refunds)
|
||||
- [ ] **Subscription vs. one-time**: confirm no subscription billing at launch (simplifies compliance)
|
||||
- [ ] **Age gate**: real-money purchases must be restricted to users meeting minimum age requirement
|
||||
- [ ] **Regional restrictions**: some jurisdictions restrict virtual currency purchases or loot boxes (Belgium, Netherlands, etc.) — review before enabling real-money features globally
|
||||
- [ ] Stripe integration is **implemented but disabled** in Bazaar service; enable only after all payment compliance items are checked off
|
||||
|
||||
---
|
||||
|
||||
## CCPA (California)
|
||||
|
||||
- [ ] Privacy Policy must include CCPA-specific disclosures (right to know, right to delete, right to opt-out of sale of personal information)
|
||||
- [ ] "Do Not Sell My Personal Information" link/flow on website if applicable
|
||||
- [ ] Verify whether data sharing with Stripe constitutes a "sale" under CCPA (generally no, if it's a service provider relationship)
|
||||
|
||||
---
|
||||
|
||||
## Cookie Policy
|
||||
|
||||
- [ ] Required for the website (Web service)
|
||||
- [ ] Identify all cookies: session cookies, analytics cookies, any third-party embeds
|
||||
- [ ] Consent banner for EU visitors (GDPR cookie consent)
|
||||
- [ ] Keep minimal — avoid third-party tracking cookies if possible
|
||||
|
||||
---
|
||||
|
||||
## COPPA (Under-13 Users)
|
||||
|
||||
- [ ] Decision needed: do we allow users under 13?
|
||||
- **Option A**: Minimum age 13, enforce at registration with DOB or age gate. Simplest compliance path.
|
||||
- **Option B**: Allow under-13 with verifiable parental consent. Significant compliance overhead.
|
||||
- [ ] Recommendation: minimum age 13 (standard for online gaming). Real-money features age-gated to 18.
|
||||
|
||||
---
|
||||
|
||||
## Notes
|
||||
|
||||
- All legal documents should be reviewed by a qualified attorney before public release.
|
||||
- Internal development and closed testing do not require finalized legal docs, but privacy policy and TOS should be in place before any external users access the system.
|
||||
- The Admin service audit log design should account for GDPR deletion requirements — logged actions referencing a deleted user should anonymize the user reference, not block deletion.
|
||||
Reference in New Issue
Block a user