Skip to content

A virtual bookshelf server that was developed using NodeJS, Express, Sequelize and PostgreSQL.

Notifications You must be signed in to change notification settings

areasflavio/bookshelf-manager-server

Repository files navigation

Bookshelf-manager-server

transactioned

This is the server for a virtual bookshelf app that was developed using NodeJS, Express, Sequelize and PostgreSQL.

GitHub top language GitHub language count GitHub last commit

Features  |   API Reference  |   Technologies  |   Installation

⭐ Features

(Back to top)

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:

Heroku

You also can check the complete Application Live version hosted on:

Vercel


💻 API-Reference

(Back to top)

Get welcome message

  GET /

Users

Create a user

  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

Login with a 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 all users

  GET /users

Update current user

  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 current user

  DELETE /users

Books

Get books from current user

  GET /books

Get the details of a book

  GET /books/:id
Parameter Type Description
id string Required. Id of the book

Create a book register

  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

Update a existing 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 a existing books

  DELETE /books/:id
Parameter Type Description
id string Required. ID of the books

Set/remove an existing book as currently being read

  PUT /books/:id/reading
Parameter Type Description
id string Required. ID of the books
Body Type Description
is_reading boolean Required. Book reading status

Set/remove an existing book as favorite

  PUT /books/:id/favorite
Parameter Type Description
id string Required. ID of the books
Body Type Description
favorite_read boolean Required. Book favorite status

Files

Upload image file

  POST /files
Body Type Description
file img Required. Image file

⌨️ Technologies

(Back to top)

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

🖱️ Installation

(Back to top)

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

👨‍💻 Author

(Back to top)

Build by Flávio Arêas 👋 Get in touch!

About

A virtual bookshelf server that was developed using NodeJS, Express, Sequelize and PostgreSQL.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published