This is a poor attempt to build a bootleg music streaming application with Golang using coding best practices. This code is for learning purposes only, please obtain a copy of the license before using part(s) of the code in production.
See
README.md
in each folder for documentation
|-config # All config parsing and loading happens here
-----/config-local.yaml
-----/*.go
|-containers # Docker-compose & K8s setup
|-ent
---/schema/*.go # Schema definitions
---/*.go
|-internal # Actual app logic
|-pkg/*.go # Utilities shared across the app
|-server/*.go # Bootstrapping the server
|-/.main.go # Application entry point
|-/.Makefile # Small scripts to help you build the app
You might need to create a volume that Postgres needs to attach to first;execute the command
docker volume create --name entexample-volume -d local
. PLEASE DO THIS ONLY ONCE.
cd ./containers && docker-compose up -d
make cli
make gen
make build
make run
Assuming the app is running on localhost
try adding a song by making the following curl
request
curl --request POST \
--url http://localhost:42069/api/v1/song/add \
--header 'Content-Type: application/json' \
--data '{
"name": "test",
"fileUrl": "http://file.com/123.mp3"
}'