Skip to content

Commit 195fc98

Browse files
committed
Merge branch 'develop'
2 parents 91067bf + 2ba3ffb commit 195fc98

335 files changed

Lines changed: 12689 additions & 575 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# mongodb configuration
2+
MONGODB_USER=root
3+
MONGODB_PASSWORD=123456
4+
MONGODB_DATABASE=db
5+
6+
# mongodb service ports
7+
MONGODB_DOCKER_PORT=27017 # 도커 내부에서 사용하는 포트
8+
MONGODB_LOCAL_PORT=7017 # 도커 외부에서 접근하는 포트
9+
10+
# backend service ports
11+
NODE_DOCKER_PORT=3000 # 도커 내부에서 사용하는 포트
12+
NODE_LOCAL_PORT=3000 # 도커 외부에서 접근하는 포트
13+
14+
# backend secret keys
15+
JWT_SECRET_KEY=MY_SECRET_KEY
16+
PASSWORD_HASH_KEY=secret12341234
17+
18+
API_BASE_URL=http://back:3000
19+
20+
# frontend service ports
21+
REACT_DOCKER_PORT=8080 # 도커 내부에서 사용하는 포트
22+
REACT_LOCAL_PORT=8080 # 도커 외부에서 접근하는 포트
23+
24+
# algolia api keys
25+
ALGOLIA_APP_ID=N23UT1MSN6
26+
ALGOLIA_ADMIN_API_KEY=e199f37cf05f87d3550d7c5ba02ba5ab
27+
ALGOLIA_INDEX_NAME=dev_Handover_items
28+
29+
CLIENT_ORIGIN=http://front:8080

.eslintrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"env": {
3+
"browser": true,
4+
"es2021": true
5+
},
6+
"extends": ["plugin:react/recommended", "airbnb"],
7+
"parser": "@typescript-eslint/parser",
8+
"parserOptions": {
9+
"ecmaFeatures": {
10+
"jsx": true
11+
},
12+
"ecmaVersion": 12,
13+
"sourceType": "module"
14+
},
15+
"plugins": ["react", "@typescript-eslint"],
16+
"rules": {}
17+
}

.github/workflows/main.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Workflow to pull latest commits from develop branch and serve with Docker containers via SSH
2+
3+
name: CI
4+
5+
# Controls when the workflow will run
6+
on:
7+
# Triggers the workflow on push events but only for the develop branch
8+
push:
9+
branches: [develop]
10+
11+
# Allows you to run this workflow manually from the Actions tab
12+
workflow_dispatch:
13+
14+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
15+
jobs:
16+
# This workflow contains a single job called "build"
17+
build:
18+
name: Build & Deploy
19+
# The type of runner that the job will run on
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
- name: Executing remote ssh commands
24+
# Uses ssh-action. Check https://github.com/marketplace/actions/ssh-remote-commands for more
25+
uses: appleboy/ssh-action@master
26+
with:
27+
host: ${{ secrets.HOST }}
28+
username: ${{ secrets.USERNAME }}
29+
password: ${{ secrets.PASSWORD }}
30+
port: ${{ secrets.PORT }}
31+
script_stop: true # Stop script after first failure
32+
script: cd ~/workspace/handover && /bin/sh ./scripts/deploy.sh

.gitignore

