8000 GitHub - rogaliiik/library: REST API built by Clean Architecture principles
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

rogaliiik/library

Repository files navigation

Library REST API

An API with ability to operate books which is built by Clean Architecture principles.

Stack

  • Go 1.21
  • PostgreSQL 16
  • Docker-Compose

Features

  • Following the Clean Architecture Principles
  • HTTP routing with go-chi/chi framework
  • Work with PostgreSQL. Migration files generation. SQL queries.
  • Registration and authentication. Working with JWT. Middleware.
  • Graceful Shutdown
  • Running project in Docker-Compose
  • Linting project with golangci-lint
  • Generated Swagger docs with swaggo/http-swagger

Endpoints

API provides authentication endpoints:

  • /v1/auth/sign-up with "POST" method to create new user
  • /v1/auth/sign-in with "POST" method to login user and create JWT

Endpoints working with JWT:

  • /v1/book with "POST" method to create new book
  • /v1/book/{bookId} with "GET" method to get book by ID
  • /v1/book with "GET" method to get all books by for current user
  • /v1/book/{bookId} with "PUT" method to update book by ID
  • /v1/book/{bookId} with "DELETE" method to delete book by ID

Deploy

Clone repo:

git clone https://github.com/rogaliiik/library.git

Run app in docker-compose:

make run

To get Swagger open page in browser:

localhost:8080/swagger/

About

REST API built by Clean Architecture principles

Resources

Stars

Watchers

Forks

Report repository

Releases

No releases published

Packages

No packages published
0