Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎬 Video Editing Backend API

Node.js Express.js Prisma PostgreSQL


📋 About the Project

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.


🚀 Tech Stack

  • Node.js (v16.x)
  • Express.js (v4.x)
  • PostgreSQL with Prisma ORM
  • FFmpeg (for video processing)
  • Multer (file uploads)
  • Swagger (optional API docs)

🎯 Features

  • 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

🏗 Project Structure

/prisma/
├── schema.prisma

/src/
├── controllers/
    ├── videoController.js
├── routes/
    ├── videoRoutes.js
├── services/
    ├── videoServices.js
├── index.js

/uploads/

├── package.json

⚙️ Setup Instructions

1. Clone the repository

git clone https://github.com/yogeshxd/EditorAPI.git
cd EditorAPI

2. Install dependencies

npm install

3. Configure environment variables

Create a .env file:

DATABASE_URL="postgresql://<your-db-username>@localhost:5432/videoeditor"

4. Setup PostgreSQL Database

sudo systemctl start postgresql
sudo -iu postgres
createdb videoeditor
exit

Run migrations:

npx prisma migrate dev
npx prisma generate

5. Start the server

npm run dev   # if using nodemon

OR

node src/index.js

Server will start at: http://localhost:5000


🔥 API Endpoints

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

📢 Important Notes

  • FFmpeg must be installed and globally available. (ffmpeg --version should work.)
  • All video files are stored locally under the /uploads directory.
  • No authentication or access control is implemented.
  • Background jobs, retry handling, and async queues are not included but can be added.

API Documentation

Interactive API documentation is available using Swagger UI. Access it here:

http://localhost:5000/api-docs

Example Screenshot: Swagger API Documentation

📹 Demo

You can view the demo video walkthrough here.


✍️ Author

About

An API using which you can upload, trim, add subtitles, render and then dwonload a video.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Used by

Contributors

Languages