{"id":50404429,"url":"https://github.com/kasir-barati/flagd-nestjs","last_synced_at":"2026-05-31T01:02:10.227Z","repository":{"id":348574334,"uuid":"1195620119","full_name":"kasir-barati/flagd-nestjs","owner":"kasir-barati","description":"A NestJS wrapper around flagd.","archived":false,"fork":false,"pushed_at":"2026-04-01T19:27:32.000Z","size":157,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-02T05:45:23.115Z","etag":null,"topics":["docker","flagd","nestjs","openfeature"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/9109679196/flagd-nestjs","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/kasir-barati.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-29T22:03:07.000Z","updated_at":"2026-04-01T19:27:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/kasir-barati/flagd-nestjs","commit_stats":null,"previous_names":["kasir-barati/flagd-nestjs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/kasir-barati/flagd-nestjs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasir-barati%2Fflagd-nestjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasir-barati%2Fflagd-nestjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasir-barati%2Fflagd-nestjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasir-barati%2Fflagd-nestjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kasir-barati","download_url":"https://codeload.github.com/kasir-barati/flagd-nestjs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kasir-barati%2Fflagd-nestjs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33715211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-30T02:00:06.278Z","response_time":92,"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":["docker","flagd","nestjs","openfeature"],"created_at":"2026-05-31T01:02:09.634Z","updated_at":"2026-05-31T01:02:10.210Z","avatar_url":"https://github.com/kasir-barati.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flagd-nestjs\n\n| `PORT` | NestJS server port | `3000` |\n| `SWAGGER_PATH` | Swagger UI path | `api` |\nA NestJS wrapper around [flagd](https://flagd.dev/) for feature flag management with persistent storage. It bundles a NestJS REST API for CRUD operations on feature flags with a co-located flagd process that serves evaluated flags over **gRPC** and **[OFREP](https://github.com/open-feature/protocol)/HTTP** — all inside a single Docker image.\n\n## How It Works\n\n```\n╭───────────────────────────────────────────────────────────╮\n│                   🐳  Docker Container                    │\n│  ╭───────────────────────╮      ╭─────────────────────╮   │\n│  │  🐈 NestJS REST API   │      │  🚩 flagd           │   │\n│  │  (CRUD operations)    │◄─────│  (Flag evaluation)  │   │\n│  │  - Port: 3000         │ poll │  - gRPC:  8013      │   │\n│  ╰──────────┬────────────╯      │  - OFREP: 8016      │   │\n│             │         ▲         ╰──────────┬──────────╯   │\n╰─────────────┼─────────┼────────────────────┼──────────────╯\n              ▼         │                    ▼\n       ╭─────────────╮  │            ╭──────────────╮\n       │ 💾 Database │  │            │ 👤 Client    │\n       ╰─────────────╯  │            │ (Frontend or │\n                        │            │  Backend)    │\n                        │            │  via SDK     │\n                        │            ╰──────┬───────╯\n                        └───────────────────┘\n                          Flag Definitions\n```\n\n1. **NestJS** exposes a REST API to create, read, update, and delete feature flags, persisting them to a database via TypeORM.\n2. **NestJS** also serves a `/flagd/flags.json` sync endpoint that renders all stored flags in the [flagd flag definition format](https://flagd.dev/reference/flag-definitions/).\n3. **flagd** polls that sync endpoint and serves evaluated flag values over gRPC (port `8013`) and OFREP/HTTP (port `8016`) to your backend and frontend applications using the [OpenFeature](https://openfeature.dev/) SDKs.\n\n## Features\n\n- 🚀 **RESTful API** for feature flag management with full **Swagger** documentation.\n- 🗄️ **Multi‑database support**:\n  - 🐘 PostgreSQL.\n  - 🐬 MySQL.\n  - 🍃 MongoDB.\n  - 🪟 MSSQL.\n  - 🧊 SQLite.\n- 📦 **Single container** — NestJS + flagd bundled together through a lightweight entrypoint script.\n- 🔌 **OpenFeature compatible** — flagd supports gRPC and OFREP evaluation endpoints.\n- ❤️ **Health check** — `GET /healthcheck`.\n- 📜 **Structured logging** with correlation IDs for traceability.\n\n## Environment Variable\n\n| Variable          | Description                                                  | Default                                      |\n| ----------------- | ------------------------------------------------------------ | -------------------------------------------- |\n| `SERVICE_NAME`    | Application name                                             | `flagd-nestjs`                               |\n| `DATABASE_ENGINE` | `postgres`, `mysql`, `mongodb`, `mssql`, or `sqlite`         | `postgres`                                   |\n| `DATABASE_URL`    | Database connection string (or file path for SQLite)         | `postgres://flagd:flagd@postgres:5432/flagd` |\n| `LOG_MODE`        | `PLAIN_TEXT` or `JSON`                                       | `PLAIN_TEXT`                                 |\n| `LOG_LEVEL`       | `error`, `warn`, `info`, `http`, `verbose`, `debug`, `silly` | `debug`                                      |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasir-barati%2Fflagd-nestjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkasir-barati%2Fflagd-nestjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkasir-barati%2Fflagd-nestjs/lists"}