53 lines
1.5 KiB
Markdown
53 lines
1.5 KiB
Markdown
# DnD Campaign Hub
|
|
|
|
Self-hosted web application and Discord bot for managing rotating DnD campaigns.
|
|
|
|
## Stack
|
|
- Node.js + TypeScript (Express API + Discord bot + scheduler)
|
|
- React + Vite + TypeScript
|
|
- SQLite
|
|
- Docker Compose
|
|
|
|
## Quick Start
|
|
1. Copy `.env.example` to `.env` and fill values.
|
|
2. Install dependencies:
|
|
- `npm install`
|
|
3. Run DB migrations:
|
|
- `npm run migrate -w @dnd-hub/server`
|
|
4. Run in dev mode:
|
|
- `npm run dev`
|
|
|
|
## Docker
|
|
1. Copy `.env.example` to `.env`.
|
|
2. Start:
|
|
- `docker compose up --build`
|
|
|
|
## Project Layout
|
|
- `apps/server`: API, SQLite access, scheduler, Discord bot and slash commands
|
|
- `apps/web`: React UI
|
|
- `infra`: Docker and nginx config
|
|
|
|
## Transcript Session Feature
|
|
Added structured transcript support with campaign + character context.
|
|
|
|
### Discord Commands
|
|
- `/session start`: starts a transcript session on the currently selected campaign
|
|
- `/session stop`: ends active transcript session
|
|
- `/session status`: shows active transcript session state
|
|
|
|
### API Endpoints
|
|
- `POST /sessions/start`
|
|
- `POST /sessions/:id/stop`
|
|
- `GET /sessions/active`
|
|
- `POST /sessions/:id/segments`
|
|
- `GET /sessions/:id/transcript`
|
|
- `POST /sessions/:id/push-to-cloud`
|
|
|
|
### Cloud Sync
|
|
If `CLOUD_API_BASE_URL` is configured, each transcript segment is queued and POSTed to:
|
|
- `POST {CLOUD_API_BASE_URL}/transcripts/segments`
|
|
|
|
Headers sent:
|
|
- `X-API-Key`: `CLOUD_API_KEY`
|
|
- `X-Idempotency-Key`: `${sessionId}:${sequence}`
|
|
- `X-Signature`: HMAC-SHA256 payload signature using `CLOUD_API_HMAC_SECRET`
|