Lines changed: 171 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,173 @@
1+
# mongodb Data
2+
docker-config/mongodb/
3+
4+
# From https://github.com/djizco/mern-boilerplate/blob/master/.gitignore
5+
6+
# Dependency Modules
7+
node_modules
8+
9+
# App Packaged
10+
dist/
11+
build/
12+
*.zip
13+
14+
# NPM
15+
.npm
16+
package-lock.json
17+
yarn.lock
18+
19+
# Test
20+
coverage
21+
22+
# Logs
23+
logs
24+
*.log
25+
npm-debug.log*
26+
yarn-debug.log*
27+
yarn-error.log*
28+
29+
# Patches
30+
patches/
31+
32+
# OSX
33+
.DS_Store
34+
35+
# Created by https://www.toptal.com/developers/gitignore/api/react,node
36+
# Edit at https://www.toptal.com/developers/gitignore?templates=react,node
37+
38+
### Node ###
39+
# Logs
40+
logs
41+
*.log
42+
npm-debug.log*
43+
yarn-debug.log*
44+
yarn-error.log*
45+
lerna-debug.log*
46+
.pnpm-debug.log*
47+
48+
# Diagnostic reports (https://nodejs.org/api/report.html)
49+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
50+
51+
# Runtime data
52+
pids
53+
*.pid
54+
*.seed
55+
*.pid.lock
56+
57+
# Directory for instrumented libs generated by jscoverage/JSCover
58+
lib-cov
59+
60+
# Coverage directory used by tools like istanbul
61+
coverage
62+
*.lcov
63+
64+
# nyc test coverage
65+
.nyc_output
66+
67+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
68+
.grunt
69+
70+
# Bower dependency directory (https://bower.io/)
71+
bower_components
72+
73+
# node-waf configuration
74+
.lock-wscript
75+
76+
# Compiled binary addons (https://nodejs.org/api/addons.html)
77+
build/Release
78+
79+
# Dependency directories
80+
node_modules/
81+
jspm_packages/
82+
83+
# Snowpack dependency directory (https://snowpack.dev/)
84+
web_modules/
85+
86+
# TypeScript cache
87+
*.tsbuildinfo
88+
89+
# Optional npm cache directory
90+
.npm
91+
92+
# Optional eslint cache
93+
.eslintcache
94+
95+
# Microbundle cache
96+
.rpt2_cache/
97+
.rts2_cache_cjs/
98+
.rts2_cache_es/
99+
.rts2_cache_umd/
100+
101+
# Optional REPL history
102+
.node_repl_history
103+
104+
# Output of 'npm pack'
105+
*.tgz
106+
107+
# Yarn Integrity file
108+
.yarn-integrity
109+
110+
# dotenv environment variables file
1111
.env
112+
# .env.test
113+
# .env.production
114+
115+
# parcel-bundler cache (https://parceljs.org/)
116+
.cache
117+
.parcel-cache
118+
119+
# Next.js build output
120+
.next
121+
out
122+
123+
# Nuxt.js build / generate output
124+
.nuxt
125+
dist
126+
127+
# Gatsby files
128+
.cache/
129+
# Comment in the public line in if your project uses Gatsby and not Next.js
130+
# https://nextjs.org/blog/next-9-1#public-directory-support
131+
# public
132+
133+
# vuepress build output
134+
.vuepress/dist
135+
136+
# Serverless directories
137+
.serverless/
138+
139+
# FuseBox cache
140+
.fusebox/
141+
142+
# DynamoDB Local files
143+
.dynamodb/
144+
145+
# TernJS port file
146+
.tern-port
147+
148+
# Stores VSCode versions used for testing VSCode extensions
149+
.vscode-test
150+
151+
# yarn v2
152+
.yarn/cache
153+
.yarn/unplugged
154+
.yarn/build-state.yml
155+
.yarn/install-state.gz
156+
.pnp.*
157+
158+
### react ###
159+
.DS_*
160+
**/*.backup.*
161+
**/*.back.*
162+
163+
node_modules
164+
165+
*.sublime*
166+
167+
psd
168+
thumb
169+
sketch
170+
./frontend/eslintrc.js
171+
./frontend/package.json
2172

3-
./backend/node_modules
173+
# End of https://www.toptal.com/developers/gitignore/api/react,node

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["eamodio.gitlens"]
3+
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Handover
2+
23
![Logo](https://logosbynick.com/wp-content/uploads/2018/03/final-logo-example.png)
34

45
프로젝트명 또는 프로젝트 로고 이미지 **(택1)**

backend/.dockerignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
node_modules
2+
.dockerignore
3+
Dockerfile
4+
Dockerfile.dev

backend/Dockerfile

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,24 @@
1-
FROM node:12
1+
FROM node:14-alpine AS builder
22

3-
WORKDIR /backend
4-
COPY . .
3+
# Create node_modules directory
4+
WORKDIR /app
55

6+
# Install app dependencies
7+
# This will only run when the package.json is changed
8+
COPY package.json .
69
RUN npm install
7-
# RUN npm install -g pm2
8-
RUN npm install -g mongoose
9-
RUN npm install -g nodemon
10-
CMD ["npm", "start"]
11-
# CMD ["pm2", "start", "app.js", "--watch"]
1210

13-
# "start": "nodemon --watch . app.js"
11+
FROM node:14-alpine
12+
13+
# Copy node_modules from previous stage image
14+
RUN mkdir -p /node_modules
15+
COPY --from=builder /app/node_modules /app/node_modules
16+
17+
# Create app directory
18+
WORKDIR /app/backend
19+
20+
# Bundle app source
21+
COPY . .
22+
23+
# Create symlink to /backend/node_modules and start node app
24+
CMD ln -sf /app/node_modules /app/backend/node_modules && npm start

backend/Dockerfile.dev

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM node:14-alpine AS builder
2+
3+
# Create node_modules directory
4+
WORKDIR /app
5+
6+
# Install app dependencies
7+
# This will only run when the package.json is changed
8+
COPY package.json .
9+
RUN npm install
10+
11+
FROM node:14-alpine
12+
13+
# Copy node_modules from previous stage image
14+
RUN mkdir -p /node_modules
15+
COPY --from=builder /app/node_modules /app/node_modules
16+
17+
# Create app directory
18+
WORKDIR /app/backend
19+
20+
# Bundle app source
21+
COPY . .
22+
23+
# Create symlink to /backend/node_modules and start node app
24+
CMD ln -sf /app/node_modules /app/backend/node_modules && npm start

0 commit comments

Comments
 (0)