This repository is the back-end side of the `Digi Bookshelf` project.
https://digi-bookshelf.herokuapp.com/
- NYT API ## (API-KEY REQ.)
- Pravatar ## (API-KEY NOT REQ.)
- GoogleBooks ## (API-KEY NOT REQ.)
Here's an overview of all end-points used in the API:
- GET || /:videoName -> For login/sign-up short videos
- GET || /api/verify -> For verification of JWT tokens
- POST || /api/login -> For login
- POST || /api/register -> For sign-up
- GET || /api/nyt-best-seller -> Getting the list of Week's NYT bestseller from NYT API
- GET || /api/users -> Getting list of all users with all their info
- GET || /api/books/:BookId -> Getting info about a single book
- GET || /api/user/activities -> Getting info about the users activity used in some chart in website
- GET || /api/user -> Getting all info about the user
- PATCH || /api/user -> Change some info about the user
- PATCH || /api/user/password -> Change only password of the user
- GET || /api/user/books/genres -> Getting the list of all the books genre the user read
- GET || /api/user/:userId -> Getting all information about some user
- GET || /api/user/books -> Getting the list of all the book the user has on shelf
- POST || /api/user/books -> Creating a book for the user on shelf
- DELETE || /api/user/books -> Delete a book of the user from shelf
- PATCH || /api/user/books/:bookId -> Edit some info about a specific book for the user
- POST || /api/user/friends -> Add friend request from the user
- DELETE || /api/user/friends -> Remove friend request from the user
- POST || /api/user/friends/accept -> Accept the pending friend request
- POST || /api/user/friends/reject -> Reject the pending friend request
1. Clone the repo
$ git clone https://github.com/NB071/DigiBookShelf_API
2. Navigate to the project's folder
$ cd DigiBookShelf_API
3. Install dep packages
$ npm i
4. Edit .env-sample with db url api keys and ...
SERVER_URL= <URL:LOCALHOST>
LOCAL_ADDRESS= <USED_FOR_PRODUCTION:0.0.0.0>
PORT= <PORT>
DB_HOST= <DB_URL>
DB_LOCAL_USER= <DB_USER>
DB_LOCAL_PASSWORD= <DB_PASSWORD>
DB_LOCAL_DBNAME=digibookshelf
NYT_API_KEY= <NYT_API_KEY>
JWT_SIGN_KEY= <RANDOM_JWT_KEY>
5. Migration of the db
$ npm run migrate
6. Seeding the db
$ npm run seed
7. Run
$ npm start
[+] Should you see images are not shown
Edit all seed files and end-points that are using ${process.env.SERVER_URL}
to -> ${process.env.SERVER_URL}:${process.env.SERVER_PORT}
[-] Rolling back
$ npm run rollback
1. Fork the repository.
2. Create a new branch: git checkout -b feature-name
3. Make your changes.
4. Commit your changes: git commit -m 'Add some feature'
5. Push to the branch: git push origin feature-name
6. Submit a pull request
Technologies used in the project:
- Node.js / Express.js
- Knex.js / MySQL
- Socket-io