This project was developed as part of a technical assignment for a backend developer position.
The task was to create a modular, scalable backend service for a web-based video editing platform using Node.js, Express, PostgreSQL, and FFmpeg.
⚠ Note:
This is a prototype designed to demonstrate backend architecture, API design, and video processing using FFmpeg.
It is not fully production-ready. Improvements like authentication, rate-limiting, input sanitization, background queues, and error resilience would be needed for real-world deployment.
- Node.js (v16.x)
- Express.js (v4.x)
- PostgreSQL with Prisma ORM
- FFmpeg (for video processing)
- Multer (file uploads)
- Swagger (optional API docs)
- Upload videos
- Trim videos by selecting start and end timestamps
- Add subtitles overlay (text appearing between specific timestamps)
- Render and save the final video
- Download final edited videos
/prisma/
├── schema.prisma
/src/
├── controllers/
├── videoController.js
├── routes/
├── videoRoutes.js
├── services/
├── videoServices.js
├── index.js
/uploads/
├── package.json
git clone https://github.com/yogeshxd/EditorAPI.git
cd EditorAPInpm installCreate a .env file:
DATABASE_URL="postgresql://<your-db-username>@localhost:5432/videoeditor"sudo systemctl start postgresql
sudo -iu postgres
createdb videoeditor
exitRun migrations:
npx prisma migrate dev
npx prisma generatenpm run dev # if using nodemonnode src/index.jsServer will start at: http://localhost:5000
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/videos/upload |
Upload a video file |
| POST | /api/videos/:id/trim |
Trim a video |
| POST | /api/videos/:id/subtitles |
Add subtitles to a video |
| POST | /api/videos/:id/render |
Render the final edited video |
| GET | /api/videos/:id/download |
Download the final edited video |
- FFmpeg must be installed and globally available. (
ffmpeg --versionshould work.) - All video files are stored locally under the
/uploadsdirectory. - No authentication or access control is implemented.
- Background jobs, retry handling, and async queues are not included but can be added.
Interactive API documentation is available using Swagger UI. Access it here:
http://localhost:5000/api-docs
You can view the demo video walkthrough here.
