Skip to content

Commit 61f5a76

Browse files
committed
adjust readme
1 parent b4bd6ea commit 61f5a76

File tree

1 file changed

+36
-20
lines changed

1 file changed

+36
-20
lines changed

README.md

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,10 @@ project-name
6262
Clone this repo to your local machine
6363

6464
```
65-
git clone https://github.com/nadavpodjarski/postgres-express-react-typescript-boilerplate.git <YOUR-PROJECT-NAME>
65+
git clone https://github.com/nadavpodjarski/postgres-express-react-typescript-boilerplate.git project-name
6666
```
6767

68-
run the following command to check this demo
68+
Run the following command to check this demo
6969

7070
```
7171
cd project-name/ && sudo docker-compose --file docker-compose-dev.yml up
@@ -75,20 +75,29 @@ cd project-name/ && sudo docker-compose --file docker-compose-dev.yml up
7575

7676
## Client
7777

78-
Client has been created with create-react-app and located in ./project-name/client
79-
In develpoment mode it will be run in a container built with ./client/Dockerfile.dev and will be exposed on port 3000.
80-
In production mode a client build will be created and will run in a container built with ./client/Dockerfile the client build/static-files and will be served with nginx server and will be exposed on port 80.
78+
Client has been created with create-react-app and located in `./project-name/client`
8179

82-
Enviornment variables can be moved into running dockerfile itself under ENV or can be decalred in the docker compose file under enviornemt property
80+
#### Development
81+
82+
In develpoment mode cleient will be run in a container built with `./client/Dockerfile.dev` and will be exposed on port 3000, with docker volumes every on save change will be reflected within the running container.
83+
84+
#### Production
85+
86+
In production mode a client build will be created and will run in a container built with `./client/Dockerfile`.
87+
The client build/static-files will be served with nginx server and will be exposed on port 80.
88+
89+
#### Environment Variables
90+
91+
Enviornment variables are located in `./client/.env` but can be declared into the dockerfile itself under ENV or in the docker compose file under enviornemt property
8392

8493
**note that nginx server has a minimalistic configuration**
8594

86-
## Database
95+
## Data-base
8796

8897
Postgres data-base is created with an official postgres image which can be found in docker hub https://hub.docker.com/_/postgres
8998
the data-base will be initialized with ./database/initdb.sql script. feel free to change it to your own needs.
9099

91-
Enviornment variables will be located in ./database/.env
100+
Enviornment variables will be located in `./database/.env`
92101
and will contain our database credentials :
93102

94103
```
@@ -97,25 +106,32 @@ POSTGRES_PASSWORD=admin
97106
POSTGRES_DB=pern_db
98107
```
99108

100-
Volumes of our database will be located in ./database/data
109+
Volumes of our database will be located in `./database/data`
101110

102-
> Production volume is located in ./data/prod
103-
> </br>
104-
> Development volume is located in ./data/dev
111+
> Production volume is located in `./data/prod` > </br>
112+
> Development volume is located in `./data/dev`
105113
106114
## Server
107115

108116
Server is located in ./projec-name/server using express.
109117

110-
- In development mode it will run in a container built with ./server/Dockerfile.dev.
111-
dev mode server will be exposed on port 5500 to the "outside" world and will use volumes for data persistent.
112-
- In Production mode it will run in a container built with ./server/Dockerfile.
113-
prod mode server will be exposed on port 5500 only to the docker composer internal services. as well using volumes for data persistent.
118+
#### Development
119+
120+
In development mode it will run in a container built with `./server/Dockerfile.dev`.
121+
dev mode server will be exposed on port 5500 to the "outside" world and will use volumes for data persistent.
122+
123+
#### Production
124+
125+
In production mode the server will run in a container built with `./server/Dockerfile`.
126+
and be exposed on port 5500 only to the docker composer internal services within the same network.
127+
in our case server and client are on the same network "webapp" , hence only the client can communicate with the server.
128+
129+
#### Environment
114130

115131
Enviornment variables will be located in ./server/.env
116-
and will contain postgres credentials to establish connection to our databse.
117-
with our wait-for-it.sh script the server image will run only after getting confirmation that postgres container is available.
118-
by that we wont get connection failures due to wrong order of docker composing.
132+
and will contain postgres credentials to establish connection to our data-base.
133+
Thanks to https://github.com/vishnubob/wait-for-it for the wait-for-it.sh script, we can set that the server image will run only after getting confirmation that postgres container is available.
134+
by that we wont get connection failures due to bad order of docker composing.
119135

120136
## Docker compose
121137

@@ -142,7 +158,7 @@ This will creates build for both server and client, will serve client build with
142158

143159
## Demo
144160

145-
Demo is a simple Todolist using react as our front express as backend and postgres as our database
161+
Demo is a simple Todolist using React and Material-UI on client side, express on backend and postgres as our database
146162
demo can be started in development mode and in production mode as well.
147163

148164
<img src="./demo1.png" style="box-shadow 0px 10px 10px rgba(0,0,0,0.3);" />

0 commit comments

Comments
 (0)