This is a demo to test a HLS service. It uses a golang server to serve the HLS files and a next.js app to handle the user interactions. The golang API handles all HTTP requests and allows users to log in using JWT auth and serves the HLS files. The next.js app to handle the user interactions, such as:
- create account
- login
- logout
- list of available videos
- video player
-
docker to run the containers
-
Or if you want to run locally
- docker (for the postgres database)
- golang
- node.js
- yarn
- Change the connection string in
./backend/db/db.go
file to the correct database connection string depending on your setup
// psqlInfo := os.Getenv("DATABASE_URL")
psqlInfo := fmt.Sprintf("port=%d user=%s password=%s dbname=%s sslmode=disable", port, dbuser, dbpass, dbname)
docker compose build
docker compose up
- Run the database with
docker compose up postgres
(needs docker installed) - On one terminal, run
cd ./backend
and rungo run .
for the golang server - On another terminal, run
cd ./frontend
and runyarn dev
for the next.js app