A simple aplication to log the books you read.
As a fun fact, the dump for the database contains (aside from some tests) real books that I read this year. In the near future I plan to add a few features to get more status from this.
GET /books
Params | Type | Description |
---|---|---|
id |
number |
Identification of the book |
title |
string |
Title of the book |
author |
string |
Author of the book |
pages |
number |
Number of pages of the book |
rating |
number |
Rating you give the book. null if not finished |
genre |
string |
Main genre of the book |
series |
boolean |
true if the book belongs to a series. false otherwise |
format |
string |
Format you read the book ** |
date_started |
Date |
Day you started reading the book |
date_finished |
Date |
Day you finished reading the book. null if not finished |
** Options: Physical
, eBook
, Audiobook
or Manga
Expected return: 200
POST /books
Params | Type | Description |
---|---|---|
title |
string |
Title of the book |
author |
string |
Author of the book |
pages |
number |
Number of pages of the book |
rating |
number |
Rating you give the book, between 0 and 5 *** |
genre |
string |
Main genre of the book |
series |
boolean |
true if the book belongs to a series. false otherwise |
format |
string |
Format you read the book ** |
date_started |
Date |
Day you started reading the book |
date_finished |
Date |
Day you finished reading the book *** |
** Options: Physical
, eBook
, Audiobook
or Manga
*** Optional param
Expected return: 201
DELETE /books/:id
Expected return: 204
PUT /books/:id
Expected return: 202
POST /books/finished/:id
Params | Type | Description |
---|---|---|
rating |
number |
Rating you give the book, between 0 and 5 |
date_finished |
Date |
Day you finished reading the book |
Expected return: 202
GET /books/status
Params | Type | Description |
---|---|---|
total_books |
number |
Number of books you read |
total_pages |
number |
Number of pages read |
total_authors |
number |
Number of unique authors you read |
Expected return: 200
- Clone this repository
- Install dependencies
npm i
- Create an
.env
file with aDATABASE_URL
as in.env.example
file - Create a local postgres database using the
dump.sql
file - Start the application on the root of the project
npm run dev