Skip to content

Commit

Permalink
Merge pull request #59 from boostcampwm-2021/dev
Browse files Browse the repository at this point in the history
[v0.0.1] 2주차 스프린트 개발 후 merge/배포
  • Loading branch information
dlckdduq1107 authored Nov 8, 2021
2 parents 0aab936 + 7021788 commit 2184856
Show file tree
Hide file tree
Showing 40 changed files with 11,053 additions and 626 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
**/node_modules
18 changes: 12 additions & 6 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
{
"parser": "@typescript-eslint/parser",
"overrides": [
{
"files": ["**/*.ts", "**/*.tsx"],
"rules": {
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": ["error"]
},
"parser": "@typescript-eslint/parser",
"extends": ["plugin:@typescript-eslint/recommended"]
}
],
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"extends": [
"airbnb",
"plugin:prettier/recommended",
"plugin:@typescript-eslint/recommended"
]
"extends": ["airbnb", "plugin:prettier/recommended"]
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ web_modules/
.env
.env.test
.env.production
.env.development

# parcel-bundler cache (https://parceljs.org/)
.cache
Expand Down
7 changes: 7 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/sh

test "" = "$(sed -n -E -e '/^#/d' -e '/^([a-z]+): /,1p' "$1")" && {
echo >&2 '메시지는 반드시 "<type>: "으로 시작해야 합니다'
exit 1
}
:
5 changes: 2 additions & 3 deletions .husky/prepare-commit-msg
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ if [ "$COMMIT_SOURCE" = "commit" ]; then
NR==${TITLE_LINENO} { printf \"$(git show -s --format=%s $SHA1)\" }
NR==${BODY_LINENO} { printf \"$(git show -s --format=%b $SHA1)\" }
{ print }" "$TEMPLATE_FILE" > "$COMMIT_MSG_FILE"

elif [ -z "$COMMIT_SOURCE" ]; then
elif [ "$COMMIT_SOURCE" = "template" ] || [ -z "$COMMIT_SOURCE" ]; then
# 원본 메시지 파일 백업
mv "$COMMIT_MSG_FILE" "$COMMIT_MSG_FILE.bak"
# 덮어쓰기
cat "$TEMPLATE_FILE" > "$COMMIT_MSG_FILE"
fi
fi
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM node:14.17.3

WORKDIR /usr/src/app

COPY package.json ./
RUN yarn install
COPY ["package.json", "yarn.lock", "."]
COPY lerna.json .
COPY packages/ packages/

RUN yarn --frozen-lockfile
RUN yarn bootstrap

RUN apt-get update
RUN apt-get -yq install nginx

COPY nginx.conf /etc/nginx/nginx.conf

COPY . .
RUN yarn build:frontend

EXPOSE 80
EXPOSE 3000

CMD ["yarn", "start"]
CMD ["sh", "-c", "nginx -g 'daemon on;' && yarn start:backend"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

### 배포링크

- 빈칸
http://dev.canyoufix.me/

### 😃 팀 소개
**팀명** : 경기사천왕 - 경기도 내 동서남북를 지배하는 4명의 개발자들
Expand Down
5 changes: 5 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"version": "0.0.0",
"npmClient": "yarn",
"useWorkspaces": true
}
118 changes: 118 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# SSL Settings
##

ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
#include /etc/nginx/sites-enabled/*;

server {
listen 80 default_server;
#listen [::]:80 default_server;

# SSL configuration
#
# listen 443 ssl default_server;
# listen [::]:443 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

#root /var/www/html;
root /usr/src/app/packages/frontend/build;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html;

server_name _;

location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ =404;
}

# pass PHP scripts to FastCGI server
#
#location ~ \.php$ {
# include snippets/fastcgi-php.conf;
#
# # With php-fpm (or other unix sockets):
# fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
# # With php-cgi (or other tcp sockets):
# fastcgi_pass 127.0.0.1:9000;
#}

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
}

17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
{
"name": "web04-canyoufixme",
"name": "@cyfm/monorepo",
"version": "0.0.0",
"main": "index.js",
"repository": "https://github.com/boostcampwm-2021/web04-canyoufixme.git",
"license": "MIT",
"private": true,
"scripts": {
"prepare": "husky install",
"start": "ts-node src/app.ts"
"bootstrap": "lerna bootstrap",
"postinstall": "yarn bootstrap",
"build:frontend": "yarn workspace @cyfm/frontend build",
"start:frontend": "yarn workspace @cyfm/frontend start",
"start:backend": "yarn workspace @cyfm/backend start"
},
"dependencies": {
"express": "^4.17.1",
Expand All @@ -32,6 +35,7 @@
"husky": "^7.0.4",
"install-peerdeps": "^3.0.3",
"jest": "26.6.0",
"lerna": "^4.0.0",
"lint-staged": ">=10",
"prettier": "^2.4.1",
"sass": "^1.43.4",
Expand All @@ -43,9 +47,12 @@
"yarn": "1.22.x"
},
"lint-staged": {
"*.{js,ts}": [
"*.{js,jsx,ts,tsx}": [
"prettier --write",
"eslint --cache --fix"
]
}
},
"workspaces": [
"packages/*"
]
}
1 change: 1 addition & 0 deletions packages/backend/.env.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ORIGIN_URL=
18 changes: 18 additions & 0 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@cyfm/backend",
"version": "0.0.0",
"scripts": {
"start": "ts-node -r dotenv/config src/app.ts dotenv_config_path=.env.development",
"build": "exit 1"
},
"dependencies": {
"dotenv": "^10.0.0",
"express": "^4.17.1",
"ts-node": "^10.4.0"
},
"devDependencies": {
"@types/express": "^4.17.13",
"@types/node": "^16.11.6",
"typescript": "^4.4.4"
}
}
Loading

0 comments on commit 2184856

Please sign in to comment.