A JAVA RestFUL API built with spring boot, Spring Web and Core Annotations, Maven Built Tool, MongoDB Cloud Data Storage and MongoDB Data Persistence.
This project is just a sample to show how to use Java Spring Boot with MongoDB for Rest API consumption.
After Clone this project. You will need to register an account with MongoBD Atlas, acquire your connection key for database settings and make connections either through MongoDB Compass, or Locally by installing mongodb on your machine to connect. It's pretty simply. This link may be helpful
Install and launch the MongoDB database here.
For other systems with package management, such as Redhat, Ubuntu, Debian, CentOS, and Windows, see the instructions at https://docs.mongodb.org/manual/installation/.
After you install MongoDB, you can launch it in a console window by running the following command (which also starts up a server process):
- Download MogoDB locally(Mongo Shell or Compass) and register a MongoDB account
- Bootstrap with Spring Initializr https://start.spring.io/
- Select build tool maven or gradle.
- Add Dependencies Spring-starter-Web, spring-boot-starter-data-mongodb
- Create an Entity Class
- Create a Repository Interface (MongoRepository)--- Not JPARepository
- Create a RestController
- Create a YAML File to configure your MongoDB connection
Note: Can use lombok, CORS, or Log4J to make your App more robust and flexible.