How rahul-ghadge/spring-boot-mongodb-crud works
This is a Spring Boot REST example for MongoDB CRUD and employee lookups. The main workflow is an HTTP request reaching a domain controller and, for documented Super Hero CRUD, passing through its service and repository to MongoDB. Employee lookups are split between repository-style endpoints and Mongo-query endpoints. The README also documents startup seeding and Mongo connection configuration. Source excerpts were not provided, so edges are limited to relationships stated in the README; employee service and DAO wiring is not asserted.
Main entry points: SpringBootMongoDBApplication.java Spring Boot app · SuperHeroController.java Hero controller · SuperHeroServiceImpl.java Hero service · SuperHeroRepository.java Hero repository
Components 17
Application runtime
- Spring Boot app
src/main/java/com/spring/mongo/demo/SpringBootMongoDBApplication.java - CORS filter
src/main/java/com/spring/mongo/demo/config/CORSFilter.java - Database config
src/main/java/com/spring/mongo/demo/config/DatabaseConfiguration.java - Seed data helper
src/main/java/com/spring/mongo/demo/utils/HelperUtil.java
Super Hero CRUD
- Hero controller
src/main/java/com/spring/mongo/demo/controller/SuperHeroController.java - Hero service
src/main/java/com/spring/mongo/demo/service/impl/SuperHeroServiceImpl.java - Hero repository
src/main/java/com/spring/mongo/demo/repository/SuperHeroRepository.java - Hero model
src/main/java/com/spring/mongo/demo/model/SuperHero.java
Employee lookups
- Employee API
src/main/java/com/spring/mongo/demo/controller/EmployeeController.java - Employee query API
src/main/java/com/spring/mongo/demo/controller/EmployeeQueryController.java - Employee services
src/main/java/com/spring/mongo/demo/service - Employee query DAO
src/main/java/com/spring/mongo/demo/repository/impl/EmployeeQueryDaoImpl.java - Employee repository
src/main/java/com/spring/mongo/demo/repository/EmployeeRepository.java - Employee model
src/main/java/com/spring/mongo/demo/model/Employee.java
Mongo persistence
- MongoDB
- Mongo properties
src/main/resources/application.properties
Other components
- REST client
Connections 11
- REST client → Hero controller: sends CRUD requests
README.md - REST client → Employee API: requests lookups
README.md - REST client → Employee query API: requests queries
README.md - Hero controller → Hero service: delegates CRUD
README.md - Hero service → Hero repository: uses repository
README.md - Hero repository → MongoDB: performs CRUD
README.md - Spring Boot app → Seed data helper: seeds on startup
README.md - Spring Boot app → MongoDB: enables repositories
README.md - Mongo properties → Database config: configures connection
README.md - Employee API → Employee model: exposes employee lookups
README.md - Employee query API → Employee model: queries employees
README.md