Backend for XFlix - A video sharing platform
Backend API Documentation • XFlix Frontend Github • XFlix Frontend Website
XFlix Node is a video sharing platform that allows users to watch and upload videos using external links (e.g., YouTube). This project covers the backend of Xflix node.
- Node.js: For server-side development.
- Express.js: To create RESTful APIs easily.
- MongoDB: For data persistence.
-
- Mongoose: For creating MongoDB schemas and validating them.
- Postman: For API testing and documentation.
- RESTful API implementation.
- Video title search functionality.
- Filtering by genres and content ratings.
- Sorting by upload date and view count.
-
Installation
# Clone the repository git clone https://github.com/Anusree6154s/xflix-backend.git # Navigate to the project directory cd xflix-backend # Install dependencies npm install
-
Set up environment variables:
- In
.env
file in the root directoryNODE_ENV = your_port MONGO_URI = your_mongodb_uri
- In
-
Start the server:
npm start
The server should be running on
http://localhost:PORT/v1/videos
.
xflix-backend/
├── _CRIO_/ # Crio metadata
├── assessment/ # Crio assessment files
├── backend/ # Backend code implemented by me
│ ├── models/ # Database models
│ ├── index.js # Server setup and configuration
│ └── server.js # Routes
├── README.md # Project documentation
├── package.json # Project dependencies and scripts
└── runAssessment.sh # Script to run assessments
-
- Node.js & Express.js: Chosen for their non-blocking architecture and scalability, making it ideal for handling multiple requests simultaneously.
- MongoDB: Used for its flexibility in data modeling, especially for unstructured video data.
-
- Hosting: Deployed on Render for it ease of use and automatic deployments.
- GET /v1/videos: Retrieve a list of videos.
- GET /v1/videos/:videoId: Retrieve details of a specific video.
- POST /v1/videos: Upload a new video.
- PATCH /v1/videos/:videoId/votes: Update votes for a video.
- PATCH /v1/videos/:videoId/views: Update view count for a video.
- User authentication and authorization.
- Commenting system for videos.
- User profiles to track uploaded videos.