Skip to content

Commit 5cd24d8

Browse files
authored
Merge pull request #17 from modern-agile-team/feature/pwr/#16
Update localhost to each deployed host address, and then Change the host address string to ENVIRONMENT_VARIABLE.
2 parents e42d1a6 + 679617f commit 5cd24d8

File tree

7 files changed

+40
-12
lines changed

7 files changed

+40
-12
lines changed

README.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,11 @@ If you want to check the dev-portfolio library, please refer to the following li
2020
* <a href="refers">Refers</a>
2121
* <a href="license">License</a>
2222
* <a href="contributor">Contributor</a>
23+
* <a href="Infra-Structure">Infra Structure</a>
24+
* <a href="Database-ERD">Database ERD</a>
2325
* <a href="example">Example</a>
2426

27+
2528
## Recommended systems
2629

2730
**Operating System**: Linux & MacOS
@@ -39,6 +42,7 @@ If you want to check the dev-portfolio library, please refer to the following li
3942
1. Click [here](https://docs.docker.com/get-docker/) to install Docker.
4043
2. Click [here](https://docs.docker.com/compose/install/) to install Docker Compose.
4144

45+
4246
## Run
4347

4448
1. Install this repo.
@@ -74,7 +78,16 @@ $ npm run exit:client
7478
$ npm run exit:server
7579
```
7680

77-
---
81+
## Deploy
82+
83+
```bash
84+
# After complete client code, then enter the command below.
85+
# If you enter this, client will be deployed with vercel automatically.
86+
$ npm run deploy:client
87+
```
88+
89+
[vercel](https://vercel.com/)
90+
7891

7992
## Tip
8093
1. **If you want to customize your client.
@@ -95,21 +108,18 @@ By default, it works normally without modification.
95108
$ vi ./config/.server.env
96109
```
97110

98-
## License
99111

100-
[MIT](https://github.com/modern-agile-team/create-dev-portfolio/blob/master/LICENSE)
112+
## Refers
101113

102-
## Contributor
114+
### License
115+
[MIT](https://github.com/modern-agile-team/create-dev-portfolio/blob/master/LICENSE)
103116

117+
### Contributor
104118
- [seohyunsim](https://github.com/seohyunsim)
105119
- [soonki-98](https://github.com/soonki-98)
106120
- [jisu3817](https://github.com/jisu3817)
107121
- [woorim960](https://github.com/woorim960)
108122

109-
---
110-
111-
## Refers
112-
113123
### Swagger API
114124
<img width="1450" alt="스크린샷 2022-09-12 오후 9 14 15" src="https://user-images.githubusercontent.com/56839474/189650561-5ba9c467-b52c-48e6-b3e7-30813954e12d.png">
115125

@@ -125,6 +135,10 @@ http://localhost:<YOUR_SERVER_PORT>/swagger
125135
### Infra Structure
126136
<img width="1028" alt="스크린샷 2022-09-15 오후 9 48 37" src="https://user-images.githubusercontent.com/79014269/193828681-5d198fd9-9006-4713-a69b-ce576c58b442.png">
127137

138+
### Database ERD
139+
140+
<img width="539" alt="스크린샷 2022-10-12 오전 12 33 55" src="https://user-images.githubusercontent.com/79014269/195138130-56656777-4440-426d-a88e-67c029cf5175.png">
141+
128142
### Example
129143

130144
1. <[dev-portfolio-app](https://github.com/modern-agile-team/dev-portfolio-app)> https://dev-portfolio-app.vercel.app/

client/app/src/apis/instance.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { REACT_APP_HOST_ADDRESS, REACT_APP_SERVER_PORT } = process.env;
2+
13
export class HTTP {
24
private domain: string = "";
35

@@ -40,6 +42,8 @@ export class HTTP {
4042
}
4143
}
4244

43-
const instance = new HTTP("http://localhost:8000");
45+
const instance = new HTTP(
46+
`http://${REACT_APP_HOST_ADDRESS}:${REACT_APP_SERVER_PORT}`
47+
);
4448

4549
export default instance;

config/.client.env

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
PORT="5005"
1+
# Client port number to open this react-app.
2+
PORT=3000
3+
4+
# Enter the same value as the PORT environment variable written in .server.env.
5+
REACT_APP_SERVER_PORT=8000
6+
7+
# Put the IP or host address of the computer you are using.
8+
REACT_APP_HOST_ADDRESS="localhost"

config/.server.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# NodeJS
22
PORT=8000
3+
HOST_ADDRESS="localhost" # Put the IP or host address of the computer you are using.
34

45
# for accessing from Nodejs to MySQL
56
DB_HOST="db"

server/.db/etc/my.cnf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
# http://dev.mysql.com/doc/refman/5.7/en/server-configuration-defaults.html
33

44
[mysqld]
5+
max_connections=1000
6+
57
#
68
# Remove leading # and set to the amount of RAM for the most im`port`ant data
79
# cache in MySQL. Start at 70% of total RAM for dedicated server, else 10%.

server/app/src/config/db.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const config = {
77
password: process.env.DB_PSWORD,
88
database: process.env.DB_DATABASE,
99
port: Number(process.env.DB_PORT),
10-
connectionLimit: 10,
10+
connectionLimit: 1000,
1111
};
1212

1313
const mysqlPool = mysql.createPool(config);

server/dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:14.5.0
1+
FROM node:14.20.1
22

33
WORKDIR /usr/app
44

0 commit comments

Comments
 (0)