{"id":14155356,"url":"https://github.com/nicolabovolato/basica","last_synced_at":"2025-08-06T01:31:17.926Z","repository":{"id":230430365,"uuid":"751249680","full_name":"nicolabovolato/basica","owner":"nicolabovolato","description":"The Foundational Library of Modern Applications","archived":false,"fork":false,"pushed_at":"2024-09-04T12:03:30.000Z","size":899,"stargazers_count":5,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-09-05T13:04:58.739Z","etag":null,"topics":["fastify","framework","javascript","microservice","microservices","rest-api","restful-api","typebox","typescript","web-application"],"latest_commit_sha":null,"homepage":"https://basica.bovolato.dev","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/nicolabovolato.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}},"created_at":"2024-02-01T08:26:46.000Z","updated_at":"2024-09-04T12:03:34.000Z","dependencies_parsed_at":"2024-05-01T11:28:26.593Z","dependency_job_id":null,"html_url":"https://github.com/nicolabovolato/basica","commit_stats":null,"previous_names":["nicolabovolato/basica"],"tags_count":29,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolabovolato%2Fbasica","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolabovolato%2Fbasica/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolabovolato%2Fbasica/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nicolabovolato%2Fbasica/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nicolabovolato","download_url":"https://codeload.github.com/nicolabovolato/basica/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228821404,"owners_count":17977166,"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":["fastify","framework","javascript","microservice","microservices","rest-api","restful-api","typebox","typescript","web-application"],"created_at":"2024-08-17T08:02:56.894Z","updated_at":"2024-12-09T02:31:20.321Z","avatar_url":"https://github.com/nicolabovolato.png","language":"TypeScript","funding_links":[],"categories":["web-application"],"sub_categories":[],"readme":"[![CI](https://github.com/nicolabovolato/basica/actions/workflows/ci.yml/badge.svg)](https://github.com/nicolabovolato/basica/actions/workflows/ci.yml)\n\n# Basica\n\nThe Foundational Library of Modern Applications\n\n## [Docs](https://basica.bovolato.dev)\n\n`npm install @basica/core @basica/config @basica/fastify`\n\n```ts\nimport { IocContainer } from \"@basica/core/ioc\";\nimport { loggerFactory } from \"@basica/core/logger\";\nimport { AppBuilder } from \"@basica/core\";\nimport { configure, envProvider } from \"@basica/config\";\n\nimport { lifecyclePlugin } from \"@basica/fastify\";\n\nimport { Type } from \"@sinclair/typebox\";\n\n// Validate configuration\nconst config = configure(envProvider(), Type.Object({\n  logger: loggerConfigSchema\n}));\n\n// Dependency injection\nconst container = new IocContainer()\n  .addSingleton(\"logger\", () =\u003e loggerFactory(config.logger))\n  .addSingleton(\"svc\", (s) =\u003e ({\n    hello: () =\u003e {\n      s.logger.info(\"svc called!\");\n      return \"hello world\";\n    },\n    healthcheck: () =\u003e ({ status: \"healthy\" }),\n  }));\n\nconst app = new AppBuilder(container)\n  // Lifecycle management\n  .configureLifecycle((b, c) =\u003e b\n    // Healthchecks\n    .addHealthcheck(\"svc\", (c) =\u003e c.svc)\n    // Plugins\n    .with(lifecyclePlugin, (b) =\u003e b\n      .addFastifyEntrypoint(\"http\", (f) =\u003e f\n        .mapHealthchecks({ path: \"/health\" })\n        .configureApp((app) =\u003e {\n          app\n            .useOpenapi()\n            .fastify.get(\"/\", () =\u003e c.svc.hello());\n          }\n        )\n      )\n    )\n  ).build();\n\napp.run();\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolabovolato%2Fbasica","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnicolabovolato%2Fbasica","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnicolabovolato%2Fbasica/lists"}