Skip to content

Commit bb6f64d

Browse files
committed
fix: readme cleanup, setup output for cloudshell
1 parent dc14f6b commit bb6f64d

File tree

2 files changed

+41
-29
lines changed

2 files changed

+41
-29
lines changed

README.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,73 +4,74 @@
44

55
## Introduction
66

7-
### This project is used by the Google Cloud Platform team to demonstrate different services within Google Cloud. This project contains two versions of the same application, one architected as a monolith and the other as a set of microservices.
7+
### This project is used by the Google Cloud Platform team to demonstrate different services within Google Cloud. This project contains two versions of the same application, one architected as a monolith and the other as a set of microservices
88

99
## Setup
1010

11-
```
11+
### NOTE: Make sure you have a newer version of NodeJS (16.13.0) or newer
12+
13+
```bash
1214
git clone https://github.com/googlecodelabs/monolith-to-microservices
1315
cd monolith-to-microservices
1416
./setup.sh
1517
```
1618

1719
## Monolith
1820

19-
#### To run the monolith project use the following commands from the top level directory:
21+
### To run the monolith project use the following commands from the top level directory
2022

21-
```
23+
```bash
2224
cd monolith
2325
npm start
2426
```
2527

26-
#### You should see output similar to the following:
28+
You should see output similar to the following
2729

28-
```
30+
```text
2931
Monolith listening on port 8080!
3032
```
3133

32-
#### That's it! You now have a perfectly functioning monolith running on your machine!
34+
#### That's it! You now have a perfectly functioning monolith running on your machine
3335

34-
### Docker
36+
### Docker - Monolith
3537

36-
#### To create a Docker image for the monolith, execute the following commands:
38+
#### To create a Docker image for the monolith, execute the following commands
3739

38-
```
40+
```bash
3941
cd monolith
4042
docker build -t monolith:1.0.0 .
4143
```
4244

43-
#### To run the Docker image, execute the following commands:
45+
To run the Docker image, execute the following commands
4446

45-
```
47+
```bash
4648
docker run --rm -p 8080:8080 monolith:1.0.0
4749
```
4850

49-
5051
## Microservices
5152

52-
### To run the microservices project use the following commands from the top level directory:
53+
### To run the microservices project use the following commands from the top level directory
5354

54-
```
55+
```bash
5556
cd microservices
5657
npm start
5758
```
5859

59-
### You should see output similar to the following:
60+
You should see output similar to the following
6061

61-
```
62+
```text
6263
[0] Frontend microservice listening on port 8080!
6364
[2] Orders microservice listening on port 8081!
6465
[1] Products microservice listening on port 8082!
6566
```
6667

67-
### That's it! You now have a perfectly functioning set of microservices running on your machine!
68+
### That's it! You now have a perfectly functioning set of microservices running on your machine
6869

69-
### Docker
70+
### Docker - Microservices
7071

71-
#### To create a Docker image for the mmicroservices, you will have to create a Docker image for each service. Execute the following commands for each folder under the microservices folder.
72+
### To create a Docker image for the microservices, you will have to create a Docker image for each service. Execute the following commands for each folder under the microservices folder
7273

73-
```
74+
```bash
7475
cd microservices/src/frontend
7576
docker build -t frontend:1.0.0 .
7677

@@ -81,17 +82,17 @@ cd ../orders
8182
docker build -t orders:1.0.0 .
8283
```
8384

84-
#### To run the Docker image, execute the following commands:
85+
To run the Docker image, execute the following commands
8586

86-
```
87+
```bash
8788
docker run -d --rm -p 8080:8080 monolith:1.0.0
8889
docker run -d --rm -p 8081:8081 orders:1.0.0
8990
docker run -d --rm -p 8082:8082 products:1.0.0
9091
```
9192

92-
#### To stop the containers, you will need to find the CONTAINER ID for each and stop them individually. See the steps below:
93+
#### To stop the containers, you will need to find the CONTAINER ID for each and stop them individually. See the steps below
9394

94-
```
95+
```bash
9596
docker ps -a
9697

9798
CONTAINER ID IMAGE COMMAND CREATED
@@ -104,13 +105,12 @@ docker stop d7886598dbe2
104105
docker stop d85756f57265
105106
```
106107

107-
108108
## React App
109109

110-
#### The react-app folder contains a React application created from `create-react-app`. You can modify this fronted, but afterwards, you will need to build and move the static files to the monolith and microservices project. You can do this by running the standard create-react-app build command below:
110+
### The react-app folder contains a React application created from `create-react-app`. You can modify this fronted, but afterwards, you will need to build and move the static files to the monolith and microservices project. You can do this by running the standard create-react-app build command below
111111

112-
```
112+
```bash
113113
npm run build
114114
```
115115

116-
#### This will run the build script to create the static files two times. The first will build with relative URLs and copy the static files to the monolith/public folder. The second run will build with the standard microservices URLs and copy the static files to the microservices/src/frontned/public folder.
116+
#### This will run the build script to create the static files two times. The first will build with relative URLs and copy the static files to the monolith/public folder. The second run will build with the standard microservices URLs and copy the static files to the microservices/src/frontend/public folder

setup.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,15 @@ npm run build
5353
printf "Completed.\n\n"
5454

5555
printf "Setup completed successfully!\n"
56+
57+
if [[ -v CLOUD_SHELL ]]
58+
then
59+
printf "###############################################################################\n"
60+
printf "# NOTICE #\n"
61+
printf "# #\n"
62+
printf "# Make sure you have a compatible nodeJS version with the following command: #\n"
63+
printf "# #\n"
64+
printf "# nvm install --lts #\n"
65+
printf "# #\n"
66+
printf "###############################################################################\n"
67+
fi

0 commit comments

Comments
 (0)