AI-assisted planning for video content — generating prompts for the main scenario, characters, and scenes.
Video Planner is a single-section web application that helps a user plan video content with AI assistance. For now it contains one section — Video Planner — where the user can generate structured prompts for three artifacts of a video project:
Access is restricted to a single Google account ([email protected]) during this phase.
AI generation is powered by DeepSeek Flash using a user-supplied API key.
planner.hlmn.app/docs.Three primary components behind an Nginx reverse proxy, all on the same server:
Browser
│
├── https://planner.hlmn.app ──► Nginx ──► Frontend (static SPA)
│ │
│ └──► /docs ──► static HTML (this plan)
│
└── https://api.planner.hlmn.app ─► Nginx ──► Backend API (Node.js)
│
├──► PostgreSQL (localhost)
└──► DeepSeek API (outbound HTTPS)
api.planner.hlmn.app (CORS allowlisted to planner.hlmn.app).| Layer | Choice (proposed) | Notes |
|---|---|---|
| Frontend | React + Vite (TypeScript) | SPA; static build served by Nginx. Routing with React Router. |
| Backend | Node.js + Fastify (TypeScript) | Lightweight, typed. Alternative: Express. |
| Database | PostgreSQL 16 | Hosted on this server; accessed over localhost. |
| ORM | Prisma (or Drizzle) | Schema-first migrations. |
| Auth | Google OAuth 2.0 (Authorization Code flow) | Session via signed httpOnly cookie. |
| AI | DeepSeek API (Flash) | Key from environment; model id configurable. |
| Reverse proxy | Nginx + Let's Encrypt (TLS) | Terminates TLS for both domains. |
| Process manager | PM2 or systemd | Keeps backend running; restart on crash. |
| Item | Value | Purpose |
|---|---|---|
| Frontend domain | planner.hlmn.app | SPA + /docs static page. |
| Backend domain | api.planner.hlmn.app | REST API. |
| PostgreSQL | localhost:5432 | Not publicly exposed. |
| TLS | Let's Encrypt | HTTPS on both domains. |
planner.hlmn.app → not authenticated → redirected to api.planner.hlmn.app/auth/google.api.planner.hlmn.app/auth/google/callback?code=....email against the allowlist.ALLOWED_EMAILS="[email protected]"
Comparison is case-insensitive and trimmed. The allowlist is a comma-separated environment variable so future accounts can be added without code changes.
httpOnly, SameSite=Lax, Secure in production).GET /auth/me returns the current user; the frontend calls it on load.users
id uuid PK
email text UNIQUE NOT NULL
name text
google_sub text UNIQUE -- Google account subject id
avatar_url text
created_at timestamptz NOT NULL DEFAULT now()
updated_at timestamptz NOT NULL DEFAULT now()
projects
id uuid PK
user_id uuid FK → users.id
title text NOT NULL
overview text -- high-level description / input context
status text DEFAULT 'draft'
created_at timestamptz NOT NULL DEFAULT now()
updated_at timestamptz NOT NULL DEFAULT now()
scenarios -- main scenario (one per project)
id uuid PK
project_id uuid FK → projects.id UNIQUE
input jsonb -- user inputs used for generation
prompt text -- generated main-scenario prompt
model text -- model id used
created_at timestamptz NOT NULL DEFAULT now()
updated_at timestamptz NOT NULL DEFAULT now()
characters
id uuid PK
project_id uuid FK → projects.id
name text
input jsonb -- user inputs (role, traits, etc.)
prompt text -- generated character prompt
model text
created_at timestamptz NOT NULL DEFAULT now()
updated_at timestamptz NOT NULL DEFAULT now()
scenes
id uuid PK
project_id uuid FK → projects.id
scenario_id uuid FK → scenarios.id -- optional link
title text
order_index integer NOT NULL DEFAULT 0
input jsonb
prompt text -- generated scene prompt
model text
created_at timestamptz NOT NULL DEFAULT now()
updated_at timestamptz NOT NULL DEFAULT now()
generation_logs -- optional audit/history of AI calls
id uuid PK
project_id uuid FK → projects.id
user_id uuid FK → users.id
type text -- 'scenario' | 'character' | 'scene'
model text
prompt_tokens integer
completion_tokens integer
created_at timestamptz NOT NULL DEFAULT now()
User
└── Project (video project)
├── Scenario (main scenario, 1 per project)
├── Character (0..N)
└── Scene (0..N, ordered, optionally linked to the scenario)
A Project is the top-level container. Generating a scene can reference the project's scenario and selected characters as context, so scene prompts stay consistent with the story.
DEEPSEEK_API_KEY.DEEPSEEK_API_KEY="sk-..."
DEEPSEEK_BASE_URL="https://api.deepseek.com" # default
DEEPSEEK_MODEL="deepseek-flash" # confirm exact id
Each artifact type uses a dedicated system prompt (template) plus the user's inputs. The templates live server-side so they can be tuned without a frontend deploy.
Inputs: topic/theme, genre, audience, tone, duration, any reference notes.
Output: a structured scenario prompt (logline, setting, conflict, acts/beats).
Inputs: name, role, appearance, personality, motivation, relation to story.
Output: a character prompt (identity, visual description, personality, arc).
Inputs: title, location, action summary, characters involved, mood; plus optional scenario context.
Output: a scene prompt (setting, action, dialogue direction, camera/visual style).
Base URL: https://api.planner.hlmn.app. All routes except auth require a valid session.
| Method | Path | Description |
|---|---|---|
| GET | /auth/google | Start Google OAuth. |
| GET | /auth/google/callback | OAuth callback + allowlist check. |
| GET | /auth/me | Current user. |
| POST | /auth/logout | Destroy session. |
| GET | /api/projects | List user's projects. |
| POST | /api/projects | Create project. |
| GET | /api/projects/:id | Get project + artifacts. |
| PATCH | /api/projects/:id | Update project. |
| DELETE | /api/projects/:id | Delete project (cascades). |
| GET | /api/projects/:id/scenario | Get main scenario. |
| POST | /api/projects/:id/scenario/generate | Generate/regenerate scenario. |
| GET | /api/projects/:id/characters | List characters. |
| POST | /api/projects/:id/characters | Create character. |
| POST | /api/projects/:id/characters/:cid/generate | Generate character prompt. |
| GET | /api/projects/:id/scenes | List scenes (ordered). |
| POST | /api/projects/:id/scenes | Create scene. |
| POST | /api/projects/:id/scenes/:sid/generate | Generate scene prompt. |
| Route | Content |
|---|---|
/login | Sign in with Google button (or auto-redirect). |
/ | Dashboard: list of projects, "New project" action. |
/projects/:id | Editor with tabs: Scenario, Characters, Scenes. |
/docs | This plan document (static HTML). |
/unauthorized | Shown when login email is not allowlisted. |
This plan document is a static HTML file. Nginx serves it at planner.hlmn.app/docs
(directory index or a dedicated location /docs block), independent of the SPA so it
loads even when the app is not authenticated.
location /docs {
alias /var/www/video-planner/docs;
index index.html;
}
https://api.planner.hlmn.app/auth/google/callback.# Backend environment
DATABASE_URL="postgresql://app:...@localhost:5432/video_planner"
GOOGLE_CLIENT_ID="..."
GOOGLE_CLIENT_SECRET="..."
GOOGLE_REDIRECT_URI="https://api.planner.hlmn.app/auth/google/callback"
ALLOWED_EMAILS="[email protected]"
DEEPSEEK_API_KEY="sk-..."
DEEPSEEK_MODEL="deepseek-flash"
SESSION_SECRET="..."
FRONTEND_URL="https://planner.hlmn.app"
httpOnly, Secure, SameSite=Lax.https://planner.hlmn.app.| # | Milestone | Deliverable |
|---|---|---|
| 1 | Infrastructure | Domains, Nginx, TLS, PostgreSQL running. |
| 2 | Authentication | Google OAuth + allowlist working. |
| 3 | Data layer | Schema migrated; CRUD for projects/artifacts. |
| 4 | AI integration | DeepSeek generation for scenario/character/scene. |
| 5 | Frontend | Video Planner UI (dashboard + editor). |
| 6 | Docs | This page live at planner.hlmn.app/docs. |
| 7 | Hardening | Error handling, logging, basic tests. |