Skip to content

Hover Creaft is a backend implementation for a standalone and lightwight video streaming, that uses In-memory MongoDB, where you can upload, check the status and watch streaming of videos.

License

Notifications You must be signed in to change notification settings

GiovaniRizzato/hover-craft-backend

Repository files navigation

Hover Craft

Welcome to the repository for Hover Creaft: Video Streaming! This project is a backend implementation for a standalone and lightwight video streaming, where you can upload, check the status and watch streaming of videos.

Since this solution is intended as portfolio, it uses In-Memory MongDB database to not require any extra installation other than the Node.js, however, all the MongoDB connection is setup in the AppModule, and if changed to a connection the rest of the transactions would still follow the new setup.

Tecnologies used 🛠️

Frameworks:

Typescript Nodejs NestJS

Databases:

MongoDB Mongoose

Testing:

Jest Swagger Postman

Using this solution 🚀

To use this solution, follow the instructions:

  1. Clone the repository:
git clone https://github.com/GiovaniRizzato/streaming-backend
  1. Download the dependencies:
npm install
  1. Run the aplication:
npm run start
  1. Access the endpoints with http://localhost:3000/, by default

Accessing Swagger documentation:

The solution has a Swagger using the http://localhost:3000/api/ endpoint and the steps of Using this solution section.

List of endpoints and Models 📋

Method URL Request Body Response Body Description
GET /video Array of Info DTO Retrieve informations from all listed videos.
GET /video/{id} Info DTO Retrieve all video informations with {id}.
PUT /video/{id} New info DTO Info DTO Update informations for video with {id}.
POST /video New info DTO + File Info DTO Upload new video.
GET /video/watch/{id} Request the video streaming with {id}. It'll throw an error if the video is not available

New video info DTO

{
  title: string,
  isStreamAvalible: boolean,
  isListed: boolean
}

Video info DTO

{
  id: number,
  title: string,
  isStreamAvalible: boolean,
  isListed: boolean
}

Testing results ✅

All the tests implementation are in "E2E" format to ensure testing accuracy, and can be found in test/app.e2e-spec.ts.

PASS  test/app.e2e-spec.ts (18.842 s)
  AppController
    √ should return an empty list when no videos had been uploaded yet (1360 ms)
    should be able to upload a new video
      √ should be included listed (1680 ms)
      √ should be able to view the info by id (1436 ms)
      √ should be able to watch the video (1658 ms)
      should be able to edit the video information (to not listed, nor avalible to watch)
        √ should NOT included listed after changing it to unlisted video (1492 ms)
        √ should be still able to view the info by id, even when not watchable nor listed (1640 ms)
        √ should NOT be able to watch the video after changing it to not be avalible (1363 ms)

About

Hover Creaft is a backend implementation for a standalone and lightwight video streaming, that uses In-memory MongoDB, where you can upload, check the status and watch streaming of videos.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published