{"id":20960137,"url":"https://github.com/jungnoh/nice-backend","last_synced_at":"2025-08-12T22:40:31.179Z","repository":{"id":44033075,"uuid":"225538998","full_name":"jungnoh/nice-backend","owner":"jungnoh","description":"a nice backend","archived":false,"fork":false,"pushed_at":"2023-01-24T00:54:28.000Z","size":581,"stargazers_count":5,"open_issues_count":20,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-30T00:04:38.991Z","etag":null,"topics":["architecture","backend","express"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jungnoh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-12-03T05:34:34.000Z","updated_at":"2020-09-29T02:14:12.000Z","dependencies_parsed_at":"2023-02-13T07:01:01.879Z","dependency_job_id":null,"html_url":"https://github.com/jungnoh/nice-backend","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jungnoh/nice-backend","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungnoh%2Fnice-backend","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungnoh%2Fnice-backend/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungnoh%2Fnice-backend/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungnoh%2Fnice-backend/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jungnoh","download_url":"https://codeload.github.com/jungnoh/nice-backend/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jungnoh%2Fnice-backend/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270148460,"owners_count":24535700,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["architecture","backend","express"],"created_at":"2024-11-19T01:57:43.006Z","updated_at":"2025-08-12T22:40:31.126Z","avatar_url":"https://github.com/jungnoh.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nice-backend\n\nNode.JS 백엔드 프로젝트의 시작부터 배포까지 필요한 요소를 모두 담은 프로젝트 뼈대입니다.\n\n# What's inside\n- Mongodb with mongoose\n- Basic passport.js implementation (`passport-local`)\n- HTTPS support\n- TSLint with pre-commit hooks\n- Swagger, TSDoc documentations\n- Minimal E2E testing with jest\n- (todo) GraphQL querying\n\n# 처음 시작하기\n1. config 설정\n다음과 같은 형태로 DB 접속정보를 설정하세요.\nDevelopment, production config는 각각 `config/config.dev.json`, `config/config.prod.json`에 저장됩니다.\n```json\n{\n  \"mongodb\": {\n    \"url\": \"mongodb://localhost:27017/dev\",\n    \"user\": \"admin\",\n    \"pass\": \"123\"\n  }\n}\n```\n세션 키 (`sessionSecret`)는 설정하지 마십시오! 적절한 키 길이로 런타임에 설정됩니다.\n\n# Notes\n\n## HTTPS support\n- HTTPS is only active in production mode (edit www.dev.ts to change this).\n- Add your certificate (`server.key`, `server.crt`) under `./sslcert`\n\n## REST structure\n\n![REST 구조](rest-structure.png)\n\n_[이미지 출처](https://www.coreycleary.me/project-structure-for-an-express-rest-api-when-there-is-no-standard-way/)_\n\n### 1. 라우터 (/routes)\nHTTP 요청을 받아 컨트롤러로 넘기기 전 유효성 확인, 권한 확인 수행\n- 잘못된 요청이 들어올 경우 `400`, 권한이 없을 경우 `403` 반환\n- Swagger 문서는 여기에 작성함\n### 2. 컨트롤러 (/controllers)\nHTTP 요청을 처리하는 단계\n- `req`, `res`를 인자로 받아 적절한 결과 반환\n- 서비스를 이용해 요청을 수행하고, JSON 형태로 결과를 보내는 역할\n- **DB 작업은 컨트롤러에서 하지 않으며**, 데이터를 다루는 로직은 서비스에서 수행\n### 3. 서비스 (/services)\n실제 로직을 수행하는 단계\n- 서비스는 HTTP `req`, `res`에 접근할 수 없음: 서버와 무관하게 동작해야 함\n- 데이터베이스 접근은 이 단계에서 이루어짐\n\n\u003c!-- ## Express 타입\nPassport.js에 의해 로그인된 후 Express request에 사용자 객체 (`User`)가 포함됩니다.\nRequest 타입에 이를 반영하기 위해 `src/express.d.ts`에서 타입 정의를 확장합니다. --\u003e\n\n\n\n# 주요 라이브러리\n프로젝트를 시작하기 전 이용방법을 숙지하시길 바립니다.\n- [Mongoose](https://mongoosejs.com/) ⭐️\n- [PassportJS](http://www.passportjs.org/) ⭐️\n- [express-validator](https://express-validator.github.io/docs/): 요청 유효성 확인에 사용\n\n# 관련 문서\n- https://blog.wonhada.com/nginx-sslhttps-node-js/\n- https://dev.to/rxassim/setup-postgresql-with-typeorm-in-graphql-tutorial-1cn8","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjungnoh%2Fnice-backend","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjungnoh%2Fnice-backend","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjungnoh%2Fnice-backend/lists"}