{"id":28565362,"url":"https://github.com/syniol/nestjs-skeleton","last_synced_at":"2025-06-10T14:15:02.610Z","repository":{"id":297684460,"uuid":"997584437","full_name":"syniol/nestjs-skeleton","owner":"syniol","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-06T19:53:02.000Z","size":100,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-06T20:55:47.072Z","etag":null,"topics":[],"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/syniol.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,"zenodo":null}},"created_at":"2025-06-06T19:27:07.000Z","updated_at":"2025-06-06T19:53:03.000Z","dependencies_parsed_at":"2025-06-06T21:06:20.210Z","dependency_job_id":null,"html_url":"https://github.com/syniol/nestjs-skeleton","commit_stats":null,"previous_names":["syniol/nestjs-skeleton"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syniol%2Fnestjs-skeleton","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syniol%2Fnestjs-skeleton/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syniol%2Fnestjs-skeleton/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syniol%2Fnestjs-skeleton/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/syniol","download_url":"https://codeload.github.com/syniol/nestjs-skeleton/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/syniol%2Fnestjs-skeleton/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259090407,"owners_count":22803677,"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":[],"created_at":"2025-06-10T14:14:59.993Z","updated_at":"2025-06-10T14:15:02.575Z","avatar_url":"https://github.com/syniol.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS Skeleton\nThis is a skeleton application for NestJS with TypeScript.\n\n\n## Initial Skeleton Build\nIn order to create a new skeleton application, I ran the following inside the node.js docker container.\n\n```bash\nnest new app\n```\nIt creates a new folder named `app` with all example files and an endpoint `/` with `GET` method for Hello World message.\n\n\n## Data Transfer Objects (DTO) Validation\nIn order to validate the incoming requests we use Zod and its extension for NestJS. Please [read more here](https://www.npmjs.com/package/nestjs-zod).\n\n```bash\nnpm i nestjs-zod zod\n```\n\n\n## Database ORM for Postgres\n\n```bash\nnpm install nestjs-knex knex pq --save\nnpx knex init -x ts\nnpx knex migrate:make \u003cmigration_name\u003e -x ts\nnpx knex seed:make \u003cseed_name\u003e -x ts\n```\n\n\n## Health Check\ntodo: add info about health endpoint\n```bash\ncurl -X GET http://127.0.0.1:8080/healthz\n```\n\n\n## Authentication\nFollowing RFC-6749 for OAuth 2.1 for `grant_type=password`, created an endpoint to request a token to access auth \nguarded endpoints utilising `AuthGuard`.\n\n__Request Example:__\n```bash\ncurl -d \"username=hadi\u0026password=myP7ssword3\u0026grant_type=password\" \\\n -H \"Content-Type: application/x-www-form-urlencoded\" \\\n  -X POST http://127.0.0.1:8080/auth/token\n```\n\n__Response Example:__\n```json\n{\n  \"access_token\": \"wLLGQxn5CpUd4Kx0tnM5qrxTgoZyLd8LnqvE8ZkaVHPVeFQF/iuMYuvQu1QGPk9qRj91vqc1JzDZHOlCFV8NhQ==\",\n  \"expires_in\": 3600,\n  \"refresh_token\": \"E/hi7cQ4La/TZwwk33VXHbCqaSc3cZx0FGxsamgdCOli4+uAXAsezWMo+NrPTCcwujlwqqszik7r/qmXJzPJoA==\",\n  \"scope\": \"portal.readonly\",\n  \"token_type\": \"Bearer\"\n}\n```\n\n\n### Todos\n * [X] Produce and return a dummy response for now and remove `void` as a return type\n * [X] Validate the input with Zod or create a value object or a combination of both\n * [X] Create a new module \"Users\"\n * [X] Create a database container for postgres\n * [X] Finalise ORM/ODM to use for Database Access Abstraction layer\n * [X] Create a new module \"Cache\"\n * [ ] Create a redis container\n\n\n##### Credits\n\u003csmall\u003eAuthor: [Hadi Tajallaei](mailto:hadi@syniol.com)\u003c/small\u003e\n\u003cp\u003e\u003csmall\u003eCopyright \u0026copy; 2025 Syniol Limited. All rights reserved.\u003c/small\u003e\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyniol%2Fnestjs-skeleton","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsyniol%2Fnestjs-skeleton","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsyniol%2Fnestjs-skeleton/lists"}