Skip to content

meyiapir/books-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

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

go run cmd/main.go

If the application is launched for the first time, you need to apply migrations to the database:

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