Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmytrodemianchuk/crud-app
A CRUD application that provides a Web API to the data
https://github.com/dmytrodemianchuk/crud-app
docker docker-compose go golang jwt postgresql
Last synced: 1 day ago
JSON representation
A CRUD application that provides a Web API to the data
- Host: GitHub
- URL: https://github.com/dmytrodemianchuk/crud-app
- Owner: DmytroDemianchuk
- Created: 2023-05-07T21:22:38.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-07-29T12:19:51.000Z (over 1 year ago)
- Last Synced: 2024-06-21T16:46:25.652Z (5 months ago)
- Topics: docker, docker-compose, go, golang, jwt, postgresql
- Language: Go
- Homepage:
- Size: 35.9 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRUD Application for Managing Music Lists
## I used the following concepts during development:
- Building a Web Application with Go, following the REST API design.
- The Clean Architecture approach in building the structure of an application. Dependency injection technique.
- Working with the gorilla/mux.framework.
- Working with Postgres database. Run from Docker. Generation of migration files.
- Working with the database using the sqlx library.
- Writing SQL queries.## Requirements
- go 1.20
- docker & docker-compose## Run Project
Definition migrating to database
```
migrate -path ./schema -database 'postgres://postgres:qwerty@localhost:5436/postgres?sslmode=disable' up
```Use `make run` to build&run project
## API:
### POST /auth/sign-upCreates new user
##### Example Input:
```
{
"name": "user",
"email": "[email protected]",
"password": "password"
}
```### POST /auth/sign-in
Request to get JWT Token based on user credentials
##### Example Input:
```
{
"email": "[email protected]",
"password": "password"
}
```##### Example Response:
```
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1NzEwMzgyMjQuNzQ0MzI0MiwidXNlciI6eyJJRCI6IjAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMCIsIlVzZXJuYW1lIjoiemhhc2hrZXZ5Y2giLCJQYXNzd29yZCI6IjQyODYwMTc5ZmFiMTQ2YzZiZDAyNjlkMDViZTM0ZWNmYmY5Zjk3YjUifX0.3dsyKJQ-HZJxdvBMui0Mzgw6yb6If9aB8imGhxMOjsk"
}
```### POST /musics
Creates new musics
##### Example Input:
```
{
"name": "Good Morning",
"artist": "Kanye West",
"album": "Graduation",
"genre": "Hip hop",
"released_year": 2007
}
```### GET /musics/1
Returns music by id
##### Example Response:
```
{
"name": "Good Morning",
"artist": "Kanye West",
"album": "Graduation",
"genre": "Hip hop",
"released_year": 2007
}
```### DELETE /musics
Deletes music by ID:
##### Example Input:
```
{
"id": "1"
}
```