A ticket-gated HTML5 video streaming platform with two independently deployable services sharing JWT-based playback authentication.
- GETTING_STARTED.md β Start here! Complete step-by-step guide to set up and run the system locally
- PDR.md β Full product specification, data model, API contracts, and deployment topologies
- IMPLEMENTATION_PLAN.md β Development task breakdown and work streams
- DEPLOYMENT.md β Production deployment guide (Docker, cloud platforms)
| Service | Framework | Directory | Port |
|---|---|---|---|
| Platform App | Next.js 14+ (TypeScript) | platform/ |
3000 |
| HLS Media Server | Express.js (TypeScript) | hls-server/ |
4000 |
| Shared | TypeScript types/constants | shared/ |
β |
- Node.js 20+ (see
.nvmrc) - npm 10+
π For detailed setup instructions, see GETTING_STARTED.md
# 1. Install dependencies
npm install
# 2. Generate secrets and admin password
npm run hash-password
node -e "console.log(require('crypto').randomBytes(32).toString('base64'))"
# 3. Configure environment
cp .env.example .env
# Edit .env with generated secrets
# 4. Initialize database
cd platform
set -a
source ../.env
set +a
npx prisma migrate dev --name init
npx prisma generate
npx prisma db seed # Optional: sample data
# 5. Start services (in separate terminals)
cd platform && set -a && source ../.env && set +a && PORT=3000 npm run dev # Terminal 1: Port 3000
cd hls-server && set -a && source ../.env && set +a && npm run dev # Terminal 2: Port 4000Access the application:
- Viewer Portal: http://localhost:3000
- Admin Console: http://localhost:3000/admin
- HLS Server Health: http://localhost:4000/health
βββ shared/ # Shared types, constants, and utilities
β βββ src/
β βββ types.ts # Domain types (JWT claims, API responses)
β βββ constants.ts # Shared constants (rate limits, timeouts)
β βββ jwt.ts # JWT utility functions
β βββ validation.ts # Input validation helpers
βββ platform/ # Next.js Platform App
β βββ prisma/ # Database schema and migrations
β βββ src/
β βββ app/ # Next.js App Router (pages + API routes)
β βββ components/ # React components (UI, player, admin, viewer)
β βββ hooks/ # Custom React hooks
β βββ lib/ # Server-side utilities (JWT, auth, DB)
βββ hls-server/ # Express.js HLS Media Server
β βββ src/
β βββ middleware/ # JWT auth, CORS, logging
β βββ routes/ # Stream serving, health, admin cache
β βββ services/ # Revocation cache, upstream proxy, cache mgmt
β βββ utils/ # Path safety, hashing
See .env.example for a complete reference with documentation.
- Both services share the
@streaming/sharedworkspace package - Changes to
shared/are immediately available in both services (no build step) - Use
npx prisma studioto inspect the database visually - HLS test streams should be placed in
./streams/<eventId>/hls-server/streams//`
- Setup issues? See GETTING_STARTED.md β Comprehensive troubleshooting section
- API questions? See GETTING_STARTED.md#api-reference β Complete API documentation
- Deployment? See DEPLOYMENT.md β Docker & cloud deployment guides
- Architecture details? See PDR.md β Full product specification