This is a backend to support a stream-media website project.
It divided into several service to handle with frontend request
- Upload advertisement and film resource
- Get the advertisement and film inserted with advertisement
- Get the list of films by different filter
- ...
cd deployment/docker-compose
docker-compose up -d
Then service will deploy in http://127.0.0.1
Subject | ||
---|---|---|
Design Mode | Layered Architecture | Micro Service Architecture |
Transportation of Protocol | HTTP | gRPC |
Event Driven | Kafka | Watermill |
Storage | Mongodb | MinIO |
Search Engine | Elasticsearch | |
Video Processing | ffmpeg | |
Deployment | docker-compose | kubernetes |
├── api_affair
│
├── api_media
│
├── api_upload
│
├── api_upload_worker
│
├── api_ad_service
│
├── api_film_service
│
├── assets
│
├── deployment
│
├── http_request_test
Note:
Except deployment, http_request_test and assets, each directory represent with a service.
assets -> The directory to store the images.
deployment -> The scirpts to deploy the applications.
http_request_test -> The http file to test the api.
api_affair -> The http server to handle with normal affair.
api_media -> The http server to get the media.
api_upload -> The http server to upload resource and create film.
api_upload_worker -> The http server to transform the media type and store it.
api_film_service -> The gRPC server to handle all data about film.
api_ad_service -> The gRPC server to handle all data about ad.
├── api
│
├── service
│
├── repository
Note:
In every service directory, most of them has api, service and repository.
It totally represent the layered arichitecture presnetation, business and data-access layer.
In api directory
1. Define all the interface for the service
2. Setting the model of request and response
In service directory
1. Gain the data from representation layer
2. Try to get data from data-access layer
3. Finally it will do some calculate and return the value to representation layer
In repository directory
1. Gain the query from business layer
2. Try to connect the database and make some CRUD operation then return the value
- Get the films by different query
- Get the advertisements by different query
- Get the playlist in specific film's episode
- Get the media including image, video and GIF.
- Create a film and upload its information
- Upload an advertisement
- As a consumer get the mission from api-upload
- Convert a file into HLS format and upload to database
- Manipulate all the information about advertisement
- Manipulate all the information about film