A Java and mongoDB based RESTful API for storing and managing library information, including the data of the libraries, members, staff and all books.
You can find the whole documentation with the endpoints here.
- Create a mongoDB database with four collections:
📦libraryDB
┣ 📂 libraries
┣ 📂 staff
┣ 📂 members
┗ 📂 books
- Personalise and add this documentum into "staff" (after deploying with these credentials you will be able to make requests):
{
"userName": "",
"password": "",
"userRoles": [
{
"role": {
"name": "ADMIN"
}
}
],
"name": "",
"emailAddress": "",
"libraryId": "",
"_class": "com.csrlnd.LibraryAPI.Model.Staff"
}
- Clone this git repository.
git clone https://github.com/rolandcsosz/Library-API.git
- Change Directory
cd Library-API
Add values to connection variables by editing the application.properties
file in the project:
spring.data.mongodb.host=
spring.data.mongodb.port=
spring.data.mongodb.authentication-database=
spring.data.mongodb.username=
spring.data.mongodb.password=
spring.data.mongodb.database=
host
- Name/ip adress of the hostport
- The portmongodb.authentication-database
- The database for authenticationusername
- The usernamepassword
- The passworddatabase
- The database
- Build the project and create a runnable jar file:
mvn package
- Run the solution:
java -jar target/Library-API-1.0.0-SNAPSHOT.jar com.rolandcsosz.LibraryAPI.Main
-
Copyright (©) 2022 by Csősz Roland
-
Licensed under the terms of the GNU GENERAL PUBLIC LICENSE Version 2, June 1991