Vibble is a backend API for managing users, videos, tweets, playlists, subscriptions, likes, comments, and dashboard statistics. This documentation provides details about the available endpoints, how to use them, and the expected request/response formats.
- User Management: Register, login, logout, update profile, and manage user avatars and cover images.
- Video Management: Publish, update, delete, and retrieve videos.
- Tweet Management: Create, update, delete, and retrieve tweets.
- Playlist Management: Create, update, delete playlists and manage videos within playlists.
- Subscription Management: Subscribe/unsubscribe to channels and retrieve subscription details.
- Likes: Like/unlike videos, comments, and tweets.
- Comments: Add, update, delete, and retrieve comments for videos.
- Dashboard Statistics: Retrieve channel statistics and videos.
- Healthcheck: Check the health of the API.
http://localhost:3000/api/v1
Most endpoints require authentication using a JWT token. Include the token in the Authorization header as follows:
Authorization: Bearer <your-token>
- POST
/users/register - Request Body:
{
"fullName": "John Doe",
"email": "john@example.com",
"userName": "johndoe",
"password": "password123"
}- Response:
{
"statusCode": 201,
"data": {
"userId": "12345",
"fullName": "John Doe",
"email": "john@example.com",
"userName": "johndoe"
},
"message": "User registered successfully"
}- POST
/users/login - Request Body:
{
"email": "john@example.com",
"password": "password123"
}- Response:
{
"statusCode": 200,
"data": {
"userId": "12345",
"token": "jwt-token",
"email": "john@example.com",
"userName": "johndoe"
},
"message": "User logged in successfully"
}- POST
/users/logout - Response:
{
"statusCode": 200,
"data": null,
"message": "User logged out successfully"
}- GET
/videos - Query Parameters:
page: Page number (default: 1)limit: Number of videos per page (default: 10)
- Response:
{
"statusCode": 200,
"data": [
{
"videoId": "v123",
"title": "My Video",
"description": "This is a video description",
"publishedAt": "2025-06-16T12:00:00Z"
}
],
"message": "Videos found"
}- POST
/videos - Request Body:
{
"title": "My Video",
"description": "This is a video description"
}- Response:
{
"statusCode": 201,
"data": {
"videoId": "v123",
"title": "My Video",
"description": "This is a video description",
"publishedAt": "2025-06-16T12:00:00Z"
},
"message": "Video published successfully"
}- POST
/tweets - Request Body:
{
"content": "This is my first tweet!"
}- Response:
{
"statusCode": 201,
"data": {
"tweetId": "t123",
"content": "This is my first tweet!",
"createdAt": "2025-06-16T12:00:00Z"
},
"message": "Tweet created"
}- POST
/playlist - Request Body:
{
"name": "My Playlist",
"description": "This is a playlist description"
}- Response:
{
"statusCode": 200,
"data": {
"playlistId": "p123",
"name": "My Playlist",
"description": "This is a playlist description",
"createdAt": "2025-06-16T12:00:00Z"
},
"message": "Playlist created successfully"
}- POST
/subscriptions/channel/:id - Response:
{
"statusCode": 200,
"data": {
"channelId": "c123",
"subscribedAt": "2025-06-16T12:00:00Z"
},
"message": "Subscribed"
}- POST
/likes/toggle/v/:videoId - Response:
{
"statusCode": 200,
"data": {
"videoId": "v123",
"liked": true
},
"message": "Liked successfully"
}- POST
/comments/:videoId - Request Body:
{
"content": "This is a comment"
}- Response:
{
"statusCode": 200,
"data": {
"commentId": "c123",
"content": "This is a comment",
"createdAt": "2025-06-16T12:00:00Z"
},
"message": "Comment added successfully"
}- GET
/dashboard/stats - Response:
{
"statusCode": 200,
"data": {
"totalVideos": 10,
"totalSubscribers": 100,
"totalViews": 5000
},
"message": "Channel Stats"
}- GET
/healthcheck - Response:
{
"statusCode": 200,
"data": "OK",
"message": "Healthcheck successful"
}- Set up the environment variables in
.envfile. - Start the server using:
npm run dev - Use tools like Postman or cURL to interact with the API.
- Include the JWT token in the
Authorizationheader for secured endpoints.
- Ensure all required fields are provided in the request body.
- Handle errors gracefully by checking the response status code and message.