{"id":21500729,"url":"https://github.com/lost22git/test-fastify","last_synced_at":"2026-04-13T17:32:40.250Z","repository":{"id":195409127,"uuid":"692851659","full_name":"lost22git/test-fastify","owner":"lost22git","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-17T19:22:36.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-14T05:28:56.462Z","etag":null,"topics":["cors","fastify","nodejs","prisma","swagger","typebox"],"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/lost22git.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}},"created_at":"2023-09-17T19:18:59.000Z","updated_at":"2023-09-17T19:24:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"c35be7a2-a12d-4160-97d0-7445a231f490","html_url":"https://github.com/lost22git/test-fastify","commit_stats":null,"previous_names":["lost22git/test-fastify"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lost22git/test-fastify","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lost22git%2Ftest-fastify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lost22git%2Ftest-fastify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lost22git%2Ftest-fastify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lost22git%2Ftest-fastify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lost22git","download_url":"https://codeload.github.com/lost22git/test-fastify/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lost22git%2Ftest-fastify/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31762529,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T15:25:13.801Z","status":"ssl_error","status_checked_at":"2026-04-13T15:25:09.162Z","response_time":93,"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":["cors","fastify","nodejs","prisma","swagger","typebox"],"created_at":"2024-11-23T17:43:41.926Z","updated_at":"2026-04-13T17:32:40.244Z","avatar_url":"https://github.com/lost22git.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# dev app\n\n## init app\n\n```shell\nmkdir test-fastify \u0026\u0026 cd test-fastify\n\npnpm init -y\n```\n\n## install fastify\n\n```shell\npnpm i fastify\n```\n\n## install typescript\n\n```shell\npnpm i -D typescript @types/node\n\npnpm exec tsc --init\n```\n\n`tsconfig.json`\n\n```json\n{\n    \"compileOptions\": {\n        \"target\": \"ES2021\",\n        \"module\": \"ES2022\",\n        \"moduleResolution\": \"node\"\n    }\n}\n```\n\n`package.json`\n```json\n{\n    \"scripts\": {\n        \"build\": \"tsc -p tsconfig.json\",\n        \"start\": \"node index.js\"\n    }\n    \"type\": \"module\",\n}\n```\n\n## install prisma\n```shell\npnpm i prisma\n```\n\n### init prisma\n\n```shell\npnpm exec prisma init --datasource-provider sqlite\n```\n\n### edit `./prisma/schema.prisma` file\n\n```prisma\n// This is your Prisma schema file,\n// learn more about it in the docs: https://pris.ly/d/prisma-schema\n\ngenerator client {\n  provider = \"prisma-client-js\"\n}\n\ndatasource db {\n  provider = \"sqlite\"\n  url      = env(\"DATABASE_URL\")\n}\n\nmodel Fighter {\n  id         Int       @id @default(autoincrement())\n  name       String    @unique\n  skill      String\n  created_at DateTime  @default(now())\n  updated_at DateTime?\n\n  @@map(\"fighter\")\n}\n```\n\n### edit .env file\n\n```env\n# Environment variables declared in this file are automatically made available to Prisma.\n# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema\n\n# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.\n# See the documentation for all the connection string options: https://pris.ly/d/connection-strings\n\nDATABASE_URL=\"file:./fighter.db\"\n```\n\n### sync schema to db and generate migrate scripts\n\n```shell\npnpm exec prisma migrate dev --name init-fighter-schema\n```\n\n\n### generate prisma client code\n\n```shell\npnpm exec prisma generate\n```\n\n### use PrismaClient in your ts code\n```typescript\nimport { PrismaClient } from '@prisma/client'\n\nconst prisma = new PrismaClient()\n```\n\n## install typebox and plugin for fastify\n\n```shell\npnpm i @sinclair/typebox @fastify/type-provider-typebox\n```\n\n## install cors plugin\n\n```shell\npnpm i @fastify/cors\n```\n\n## install swagger plugin\n\n```shell\npnpm i @fastify/swagger\n\npnpm i @fastify/swagger-ui\n```\n\n\n# build and start app\n\n```shell\npnpm build \u0026\u0026 pnpm start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flost22git%2Ftest-fastify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flost22git%2Ftest-fastify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flost22git%2Ftest-fastify/lists"}