mirror_match/docs/ARCHITECTURE.md

38 lines
1.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# MirrorMatch Architecture (MVP)
## Goals
- **Invite-only** groups.
- Create a **Set** with **210 photos** and **24 names (Options)**.
- Users can upload photos and set:
- the **correct Option** (secret until reveal)
- **points** (110)
- Only **other users** (not the uploader of that photo) can guess for points.
- **No reveal** until:
- an admin/uploader triggers reveal, and/or
- auto-reveal when everyone in the Group has finished guessing (configurable).
## Components
- **Next.js app**: renders UI + server actions for all privileged operations.
- **Postgres**: source of truth (users/groups/sets/guesses).
- **MinIO (S3)**: stores image objects; app stores only `storageKey`.
- **Auth.js (NextAuth)**: email magic links + optional OAuth.
## Security / privacy model
- All pages require login.
- A user can only read/write data for Groups they belong to.
- Image access is via **short-lived presigned URLs** generated server-side for authorized users.
- Invite tokens are **hashed** in the database.
## Deployment shape (Proxmox)
- Run the app as a Docker container behind your reverse proxy.
- Run Postgres + MinIO as Docker containers (or managed separately if you already have them).
- Configure SMTP env vars to your email server for:
- magic link auth
- invite emails