An open API service indexing awesome lists of open source software.

https://github.com/meyiapir/books-api

REST API for managing book lists
https://github.com/meyiapir/books-api

api gin go go-api go-examples golang-api golang-examples golang-rest rest-api sql sqlx

Last synced: 11 months ago
JSON representation

REST API for managing book lists

Awesome Lists containing this project

README

          

# REST API for managing books

## The project uses skills:
- Development of Web Applications on Go, following the REST API design.
- Working with the framework gin-gonic/gin.
- The Pure Architecture approach in building the application structure. Dependency injection technique.
- Working with the PostgreSQL database.
- Application configuration using the library spf13/viper. Working with environment variables.
- Working with the database using the library sqlx.
- Writing SQL queries.

### Для запуска приложения:

```bash
go run cmd/main.go
```

If the application is launched for the first time, you need to apply migrations to the database:
```bash
migrate -path ./schema -database 'postgres://postgres:password@host:5436/postgres?sslmode=disable' up
```

```
goBooksApi
├── cmd
│ └── main.go
├── config
│ └── config.yml
├── pkg
│ ├── handler
│ │ ├── books.go
│ │ ├── handler.go
│ │ └── response.go
│ ├── repository
│ │ ├── books_postgres.go
│ │ ├── postgres.go
│ │ └── repository.go
│ └── service
│ ├── bookService.go
│ ├── booksService.go
│ └── service.go
├── schema
│ ├── 000001_init.down.sql
│ └── 000001_init.up.sql
├── .env
├── .gitignore
├── book.go
├── go.mod
├── go.sum
├── LICENSE
└── server.go
```