Skip to content

Commit

Permalink
Merge pull request #2 from NewWays-TechForImpactKAIST/feat/project-se…
Browse files Browse the repository at this point in the history
…tting
  • Loading branch information
withSang authored Nov 8, 2023
2 parents aead9dd + 555efd8 commit 22e5d88
Show file tree
Hide file tree
Showing 20 changed files with 738 additions and 211 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
MONGO_CONNECTION_URI=mongodb://localhost:27017
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@ web_modules/

# dotenv environment variable files
.env
.env.development
.env.development.local
.env.test.local
.env.production
.env.production.local
.env.local

Expand Down
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.18.0
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
dist
node_modules/
pnpm-lock.yaml
package.json
*.md
11 changes: 11 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"trailingComma": "all",
"tabWidth": 2,
"semi": true,
"singleQuote": false,
"jsxSingleQuote": false,
"bracketSpacing": true,
"arrowParens": "avoid",
"quoteProps": "consistent",
"bracketSameLine": false
}
45 changes: 38 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,48 @@
# 다양성 평가 리포트 웹사이트 백엔드

## 개발환경
## 프로젝트 소개
- 사용 기술: Node.js(TypeScript + Express.js), MongoDB

Express.js, Node.js, MongoDB, TypeScript
## 프로젝트 구조
```
src
├── index.ts # 서버 시작 코드
├── config.ts # 환경변수 설정
├── controllers # 서비스 로직
│   ├── scrapResult.ts
│   ├── (...)
├── db # Mongoose 모델
│   ├── model.ts # 모델 정의, MongoDB 연결
│   └── schema.ts # 스키마 정의
├── middlewares # 각종 미들웨어
│   ├── index.ts
│   ├── (...)
├── routes # 라우팅 로직
│   ├── index.ts
│   ├── scrapResult.ts
│   ├── (...)
└── utils # 각종 헬퍼 함수
└── diversity.ts # 다양성 지표 계산
```

## 개발환경 설정

### 1. 의존성 설치 (Node.js >= 18.0.0 사용)
```bash
pnpm install
```

현재 프로젝트 초기 구조 세팅 중
### 2. 환경변수 설정

TODO : MongoDB 연동, 절대 경로 설정
.env.development 파일을 만들고, MongoDB URI를 입력합니다.
```bash
cp .env.example .env.development
code .env.development
```

## 실행
### 3. 실행

```bash
pnpm install
pnpm run start
pnpm start
```

9 changes: 8 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,26 @@
"description": "",
"main": "index.js",
"scripts": {
"start": "tsc && tsc-alias && node dist/index.js"
"start": "concurrently \"npx tsc -w\" \"tsc-alias -w \" \"nodemon ./dist/index.js\"",
"build": "tsc && tsc-alias",
"prod": "cross-env NODE_ENV=production node dist/index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"cors": "^2.8.5",
"cross-env": "^7.0.3",
"dotenv": "^16.3.1",
"express": "^4.18.2",
"mongoose": "^7.6.3"
},
"devDependencies": {
"@types/cors": "^2.8.15",
"@types/express": "^4.17.19",
"@types/node": "^20.8.4",
"concurrently": "^8.2.2",
"nodemon": "^3.0.1",
"tsc-alias": "^1.8.8",
"typescript": "^5.2.2"
}
Expand Down
Loading

0 comments on commit 22e5d88

Please sign in to comment.