MongoDB Crud practice using Spring Boot, Thymeleaf and Bootstrap
MongoDB setting instructions for Mac Users:
- Install MongoDB using Homebrew: brew install mongodb-community
- Start mongo service: services start mongodb-community
- Check if the new mongodb process was created: sudo lsof -i tcp:27017 or ps aux | grep -v grep | grep mongod
- Install robomongo https://robomongo.org/
- Create a new database with the name insurance and new collection members
Starting the app
- Import the project as maven project in eclipse
- Start the mongoDB services. If you don't that first you will get errors trying to inject dependencies during the compilation time.
- Resolve the dependencies using maven command: mvn -X clean install
- Check if the database configuration is ok in application.properties
- run the command ./mvnw spring-boot:run for starting the application.
Heroku Deploy - Cloud
- Enter in Heroku dashboar: https://dashboard.heroku.com/
- Associate this github project
- Enter in Resources and search by mLab MongoDB
To connect using the mongo shell: mongo ds031329.mlab.com:31329/heroku_6kq54m6n -u -p To connect using a driver via the standard MongoDB URI (what's this?): mongodb://:@ds031329.mlab.com:31329/heroku_6kq54m6n
-
Create a new DB user and password
-
Modify the file application.properties in this github project adding the user and password