Skip to content

prodigystd/libraryApi

Repository files navigation

Description

Design a database schema and a backend for storing a library. It should store authors and their books. User interaction occurs through HTTP requests to the API. All responses are JSON objects.

The server implements the following methods:

Selecting all books by one author
Getting the author on the book
Getting a list of books written by exactly 2 co-authors. Result: book - number of co-authors.
Requirements:

Code according to PSR standards and it is forbidden to use any frameworks or program libraries

Usage:

In the project root folder run:

Installation:
make local-start

Run tests:
make local-test

The project architecture:

The project implements microkernel architecture(microkernel + plugins) and MVC pattern(Layered architecture). Plugins are named as modules in this microkernel architecture implementation.

API description:

Listing all books by the same author:
Request type: GET
Parameter: author_name
Parameter type: string
http://localhost:8080/books/books-by-author?author_name=Joanne

Getting the author by the book:
Request type: GET
Parameter: book_name
Parameter type: string
http://localhost:8080/authors/authors-by-book?book_name=Harry

Getting a list of books written by exactly 2 co-authors. Result: book - number of coauthors:
Request type: GET
Parameter: author_count
Parameter type: integer
http://localhost:8080/books/books-by-author-count?author_count=2

Описание

Спроектировать схему БД и backend для хранения библиотеки. Интересуют авторы и книги. Взаимодействие с пользователем происходит посредством HTTP запросов к API. Все ответы представляют собой JSON объекты.

Сервер реализует следующие методы:

выдача всех книг одного автора
выдача автора по книге
выдача списка книг, написанных ровно 2 соавторами. Результат: книга - количество соавторов.
Требования:

оформить код по стандартам PSR и запрещается использовать различные framework’и

Использование:

В корневой папке проекта запустить:

Установка:
make local-start

Запуск тестов:
make local-test

Архитектура проекта:

Проект реализует микроядерную архитектуру (микроядро + плагины) и MVC паттерн (Многоуровневая архитектура). Плагины названы модулями(Modules) в данной реализации микроядерной архитектуры.

Описание API:

выдача всех книг одного автора:
Тип запроса: GET
Параметр: author_name
Тип параметра: строка
http://localhost:8080/books/books-by-author?author_name=Joanne

выдача автора по книге:
Тип запроса: GET
Параметр: book_name
Тип параметра: строка
http://localhost:8080/authors/authors-by-book?book_name=Harry

выдача списка книг, написанных ровно 2 соавторами. Результат: книга - количество соавторов:
Тип запроса: GET
Параметр: author_count
Тип параметра: целое число
http://localhost:8080/books/books-by-author-count?author_count=2

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published