{"id":29629909,"url":"https://github.com/phr3nzy/api-template","last_synced_at":"2026-05-15T22:40:06.371Z","repository":{"id":103621491,"uuid":"502033134","full_name":"phr3nzy/api-template","owner":"phr3nzy","description":"Fastify API Template. Written with TypeScript.","archived":false,"fork":false,"pushed_at":"2022-07-23T12:04:13.000Z","size":205,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-21T10:19:15.005Z","etag":null,"topics":["api","fastify","template","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/phr3nzy.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":"2022-06-10T12:22:21.000Z","updated_at":"2023-11-05T11:48:19.000Z","dependencies_parsed_at":"2023-05-24T00:30:53.617Z","dependency_job_id":null,"html_url":"https://github.com/phr3nzy/api-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phr3nzy/api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phr3nzy%2Fapi-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phr3nzy%2Fapi-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phr3nzy%2Fapi-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phr3nzy%2Fapi-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phr3nzy","download_url":"https://codeload.github.com/phr3nzy/api-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phr3nzy%2Fapi-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273069852,"owners_count":25040135,"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-09-01T02:00:09.058Z","response_time":120,"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":["api","fastify","template","typescript"],"created_at":"2025-07-21T10:07:45.015Z","updated_at":"2026-05-15T22:40:01.308Z","avatar_url":"https://github.com/phr3nzy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fastify API Template\n\nA template for an API using Fastify. Written in TypeScript.\n\n## Contributions\n\n1. Clone the repo\n\n2. Checkout into a new branch with the proper name (feature/xx, refactor/xx, chore/xx... etc.)\n\n3. Write your code + tests (required) and/or update documentation\n\n4. Push changes to the remote branch\n\n5. Create a PR and notify a maintainer and enjoy your day!\n\n## Important Docs\n\n- [Fastify](https://fastify.io/)\n- [Encapsulation](https://www.fastify.io/docs/latest/Encapsulation/)\n- [Routes](https://www.fastify.io/docs/latest/Routes/)\n- [Plugins](https://www.fastify.io/docs/latest/Plugins/)\n- [Logging](https://www.fastify.io/docs/latest/Logging/)\n- [Validation \u0026 Serialization](https://www.fastify.io/docs/latest/Validation-and-Serialization/)\n- [Hooks](https://www.fastify.io/docs/latest/Hooks/)\n- [Swagger Specification](https://swagger.io/specification/)\n- [JSON Schema Specification](https://json-schema.org/understanding-json-schema/index.html)\n\n## Project Structure\n\n```bash\n.\n├── .github # Github specific files (dependabot, workflows... etc.)\n├── .husky # husky dir (Readonly)\n├── data # contains data for seeding the data\n├── server # contains the main files for the backend\n│   ├── config # stores configurations (server, logger, env vars... etc.)\n│   ├── models # Objection.js models\n│   ├── plugins # Custom plugins (auth, security, cache, db... etc.)\n│   ├── routes # routes must be place here and versioned\n│   │   └── v1 # example version\n│   │       ├── accounts # exports subroutes under '/accounts/'\n│   │       │   ├── index.js # exports routes login, register and token (and others)\n│   │       │   ├── login # example route, mapped to '/api/v1/accounts/login'\n│   │       │   │   ├── index.js\n│   │       │   │   └── spec.json # JSON schema spec of the login route\n│   │       │   ├── register # example route, mapped to '/api/v1/accounts/register'\n│   │       │   │   ├── index.js\n│   │       │   │   └── spec.json # JSON schema spec of the register route\n│   │       │   └── token # example route, mapped to '/api/v1/accounts/token'\n│   │       │       ├── index.js\n│   │       │       └── spec.json # JSON schema spec of the token route\n│   │       └── index.js # exports accounts routes (and others)\n│   └── static # contains static assets (robots.txt)\n└── tests # written tests go here\n```\n\n## Requirements\n\n- Node.js\n- Optional: `docker` \u0026 `docker-compose`\n\n## Development\n\n```bash\n$ yarn dev\n# run in development\n\n$ yarn start\n# run in production\n\n$ yarn lint\n# check for errors\n\n$ yarn fix\n# fix any errors\n\n$ yarn test\n# run tests\n```\n\n### Running tests locally\n\nMost tests are ran using our CI (GitHub Actions), but to replicate testing, run the following:\n\n```bash\n$ docker-compose -f docker-compose.ci.yml up -d\n# should download the images and run them in their respective ports\n\n$ export $(cat .env.testing) \u0026\u0026 npm run test\n# inject the testing env vars and run tests\n```\n\n## Environment\n\nSee [.env.template](./.env.template)\n\n## License\n\nSee [LICENSE.md](./LICENSE.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphr3nzy%2Fapi-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphr3nzy%2Fapi-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphr3nzy%2Fapi-template/lists"}