Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ravening/bookrentalsystem

Web application to manage the book renting system
https://github.com/ravening/bookrentalsystem

goodreads-api google-books-api jackson java-8 jaxb maven mongodb restful-webservices spring-boot-2

Last synced: 22 days ago
JSON representation

Web application to manage the book renting system

Awesome Lists containing this project

README

        

This is a web application to manage the book rental system
where people can rent out their own books or rent books from
other people.

Prerequisites to run the project

Java, maven, mongodb, Intellij/Eclipse

Steps to run the project

1. Checkout the repository to your local directory

2. Make sure that mongodb is installed in your system and is up and running

3. If security is enabled to login to mongodb, then enter those credentials in src/main/resources/application.properties file

4. Uncomment the mongodb.user and other configuration and enter the proper values. Also enter the proper ip address of mongodb host

5. Run the project using "./mvnw spring-boot:run"

6. The application uses JWT for authentication and authorization in the backend.

7. To test the api calls create a dummy user in the database under "user" collection

or you can create new user using below command

curl -H "Content-Type: application/json" -X POST -d '{
"firstname": "",
"lastname": "",
"username": "",
"password": "",
"phone": "",
"enabled": "true"
}' http://localhost:8080/api/v1/user/signup

8. Now try to login using the below command

curl -i -H "Content-Type: application/json" -X POST -d '{
"username": "admin",
"password": "password"
}' http://localhost:8080/login

9. Now test the data by passing the JWT token to any of the get requests from postman

10. Sample endpoint is /api/v1/books/listall

11. To list all the endpoints navigate to "http://localhost:8080/swagger-ui.html#/books-controller"

For more information related to JWT, refer

https://auth0.com/blog/implementing-jwt-authentication-on-spring-boot/