Skip to content

Alfedi/BOOM

Repository files navigation

BOOM

BOOM is a simple application to manage your books in a database.

Development environment

  • Install elixir/erlang using `asdf`

Information to install asdf can be found here

$ asdf plugin-add erlang https://github.com/asdf-vm/asdf-erlang
$ asdf plugin-add elixir https://github.com/asdf-vm/asdf-elixir
$ asdf install

or install Erlang and Elixir on your machine.

Development environment variables

In the .env file environments vars needs to be defined for the local environments. Those need to be loaded when working with this project. To do so, one can manually execute:

source .env

or automate this process using direnv.

# Install direnv using your package manager.

# From the project folder
$ direnv allow

Continue with the instructions https://github.com/direnv/direnv#getting-started

Development environment database

  • Install docker&docker-compose

Information to install docker can be found here Information to install docker-compose can be found here

Set up postgresql database:

$ docker network create boom_network
$ docker-compose up

Endpoints (verb-friendly)

Get a book given ISBN

get http://localhost:4000/api/books/9780123456789 Content-Type: application/json

Get all books (limit 50 by default)

get http://localhost:4000/api/books Content-Type: application/json

Get books filtering

get http://localhost:4000/api/books?limit=10&title=Sample Title Content-Type: application/json

Possible query params: - title - author - publisher - edition

Add a new book to the database

post http://localhost:4000/api/books Content-Type: application/json

{ “ISBN”: “1234567890”, “title”: “Sample Title”, “author”: “The person who wrote this”, “publisher”: “BOOM books”, “edition”: “1” }

Remove a book from the database

delete http://localhost:4000/api/books/1234567890 Content-Type: application/json

Edit book info

put http://localhost:4000/api/books/1234567890 Content-Type: application/json

{ “ISBN”: “1234567890”, “title”: “Edited title”, “author”: “Edited author”, “publisher”: “Edited Publisher”, “edition”: “New Edition” }

Authors

Very special thanks

To samgh96 for suggesting such an incredible name and not letting me keep the awful one.

About

Simple book management API REST

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors