Skip to content

Commit 0e759ec

Browse files
chore: update README with local dev setup instructions
Signed-off-by: K Siva Prasad Reddy <[email protected]>
1 parent 9535396 commit 0e759ec

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,77 @@ We will build a BookStore application using Spring Boot, Spring Cloud, and Docke
5252
* Install Java 21. Recommend using [SDKMAN](https://sdkman.io/) for [managing Java versions](https://youtu.be/ZywEiw3EO8A).
5353
* Install [Docker Desktop](https://www.docker.com/products/docker-desktop/)
5454
* Install [IntelliJ IDEA](https://www.jetbrains.com/idea) or any of your favorite IDE
55+
* Install [Taskfile](https://taskfile.dev/) utility
5556
* Install [Postman](https://www.postman.com/) or any REST Client
5657

58+
```shell
59+
$ curl -s "https://get.sdkman.io" | bash
60+
$ source "$HOME/.sdkman/bin/sdkman-init.sh"
61+
$ sdk install java 24.0.1-tem
62+
$ sdk install maven
63+
$ brew install go-task
64+
(or)
65+
$ go install github.com/go-task/task/v3/cmd/task@latest
66+
67+
```
68+
69+
Verify the prerequisites
70+
71+
```shell
72+
$ java -version
73+
$ docker info
74+
$ docker compose version
75+
$ task --version
76+
```
77+
78+
### How to run the application locally?
79+
80+
```shell
81+
# Clone the repository:
82+
$ git clone https://github.com/sivaprasadreddy/spring-boot-microservices-course.git
83+
$ cd spring-boot-microservices-course
84+
```
85+
86+
#### Option 1: Start the infra components using Docker Compose and run microservices from IDE
87+
88+
1. **Start all the required services such as PostgreSQL, RabbitMQ, Keycloak, etc.:** `$ task start_infra`
89+
90+
2. **Start individual microservices:**
91+
You can start individual microservices by running their respective main entrypoint classes from IDE: `ApiGatewayApplication`, `CatalogServiceApplication`, `OrderServiceApplication`, `NotificationServiceApplication`, `BookstoreWebappApplication`
92+
93+
3. **Access the application** at http://localhost:8080
94+
95+
* Catalog Service PostgreSQL DB: `jdbc:postgresql://localhost:15432/postgres` with credentials `postgres/postgres`
96+
* Order Service PostgreSQL DB: `jdbc:postgresql://localhost:25433/postgres` with credentials `postgres/postgres`
97+
* RabbitMQ: `http://localhost:15672` with credentials `guest/guest`
98+
* Keycloak: `http://localhost:9191` with credentials `admin/admin1234`
99+
* MailHog: `http://localhost:8025`
100+
101+
#### Option 2: Working on individual microservices
102+
103+
Each microservice has Testcontainers based configuration to start the required services such as PostgreSQL, RabbitMQ, Keycloak, etc automatically.
104+
105+
You can start individual microservices by running their respective Test main entrypoint classes from IDE: `TestCatalogServiceApplication`, `TestOrderServiceApplication`, `TestNotificationServiceApplication`, `ApiGatewayApplication`, `BookstoreWebappApplication`.
106+
107+
#### Option 3: Run all the infra components and applications using Docker Compose
108+
109+
1. **Start all:** `$ task start`
110+
111+
2. **Access the application** at http://localhost:8080
112+
113+
114+
## Run the application with Observability Stack
115+
116+
1. Start Grafana, Tempo, Loki, Prometheus using `$ task start_monitoring`
117+
2. Set `MANAGEMENT_TRACING_ENABLED=true` in `deployment/docker-compose/.env` file
118+
3. Restart the application using `$ task restart`
119+
120+
Now you can access the observability stack using the following URLs:
121+
122+
* Access Grafana at http://localhost:3000
123+
* Access Prometheus at http://localhost:9090
124+
125+
57126
## Other Learning Resources
58127
* [SivaLabs Blog](https://sivalabs.in)
59128
* [Spring Boot Tutorials](https://www.sivalabs.in/spring-boot-tutorials/)

0 commit comments

Comments
 (0)