{"id":18532330,"url":"https://github.com/triptyk/nfw","last_synced_at":"2025-04-09T14:31:27.078Z","repository":{"id":43874158,"uuid":"166414581","full_name":"TRIPTYK/nfw","owner":"TRIPTYK","description":"A jsonapi boilerplate for @nfw-core with mikro-orm","archived":false,"fork":false,"pushed_at":"2024-01-20T05:09:16.000Z","size":29990,"stargazers_count":25,"open_issues_count":2,"forks_count":2,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-04-01T12:04:27.028Z","etag":null,"topics":["bcrypt","boilerplate","json-api","jwt-authentication","koa","mikro-orm","nfw","nfw-core","node","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TRIPTYK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-01-18T14:07:57.000Z","updated_at":"2023-04-18T03:53:50.000Z","dependencies_parsed_at":"2023-11-09T16:47:29.350Z","dependency_job_id":null,"html_url":"https://github.com/TRIPTYK/nfw","commit_stats":null,"previous_names":[],"tags_count":4,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Fnfw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Fnfw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Fnfw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TRIPTYK%2Fnfw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TRIPTYK","download_url":"https://codeload.github.com/TRIPTYK/nfw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055106,"owners_count":21040122,"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":["bcrypt","boilerplate","json-api","jwt-authentication","koa","mikro-orm","nfw","nfw-core","node","typescript"],"created_at":"2024-11-06T19:05:51.066Z","updated_at":"2025-04-09T14:31:26.099Z","avatar_url":"https://github.com/TRIPTYK.png","language":"TypeScript","readme":"![alt text](https://repository-images.githubusercontent.com/166414581/dc0a1b80-a1a0-11e9-805b-cf8be46b5507)\n\n# NFW a node Typescript boilerplate\n\n![Test](https://github.com/TRIPTYK/nfw/workflows/Test/badge.svg?branch=master)\n![Lint](https://github.com/TRIPTYK/nfw/workflows/Lint/badge.svg?branch=master)\n[![CodeQL](https://github.com/TRIPTYK/nfw/actions/workflows/codeql-analysis.yml/badge.svg?branch=master)](https://github.com/TRIPTYK/nfw/actions/workflows/codeql-analysis.yml)\n\nThis repository contains a JSON-API REST API boilerplate using [NFW-CORE](https://github.com/TRIPTYK/nfw-core).\n\n:warning: : ESM only, no CommonJS modules.\n\n## Requirements\n\n- Typescript \u003e= 4.9.x (waiting on tsyringe to move to 5.x)\n- node \u003e= 18.x\n- pnpm 8.x\n\n## Install\n\nAny package manager should do the trick but i recommend using [Pnpm](https://pnpm.io).\n\n```bash\npnpm i\n```\n\nInstall the database container.\n\n```bash\ndocker compose up -d\n```\n\n## Environments\n\n*You must create a `config/env/\u003cNODE_ENV\u003e.env` file for each env at the root of your project.*\n\nThe structure of the env file is validated and can be found in the `src/api/services/configuration.service.ts` service.\n\n## Scripts\n\n### Start from dev env\n\n```bash\npnpm start:dev\n```\n\n### Start from test env\n\nUseful for debugging\n\n```bash\npnpm start:test\n```\n\n### [MIKRO-ORM](https://mikro-orm.io/) CLI\n\n```bash\npnpm mikro-orm:cli \u003cany command\u003e\n```\n\n### Production and deployments\n\nYou need to transpile (or bundle) the Typescript. And then run node against it. it's up to you.\n\n```bash\npnpm tsc\n# rollup ...\n# docker containers ...\n```\n\n## Tests\n\nRuns the tests with [vitest](https://vitest.dev/).\nThe migrations  are run and database is cleared before testing.\n\n```bash\npnpm test\n```\n\nWith beautiful UI in watch mode and coverage\n\n```bash\npnpm test -- --ui --watch --coverage\n```\n\nIn watch mode\n\n```bash\npnpm test -- --watch\n```\n\n## File structure\n\n- **config**: config files (some config files that cannot be moved stay in root)\n- **database**: the docker database init files.\n- **dist**: the typescript output folder\n- **src**\n  - **api**: transport and configuration related files.\n  - **database**: database and ORM related files.\n- **tests**:\n  - **mocks**: mocks folder\n  - **src**: the test files folder\n    - **acceptance**: acceptance tests files\n    - **integration**: integration tests files\n    - **unit**: unit tests files\n  - **static**: static files (png,pdf, ...) for testing\n  - **utils**: utils for testing\n\n## Notes\n\n- App must not depend on tests folder.\n- Path aliases are used in typescript to have clearer imports and separation. You cannot import app into app. Import must be relative when the import in the same path.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriptyk%2Fnfw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftriptyk%2Fnfw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftriptyk%2Fnfw/lists"}