This is the server for a virtual bookshelf app that was developed using NodeJS, Express, Sequelize and PostgreSQL.
Features | API Reference | Technologies | Installation
This is a server API for a virtual bookshelf application. You can create your account and start registering your books.
Some key features are:
- Create account and register books.
- Password are encrypted with Bcrypt package.
- Authenticated routes using JWT Token.
- Upload your user avatar and the cover of your books.
- Image files host on ImgBB.
- Books filtering options.
The application is built using Node.JS with Express framework. The database is the PostgreSQL connected by Sequelize ORM. The entire codebase is written using Javascript.
Checkout the API Live version with a PostgreSQL database hosted on:
You also can check the complete Application Live version hosted on:
GET /
POST /users
Body | Type | Description |
---|---|---|
name |
string |
Required. Name of the user |
email |
string |
Required. Email of the user |
password |
string |
Required. Password of the user |
POST /session
Body | Type | Description |
---|---|---|
email |
string |
Required. Email of the user |
password |
string |
Required. Password of the user |
All next routes need authentication!
GET /users
PUT /users
Body | Type | Description |
---|---|---|
name |
string |
Optional. Name of the user |
email |
string |
Optional. Email of the user |
oldPassword |
string |
Optional. Old password of the user |
password |
string |
Optional. New Password of the user |
confirmPassword |
string |
Optional. New password confirmation of the user |
DELETE /users
GET /books
GET /books/:id
Parameter | Type | Description |
---|---|---|
id |
string |
Required. Id of the book |
POST /books
Body | Type | Description |
---|---|---|
title |
string |
Required. Title of the book |
isbn |
string |
Required. ISBN of the book |
genre |
string |
Required. Genre of the book |
synopsis |
string |
Required. Synopsis of the book |
pages |
string |
Required. Pages of the book |
authors |
string[] |
Required. Authors of the book |
publishing_company |
string |
Required. Publishing Company of the book |
cover_id |
string |
Required. ID of the cover file of the book |
PUT /books/:id
Parameter | Type | Description |
---|---|---|
id |
string |
Required. ID of the book |
Body | Type | Description |
---|---|---|
title |
string |
Required. Title of the book |
isbn |
string |
Required. ISBN of the book |
genre |
string |
Required. Genre of the book |
synopsis |
string |
Required. Synopsis of the book |
pages |
string |
Required. Pages of the book |
authors |
string[] |
Required. Authors of the book |
publishing_company |
string |
Required. Publishing Company of the book |
cover_id |
string |
Required. ID of the cover file of the book |
DELETE /books/:id
Parameter | Type | Description |
---|---|---|
id |
string |
Required. ID of the books |
PUT /books/:id/reading
Parameter | Type | Description |
---|---|---|
id |
string |
Required. ID of the books |
Body | Type | Description |
---|---|---|
is_reading |
boolean |
Required. Book reading status |
PUT /books/:id/favorite
Parameter | Type | Description |
---|---|---|
id |
string |
Required. ID of the books |
Body | Type | Description |
---|---|---|
favorite_read |
boolean |
Required. Book favorite status |
POST /files
Body | Type | Description |
---|---|---|
file |
img |
Required. Image file |
This is what i used and learned with this project:
- Node.JS
- Express
- Sequelize
- PostgreSQL
- UUID
- Multer
- Bcryptjs
- JWT
- Yup
- Imgbb Uploader
- Eslint
- Prettier
- Sucrase
- Javascript
To use this project, first you need NodeJS and PostgreSQL running in your device, then you can follow the commands below:
# Clone this repository
git clone https://github.com/areasflavio/bookshelf-manager-server.git
# Go into the repository
cd bookshelf-manager-server
# Install dependencies for the backend
yarn install
# Copy the .env.example to the .env file and inject your credentials
cp .env.example .env
# Make sure that you have a proper database created
# Run the migrations
yarn sequelize-cli db:migrate
# To start the express development server, run the following command
yarn dev:server
Build by Flávio Arêas 👋 Get in touch!