Skip to content

Commit c032968

Browse files
authored
Merge pull request #18 from modern-agile-team/develop
Update localhost to each deployed host address, and then Change the host address string to ENVIRONMENT_VARIABLE.
2 parents 914b616 + 6b556a3 commit c032968

File tree

11 files changed

+80
-101
lines changed

11 files changed

+80
-101
lines changed

README.md

Lines changed: 59 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# create-dev-portfolio
2+
23
![docker-badge](https://img.shields.io/badge/Docker-red)
34
![docker-compose-badge](https://img.shields.io/badge/Docker_Compose-red)
45
![type-script-badge](https://img.shields.io/badge/TypeScript-blue)
@@ -10,39 +11,39 @@ If you want to check the dev-portfolio library, please refer to the following li
1011

1112
![ezgif com-gif-maker](https://user-images.githubusercontent.com/56839474/194718430-5404fa1f-c24b-48a0-8730-15db2d3bde00.gif)
1213

13-
1414
## List
15-
* <a href="recommended-systems">Recommended systems</a>
16-
* <a href="run">Run</a>
17-
* <a href="exit">Exit</a>
18-
* <a href="tip">Tip</a>
19-
* <a href="swagger-api">Swagger API</a>
20-
* <a href="refers">Refers</a>
21-
* <a href="license">License</a>
22-
* <a href="contributor">Contributor</a>
23-
* <a href="Infra-Structure">Infra Structure</a>
24-
* <a href="Database-ERD">Database ERD</a>
25-
* <a href="example">Example</a>
2615

16+
- <a href="recommended-systems">Recommended systems</a>
17+
- <a href="run">Run</a>
18+
- <a href="exit">Exit</a>
19+
- <a href="deploy">Deploy</a>
20+
- <a href="tip">Tip</a>
21+
- <a href="refers">Refers</a>
22+
- <a href="swagger-api">Swagger API</a>
23+
- <a href="Infra-Structure">Infra Structure</a>
24+
- <a href="Database-ERD">Database ERD</a>
25+
- <a href="example">Example</a>
26+
- <a href="license">License</a>
27+
- <a href="contributor">Contributor</a>
2728

2829
## Recommended systems
2930

3031
**Operating System**: Linux & MacOS
31-
> Windows is also available, but bash terminal is recommended, and the following tools must be operated based on bash.
32+
33+
> Windows is also available, but bash terminal is recommended, and the following tools must be operated based on bash.
3234
3335
**Tools**
36+
3437
1. recommended: **Bash terminal**
3538
2. required: **Docker** & **Docker-compose**
36-
3. **node**`v14.20.1`
37-
* Using nvm, you can easily change the node version. Please refer to the following: [NVM](https://www.notion.so/NVM-53c04d5c8837480e8601e6bd39abc62a#6db02c02a5c549cbaaa7884cac709a9e)
39+
- Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
40+
> If **mac** and **windows** have **docker desktop** installed, **docker compose** is also installed, so there is no need to install it separately.
41+
1. Click [here](https://docs.docker.com/get-docker/) to install Docker.
42+
2. Click [here](https://docs.docker.com/compose/install/) to install Docker Compose.
43+
3. **node**`v14.20.1`
44+
- Using nvm, you can easily change the node version. Please refer to the following: [NVM](https://www.notion.so/NVM-53c04d5c8837480e8601e6bd39abc62a#6db02c02a5c549cbaaa7884cac709a9e)
3845
4. **npm**`v6.14.17`
3946

40-
- Install [Docker](https://docs.docker.com/get-docker/) and [Docker Compose](https://docs.docker.com/compose/install/).
41-
> If **mac** and **windows** have **docker desktop** installed, **docker compose** is also installed, so there is no need to install it separately.
42-
1. Click [here](https://docs.docker.com/get-docker/) to install Docker.
43-
2. Click [here](https://docs.docker.com/compose/install/) to install Docker Compose.
44-
45-
4647
## Run
4748

4849
1. Install this repo.
@@ -52,7 +53,7 @@ If you want to check the dev-portfolio library, please refer to the following li
5253
$ npx create-dev-portfolio <YOUR_APP_NAME>
5354
```
5455

55-
2. Run ```dev-portfolio``` by daemon.
56+
2. Run `dev-portfolio` by daemon.
5657

5758
```bash
5859
# If you want to run both the client and the server, enter the command below.
@@ -80,51 +81,43 @@ $ npm run exit:server
8081

8182
## Deploy
8283

84+
Please note that **only [client-app](https://github.com/modern-agile-team/create-dev-portfolio/tree/master/client/app) are deployed** except for [server-app](https://github.com/modern-agile-team/create-dev-portfolio/tree/master/server) on [Vercel](https://vercel.com/). If you want to deploy the server code, you have to deploy it directly using the cloud provided by AWS, GCP, Oracle, etc.
85+
The deploying guide will be released soon, so please look forward to it.
86+
8387
```bash
84-
# After complete client code, then enter the command below.
85-
# If you enter this, client will be deployed with vercel automatically.
88+
# If you enter the command below, the deploy will proceed automatically to the web page where new URL is registered on Vercel.
8689
$ npm run deploy:client
8790
```
8891

89-
[vercel](https://vercel.com/)
92+
## Tip
9093

94+
1. **If you want to customize your client.
95+
Check to README.md in [dev-portfolio](https://github.com/modern-agile-team/dev-portfolio).**
96+
please go to the link below!
9197

92-
## Tip
93-
1. **If you want to customize your client.
94-
Check to README.md in [dev-portfolio](https://github.com/modern-agile-team/dev-portfolio).**
95-
please go to the link below!
98+
https://github.com/modern-agile-team/dev-portfolio/blob/master/README.md
9699

97-
https://github.com/modern-agile-team/dev-portfolio/blob/master/README.md
100+
2. **If you want to change environment variables such as PORT, DB.
101+
Customize files called `.*.env`.**
102+
By default, it works normally without modification.
98103

99-
2. **If you want to change environment variables such as PORT, DB.
100-
Customize files called ```.*.env```.**
101-
By default, it works normally without modification.
102-
```bash
103-
# Move to dev-portfolio folder.
104+
````bash # Move to dev-portfolio folder.
104105
$ cd dev-portfolio
105106

106-
# Customize the .*.env file as you.
107-
$ vi ./config/.client.env
108-
$ vi ./config/.server.env
109-
```
110-
107+
# Customize the .*.env file as you.
108+
$ vi ./config/.client.env
109+
$ vi ./config/.server.env
110+
```
111+
````
111112

112113
## Refers
113114

114-
### License
115-
[MIT](https://github.com/modern-agile-team/create-dev-portfolio/blob/master/LICENSE)
116-
117-
### Contributor
118-
- [seohyunsim](https://github.com/seohyunsim)
119-
- [soonki-98](https://github.com/soonki-98)
120-
- [jisu3817](https://github.com/jisu3817)
121-
- [woorim960](https://github.com/woorim960)
122-
123115
### Swagger API
124-
<img width="1450" alt="스크린샷 2022-09-12 오후 9 14 15" src="https://user-images.githubusercontent.com/56839474/189650561-5ba9c467-b52c-48e6-b3e7-30813954e12d.png">
116+
117+
<img width="1450" alt="스크린샷 2022-09-12 오후 9 14 15" src="https://user-images.githubusercontent.com/56839474/189650561-5ba9c467-b52c-48e6-b3e7-30813954e12d.png">
125118

126119
You can view server apis very easily by using the Swagger documentation.
127-
To use the swagger, the ```dev-portfolio``` server must be in a working state.
120+
To use the swagger, the `dev-portfolio` server must be in a working state.
128121

129122
If the server is up, go to the link below.
130123

@@ -133,6 +126,7 @@ http://localhost:<YOUR_SERVER_PORT>/swagger
133126
```
134127

135128
### Infra Structure
129+
136130
<img width="1028" alt="스크린샷 2022-09-15 오후 9 48 37" src="https://user-images.githubusercontent.com/79014269/193828681-5d198fd9-9006-4713-a69b-ce576c58b442.png">
137131

138132
### Database ERD
@@ -147,7 +141,7 @@ http://localhost:<YOUR_SERVER_PORT>/swagger
147141

148142
<br>
149143

150-
2. <[woorim960](https://github.com/woorim960/woorim-personal-website)>
144+
2. <[woorim960](https://github.com/woorim960/woorim-personal-website)> http://152.70.89.184
151145

152146
![ezgif com-gif-maker (1)](https://user-images.githubusercontent.com/56839474/194719475-1cc2469e-7b7b-4ef0-8f87-236fa3aefbe1.gif)
153147

@@ -156,3 +150,16 @@ http://localhost:<YOUR_SERVER_PORT>/swagger
156150
3. <[seohyunsim](https://github.com/seohyunsim/seohyunsim-portfolio)> https://seohyunsim-portfolio.vercel.app/
157151

158152
<img width="1000" alt="스크린샷 2022-09-12 오후 8 52 52" src="https://user-images.githubusercontent.com/56839474/189646646-7faf4842-e881-42bc-bcb9-422975adac95.png">
153+
154+
<br>
155+
156+
## License
157+
158+
[MIT](https://github.com/modern-agile-team/create-dev-portfolio/blob/master/LICENSE)
159+
160+
## Contributor
161+
162+
- [seohyunsim](https://github.com/seohyunsim)
163+
- [soonki-98](https://github.com/soonki-98)
164+
- [jisu3817](https://github.com/jisu3817)
165+
- [woorim960](https://github.com/woorim960)

client/README.md

Lines changed: 0 additions & 20 deletions
This file was deleted.

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/README.md

Lines changed: 0 additions & 23 deletions
This file was deleted.

server/app/main.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ dotenv.config({ path: '../../config/.server.env' });
99

1010
const app = express();
1111
const PORT = process.env.PORT || 8000;
12+
const HOST_ADDRESS = process.env.HOST_ADDRESS || 'localhost'
1213

1314
const swaggerSpec = YAML.load(path.join(__dirname, './swagger.yaml'));
1415
const portInjectedSwaggerSpec = JSON.stringify(swaggerSpec).replace(
1516
'{PORT}',
1617
PORT.toString()
17-
);
18+
).replace('{HOST_ADDRESS}', HOST_ADDRESS);
1819

1920
import visitor from './src/apis/visitor';
2021

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/app/swagger.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ info:
44
title: 'dev-portfolio API'
55
description: 'dev-portfolio API'
66
servers:
7-
- url: http://localhost:{PORT}/
7+
- url: http://{HOST_ADDRESS}:{PORT}/
88
paths:
99
/apis/visitor/count:
1010
patch:

0 commit comments

Comments
 (0)