Skip to content

Commit

Permalink
Merge pull request #4 from Nexters/feature/mongo
Browse files Browse the repository at this point in the history
Feature/mongo
  • Loading branch information
minkj1992 authored Jan 14, 2021
2 parents fb88021 + 652e761 commit 6dc0705
Show file tree
Hide file tree
Showing 19 changed files with 507 additions and 73 deletions.
44 changes: 36 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
- [3. 프로젝트 세팅](#3-프로젝트-세팅)
- [4. 프로젝트 구조](#4-프로젝트-구조)
- [5. Playground](#5-playground)
- [6. API](#6-api)
- [7. LINKS](#7-links)
- [6. infrastructure](#6-infrastructure)
- [7. API](#7-api)
- [8. LINKS](#8-links)
- [9. SCHEMA of GraphQL API](#9-schema-of-graphql-api)

<!-- /TOC -->

Expand Down Expand Up @@ -76,7 +78,11 @@ npm i @nestjs/graphql graphql-tools graphql apollo-server-express
# https://dev.to/kop7/how-to-build-autocomplete-search-with-nestjs-elasticsearch-and-vue-12h8
npm i dotenv


# cache
# https://github.com/BryanDonovan/node-cache-manager#store-engines
npm install cache-manager
# https://github.com/v4l3r10/node-cache-manager-mongodb
npm install cache-manager-mongodb --save
```

## 3. 프로젝트 세팅
Expand Down Expand Up @@ -134,7 +140,7 @@ $ npm run start:dev
# open http://[::1]:8000/graphql
```

- 지역검색 query 예시 [// API 스키마 전체 ⬇](#SCHEMA-of-GraphQL-API)
- 지역검색 query 예시 [// API 스키마 전체 ⬇](#SCHEMA-of-GraphQL-API)
- **sort를 distance로 하게되면 x,y는 필수로 넣어주어야 합니다.**

```
Expand All @@ -151,9 +157,31 @@ $ npm run start:dev
y
}
}
mutation {
createSpot(createSpotInput: {
_id: "1890778114"
place_name: "연돈"
x:126.40716457908
y:33.2588962209144
}){
_id
place_name
x
y
}
}
```

## 6. infrastructure

- 로컬 mongodb 세팅

```bash
docker run --name mongo -p 0.0.0.0:27017:27017 -d mongo
```

## 6. API
## 7. API

- 카카오
- [지역 REST api](https://developers.kakao.com/docs/latest/ko/local/dev-guide#search-by-keyword)
Expand All @@ -167,7 +195,7 @@ $ npm run start:dev
- [길찾기 api](https://apidocs.ncloud.com/ko/ai-naver/maps_directions/)
- 주의사항으로 jdk 제공 되지 않는 듯하다.

## 7. LINKS
## 8. LINKS

- [이슈: 네이버 지도에 네이버 검색 결과를 같이 띄울 수 없을까?](https://github.com/navermaps/maps.js/issues/193)
- [configService 의존성 주입](https://dev.to/kop7/how-to-build-autocomplete-search-with-nestjs-elasticsearch-and-vue-12h8)
Expand All @@ -176,7 +204,7 @@ $ npm run start:dev

<br/>

### SCHEMA of GraphQL API
## 9. SCHEMA of GraphQL API

```
directive @specifiedBy(url: String!) on SCALAR
Expand Down Expand Up @@ -215,4 +243,4 @@ enum SortType {
distance
accuracy
}
```
```
10 changes: 10 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#App
NODE_ENV=dev
NODE_PORT=8000

KAKAO_DEV_HOST=https://dapi.kakao.com/v2/local/search/keyword.json
KAKAO_DEV_REST_API_KEY=
KAKAO_DEV_JDK=

KAKAO_API_MAP_HOST=https://map.kakao.com
KAKAO_API_SEARCH=/link/search
149 changes: 105 additions & 44 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,23 @@
"@nestjs/core": "^7.5.1",
"@nestjs/graphql": "^7.9.4",
"@nestjs/mapped-types": "^0.1.1",
"@nestjs/mongoose": "^7.2.1",
"@nestjs/mongoose": "^7.0.2",
"@nestjs/platform-express": "^7.5.1",
"apollo-server-express": "^2.19.1",
"cache-manager": "^3.4.0",
"cache-manager-mongodb": "^0.3.0",
"class-transformer": "^0.3.1",
"class-validator": "^0.12.2",
"dotenv": "^8.2.0",
"graphql": "^15.4.0",
"graphql-tools": "^7.0.2",
"mongoose": "^5.11.11",
"mongoose": "^5.10.19",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^6.6.3"
},
"devDependencies": {
"@apollo/client": "^3.2.9",
"@nestjs/cli": "^7.5.1",
"@nestjs/schematics": "^7.1.3",
"@nestjs/testing": "^7.5.1",
Expand Down
Loading

0 comments on commit 6dc0705

Please sign in to comment.