Frameflow
Browser-based AI video editor
THE CHALLENGE
Professional editing tools are complex and start from a blank timeline. I wanted a browser editor where you describe the video first, get a scene plan, and edit from there.
TECH STACK
Engineering Approach
AI-First Generation Flow
Users describe a video in plain language, and an AI model returns a scene plan. Stock footage search (Pexels) and uploads fill each scene.
Schema-Driven Architecture
Designed the data model around projects, scenes, and audio layers. When music and voiceover needed multiple layers, I replaced flat fields with an audio-layer table and migrated existing projects into it. Prisma uses a pooled connection for the app and a direct one for migrations.
Multi-Track Timeline
Built a timeline with video, music, and voiceover tracks, a fixed time scale, and a draggable playhead that owns playback position across the preview, the timeline, and the page.
Security Hardening
Added Zod schemas for API input, atomic transactions for scene saves, timing-safe authentication, login rate limiting by email and IP, and project-ownership checks on uploads.
Key Technical Decisions
The choices that shaped the architecture and how easy it is to maintain.
One source of truth for playback
The playhead position drives the preview, the timeline, and play and pause. Seeking pauses and never auto-plays.
Several components each kept their own idea of the current time. One owner of that state removes the drift between them.
Stretching a clip changes its speed
Stretching sets playback speed between 0.25x and 2x. Trimming (choosing in and out points) is a separate feature.
These are two different operations. Keeping them apart lets each be built and tested on its own, and the source duration is stored so stretched clips play at the right speed.
A demo account with guards
A seeded demo account has guards on all write routes and resets every day.
Visitors can explore the product without being able to change data that other visitors see.
Honest pending states
Features that don't exist yet say so. The export button reports that export is not available, not a fake success.
A fake success message is a lie in a product. Honest states keep the interface trustworthy while features are built in order.
Challenges & Solutions
Any signed-in user could upload to any project, because the upload route did not check who owned the project.
Added an ownership check before every upload, and the same check on the audio upload routes.
Duplicating a project produced the right metadata but no clips.
The create route copied only 5 of the 7 scene fields, silently dropping the video URL and stock ID. I fixed the mapping and normalized null style and aspect-ratio values that failed validation.
The theme changed in one tab but came back stale in another.
The theme hook trusted the DOM class, which raced between tabs. I rewrote it with useSyncExternalStore so localStorage is the only source of truth.
Outcomes
Frameflow runs the core loop end to end: sign in, describe a video, get a scene plan, add stock or uploaded clips, arrange them on a multi-track timeline with audio layers, and manage projects. CI runs lint, type-check, and build on GitHub Actions, and a lint backlog of 2,316 problems, caused by linting generated code, is now zero.
KEY TAKEAWAYS
Building alone means every shortcut shows up later as a bug. The habit that paid off most was auditing: which fields a copy really copies, who can call each route, and which state owns each value.
