- CRUD operations
- JWT token autorization
- MongoDB database
- Go
- Gin
- HTTP
- JSON
- JWT
- Docker
- MongoDB
- Clean Architecture
- Git
- Enviroment variables
- Config file
- Docker Compose
Create .env file in root directory which contains login and password to MongoDB. According to env in docker-compose.yaml, for this project it should look like:
MONGODB_USERNAME = root
MONGODB_PASSWORD = funnycat
To run server, go to your directory, download required modules and run docker compose.
cd /PATH/TO/Your/REPO/MusicApi
docker compose up --build
if you want to run MongoDB detached: docker compose up server_container
Then use your prefered HTTP Client. By default, URL is http://localhost:8000/
GET http://localhost:8000/api/album/:id
Get album data by idGET http://localhost:8000/api/album
Get all album dataDELETE http://localhost:8000/api/album/:id
Delete albym by idPOST http://localhost:8000/api/album
Add new album to database. Requires auth tokenPOST http://localhost:8000/api/album/array
Add array of albums to database. Requires auth tokenPOST http://localhost:8000/api/admin
Add new admin. Requires auth tokenPOST http://localhost:8000/auth/register
Create new userPOST http://localhost:8000/auth/login
Login to your account.
Examples of requests you can find in requests.md