{"id":15407989,"url":"https://github.com/danilqa/nest-js-registry-starter","last_synced_at":"2026-04-17T10:03:39.011Z","repository":{"id":165855578,"uuid":"347619968","full_name":"Danilqa/nest-js-registry-starter","owner":"Danilqa","description":"Simple CRUD-repository based on Nest.js and mongo. Includes e2e specs.","archived":false,"fork":false,"pushed_at":"2021-11-07T13:20:46.000Z","size":196,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-02T03:44:29.514Z","etag":null,"topics":["api","crud","mongodb","nestjs","starter","typescript"],"latest_commit_sha":null,"homepage":"","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/Danilqa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-14T11:38:35.000Z","updated_at":"2021-11-05T10:42:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"bce28442-5eed-4a4a-88b6-45acf8f11361","html_url":"https://github.com/Danilqa/nest-js-registry-starter","commit_stats":{"total_commits":4,"total_committers":1,"mean_commits":4.0,"dds":0.0,"last_synced_commit":"206e82d802364e3b895c9d710f717253ad3ab9ba"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danilqa%2Fnest-js-registry-starter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danilqa%2Fnest-js-registry-starter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danilqa%2Fnest-js-registry-starter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Danilqa%2Fnest-js-registry-starter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Danilqa","download_url":"https://codeload.github.com/Danilqa/nest-js-registry-starter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245956935,"owners_count":20700182,"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","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":["api","crud","mongodb","nestjs","starter","typescript"],"created_at":"2024-10-01T16:30:30.344Z","updated_at":"2025-11-01T09:02:34.416Z","avatar_url":"https://github.com/Danilqa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nThe service stores participants and provides methods to manipulate them.\n\n# API\n\n## Overview\n\n| Method                    | Description             | Code |\n| ------------------------- |:-----------------------:| ----:|\n| POST /participants        | Create a participant    | 201  |\n| GET /participants         | Get all participants    | 200  |\n| GET /participants/:id     | Get some participant    | 200  |\n| PATCH /participants/:id   | Update some participant | 200  |\n| DELETE /participants/:id  | Delete a participant    | 200  |\n\n## Model\n\n### Participant\n\n| Field                     | Type                    |\n| ------------------------- |:-----------------------:|\n| id                        | string                  |\n| name                      | string                  |\n| birthdate                 | Date                    |\n| phoneNumber               | string                  |\n| address                   | string                  |\n\nSample\n```json\n{\n    \"name\": \"Harry Potter\",\n    \"birthdate\": \"2011-08-12\",\n    \"phoneNumber\": \"+44 141 243 2640\",\n    \"address\": \"44 Howard Street Merchant City, Glasgow G1 4EE Scotland\"\n}\n```\n\n# Start\n\n1. Install [Docker](https://www.docker.com/) if you don't have it yet\n2. Run mongo database: `docker-compose up -d`\n3. Install `yarn` package manager if you don't have it yet:\n    ```\n    npm install --global yarn\n    ```\n   or any other alternative ways which are located on \n   [yarn's official page](https://classic.yarnpkg.com/en/docs/install/#mac-stable).\n4. Install Nest.js client globally:\n    ```\n    yarn global add @nestjs/cli\n    ```\n5. Install all dependencies: `yarn install`  \n6. Run app in the dev. mode: `yarn start:dev`. The app will start on `localhost:3000`.\n\n# Testing\n\nCurrent code-coverage: 95.89%\\\nRun tests: `yarn test`\n\n# Design choices and trade-offs\n\n1. Used NoSQL db instead of SQL-like:\n    - We don't need complicated relational queries\n    - Easier and faster in a testing (in particular, for this environment)\n    - However, we have one drawback: we don't have types such as date without time, and we can't\n    add additional restrictions like max. length of a property.\n\n2. Model:\n    - `id` in the required scenario should be able to support something like this: \"KD-123\"\n    - `name` obviously should be a string\n    - `birthdate` is represented as Date. It restricts incorrect input but contains time and timezone. \n    - `phone number` is a string. Because it's usually written in different ways (with -, space, pluses, etc.)\n    - `address` - the same as previous\n\n3. Database credentials:\n    - Used default `admin` database in order to increase development speed. Not production decision.\n\n4. Unique numbers allocator service should be replaced by a dedicated one. At the current moment, used just \na temporary one (without easy-to-use identifiers).\n    \n# Why do we have these dependencies?\n\n* `@nestjs/common` - application framework and related packages for Node.js.\n* `@nestjs/core` - *\n* `@nestjs/mongoose` - *\n* `@nestjs/platform-express` - *\n* `mongoose` - provides schema models for interacting with MongoDB.\n* `reflect-metadata` - provides the opportunity to use decorators.\n\n# Why do we have these dev dependencies?\n\n* `@nestjs/testing` - provides infrastructure to work test nestjs.\n* `@eigenspace/codestyle` - includes lint rules, config for typescript.\n* `@eigenspace/common-types` - includes common types.\n* `@eigenspace/commit-linter` - linter for commit messages.\n* `eslint-plugin-eigenspace-script` - includes set of script linting rules and configuration for them.\n* `@types/*` - contains type definitions for specific library.\n* `jest` - testing framework to write unit specs (including snapshots).\n* `ts-jest` - it lets you use Jest to test projects written in TypeScript.\n* `typescript` - is a superset of JavaScript that have static type-checking and ECMAScript features.\n    We need 3.8.x+ version because of `Promise.allSettled`.\n* `husky` - used for configure git hooks.\n* `lint-staged` - used for configure linters against staged git files.\n* `cross-env` - used for switching environments between mocks and dev.\n* `eslint` - it checks code for readability, maintainability, and functionality errors.\n* `nodemon` - starts server with auto update.\n* `ts-node` - to run without build typescript.\n* `ts-jest` - it lets you use Jest to test projects written in TypeScript.\n* `jest` - testing framework to write unit specs (including snapshots).\n* `ts-loader` - it's used to load typescript code with webpack.\n* `supertest` - provides comfortable API to test services.\n* `mongodb-memory-server` - used for running mongodb during tests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilqa%2Fnest-js-registry-starter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanilqa%2Fnest-js-registry-starter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanilqa%2Fnest-js-registry-starter/lists"}