spring-boot-microservices/
│
├── users/
│ ├── src/
│ ├── pom.xml (or build.gradle)
│ └── application.properties
│
├── experience/
│ ├── src/
│ ├── pom.xml (or build.gradle)
│ └── application.properties
│
├── projects/
│ ├── src/
│ ├── pom.xml (or build.gradle)
│ └── application.properties
│
├── reviews/
│ ├── src/
│ ├── pom.xml (or build.gradle)
│ └── application.properties
│
├── services/
│ ├── src/
│ ├── pom.xml (or build.gradle)
│ └── application.properties
│
├── skills/
│ ├── src/
│ ├── pom.xml (or build.gradle)
│ └── application.properties
│
Spring Boot application featuring full CRUD operations with seamless PostgreSQL integration. Postman-tested and ready to go! 🚀
List of software and tools which you need to get started
-
Java JDK 17
-
IntelliJ IDEA (Community Edition)
-
Gradle
-
Xcode Command Line Tools
(for install) --> xcode-select --install (for verify) --> xcode-select -p
-
Homebrew
(for install) --> /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" (for verify) --> brew --version (if issue set PATH) --> (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/waxif/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)"
-
PostgreSQL
(for install) --> brew install postgresql
-
Start the PostgreSQL service:
brew services start postgresql
-
Verify that PostgreSQL is running by checking its status:
brew services list
-
Switch to the default postgres user:
psql postgres
-
Create a new databases for each module:
CREATE DATABASE userdb; CREATE DATABASE projectsdb; CREATE DATABASE skillsdb; CREATE DATABASE reviewsdb; CREATE DATABASE experiencedb; CREATE DATABASE servicesdb;
-
Create a new user:
CREATE USER your_username WITH PASSWORD 'your_password';
-
Grant all privileges on all the databases to the user:
GRANT ALL PRIVILEGES ON DATABASE your_database_name TO your_username;
-
To check if the spring boot application process is running or not you can use this command :
lsof -i :8080
-
To Kill the process you can use this command by passing process id which mention above screenshot as PID:
kill -9 <PID>
User module -> MainUser class Experience module -> MainExperience class Projects module -> MainProjects class Reviews module -> MainReviews class Services module -> MainServices class Skills module -> MainSkills class
-
Once all the services are running. Then you can check the following api URL in Postman.
GET -> http://localhost:8081/api/users/{user_id} POST -> http://localhost:8081/api/users Param -> Body -> raw -> JSON { //Required fields "name": "Name", "email": "[email protected]" }
GET -> http://localhost:8080/api/experience/users/{user_id} POST -> http://localhost:8080/api/experience/users/{user_id} Param -> Body -> raw -> JSON { //Required fields "employer": "test1", "start_date": "12/11/2023", "end_date": "12/11/2023" }
GET -> http://localhost:8082/api/projects POST -> http://localhost:8082/api/projects/users/{user_id} Param -> Body -> raw -> JSON { //Required fields "name": "test", "start_date": "12/11/2023", "end_date": "12/11/2023" }
GET -> http://localhost:8083/api/reviews POST -> http://localhost:8083/api/reviews/users/{user_id} Param -> Body -> raw -> JSON { //Required fields "name": "test", "start_date": "12/11/2023", "end_date": "12/11/2023" }
GET -> http://localhost:8084/api/services POST -> http://localhost:8084/api/services/users/{user_id} Param -> Body -> raw -> JSON { //Required fields "name": "test", "start_date": "12/11/2023", "end_date": "12/11/2023" }
GET -> http://localhost:8085/api/skills POST -> http://localhost:8085/api/skills/users/{user_id} Param -> Body -> raw -> JSON { //Required fields "name": "test", "start_date": "12/11/2023", "end_date": "12/11/2023" }
NOTE: If you notice all microservices have different PORTS, so its very important to use the correct port to get the expected result.
- You can get the
POSTMAN
file fromProjectCv -> postman -> postman_collection.json
Wasif Mujahid - @LinkedIn - [email protected]
If you need more details, here are my few articles where i explained everything step by step.