https://github.com/zeroonedev01/express-backend-rent-book-app
https://github.com/zeroonedev01/express-backend-rent-book-app
database express jwt mysql postman
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zeroonedev01/express-backend-rent-book-app
- Owner: zeroonedev01
- Created: 2019-08-14T16:01:36.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-10-01T04:47:18.000Z (over 6 years ago)
- Last Synced: 2025-01-19T08:42:42.105Z (over 1 year ago)
- Topics: database, express, jwt, mysql, postman
- Language: JavaScript
- Size: 60.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Rent Book RESTfull API
Built with Express.js and Mysql.
## Table of Contents
- [Table of Contents](#table-of-contents)
- [Introduction](#introduction)
- [Features](#features)
- [Built With](#built-with)
- [Requirements](#requirements)
- [Usage for Development](#usage-for-development)
- [Setup .env file](#setup-env-file)
- [End Points](#end-points)
- [Contributor](#contributor)
## Introduction
This is my repository containing a Rest Full API backend Rent Book app, this API is builded with Mysql and Express.JS
## Features
* Register and Login with JWT
* CRUD Books
* CRUD Genre
* Sorting
* Filtering
* Pagination
* Search a books
* Rent or returning a book
## Built With
[](https://expressjs.com/)
[](https://nodejs.org/)
[](https://www.npmjs.com/search?q=mysql)
[](https://www.npmjs.com/package/jsonwebtoken)
## Requirements
* node.js
* npm
* postman (installer or chrome extension)
* code editor (visual studio code recommend)
* mysql (xampp)
## Usage for Development
* Clone this repository https://github.com/tejojr/express-backend-rent-book-app.git
* Open CMD or Terminal and enter to the app directory
* Type in Terminal npm install to install the required packages.
* Setup .env file
* Run MySql
* Create database and run example.sql script to install the necessary database structure
* Open Postman for testing API
## Setup .env file
* In windows OS, you can open command prompt, change directory to your project directory.
Example,
My project directory
```
E:\my_project
```
* Then you can type,
```
copy .env.example .env
```
* Then Setup .env
## End Points
1. Genre
* Post
```
host/rentapp/genres
```
* Get
```
host/rentapp/genres
host/rentapp/genres?page=1&limit=2&sort=name:desc
```
* Patch
```
host/rentapp/genres/:id
```
* Delete
```
host/rentapp/genres/:id
```
2. Book
* Post
```
host/rentapp/books/
```
* GET
```
host/rentapp/books?sort=title:desc&available=true&page=1&limit=2
```
* Patch
```
host/rentapp/books/:id
```
* Delete
```
host/rentapp/books/:id
```
3 Borrow
* Post Borrow
```
host/rentapp/borrows
```
* Patch returnbook
```
host/rentapp/borrows/:id
```
* getBorrow
```
host/rentapp/borrows/
```
4.user
* post sign
```
host/rentapp/users/signin
```
* post signup
```
host/rentapp/users/signup
```
## Contributor
Ammar Annajih Pasifiky