{"id":51777408,"url":"https://github.com/jcserv/fastify-api-template","last_synced_at":"2026-07-20T07:30:49.646Z","repository":{"id":366155954,"uuid":"1275038029","full_name":"jcserv/fastify-api-template","owner":"jcserv","description":"This template can be used to quickly bootstrap a Fastify API server","archived":false,"fork":false,"pushed_at":"2026-06-20T13:41:13.000Z","size":104,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-20T15:12:31.209Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcserv.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-20T07:04:56.000Z","updated_at":"2026-06-20T13:41:10.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/jcserv/fastify-api-template","commit_stats":null,"previous_names":["jcserv/fastify-api-template"],"tags_count":null,"template":true,"template_full_name":null,"purl":"pkg:github/jcserv/fastify-api-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Ffastify-api-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Ffastify-api-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Ffastify-api-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Ffastify-api-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcserv","download_url":"https://codeload.github.com/jcserv/fastify-api-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcserv%2Ffastify-api-template/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35678463,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"ssl_error","status_checked_at":"2026-07-20T02:08:09.736Z","response_time":111,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2026-07-20T07:30:48.915Z","updated_at":"2026-07-20T07:30:49.638Z","avatar_url":"https://github.com/jcserv.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastify-api-template\n\nA batteries-included template for spinning up a [Fastify](https://fastify.dev) API in TypeScript.\n\n\u003e Click **Use this template** on GitHub to bootstrap a new repo.\n\n## Features\n\n- ⚡ **Fastify 5** with typed routes via [`json-schema-to-ts`](https://github.com/ThomasAribart/json-schema-to-ts)\n- 🦀 **oxlint + oxfmt** for fast linting and formatting\n- 📦 **rolldown** for production bundling\n- ✅ **vitest** for testing\n- 🪝 **husky + lint-staged** pre-commit hooks (lint, typecheck, test)\n- 🐳 **Docker + Docker Compose** (app + Postgres)\n- 🔁 **GitHub Actions** CI (lint, typecheck, test, build, docker)\n- 🛑 Graceful shutdown + structured logging (pino)\n\n## Project structure\n\n```\nsrc/\n  app.ts            # builds the Fastify instance (testable, no listen)\n  server.ts         # boots app.ts, wires logging + graceful shutdown\n  config.ts         # env-driven config\n  app.test.ts       # example test using app.inject\n  routes/\n    index.ts        # route definitions\n    types.ts        # JSON schemas for typed request/response\n```\n\n## Getting started\n\n```sh\ncp .env.example .env\npnpm install\npnpm dev\n```\n\nServer runs at `http://localhost:3000`. Try `GET /health`.\n\n## Scripts\n\n| Command           | Description                     |\n| ----------------- | ------------------------------- |\n| `pnpm dev`        | Run with hot reload             |\n| `pnpm build`      | Bundle to `dist/` with rolldown |\n| `pnpm start`      | Run the production build        |\n| `pnpm lint`       | Lint + format check             |\n| `pnpm lint:fix`   | Lint + format, applying fixes   |\n| `pnpm typecheck`  | Typecheck (`tsc --noEmit`)      |\n| `pnpm test`       | Run tests once                  |\n| `pnpm test:watch` | Run tests in watch mode         |\n\n## Docker\n\n```sh\ndocker compose up --build\n```\n\nBrings up the API and a Postgres instance. Configure via `.env`.\n\n## Adding a route\n\n1. Define the JSON schema in `src/routes/types.ts`.\n2. Register the handler in `src/routes/index.ts` using `app.withTypeProvider\u003cJsonSchemaToTsProvider\u003e()` for inferred types.\n\n## License\n\nISC\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcserv%2Ffastify-api-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcserv%2Ffastify-api-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcserv%2Ffastify-api-template/lists"}