{"id":31706915,"url":"https://github.com/aksbuzz/flippr","last_synced_at":"2025-10-08T23:30:08.903Z","repository":{"id":317874557,"uuid":"1069176026","full_name":"aksbuzz/flippr","owner":"aksbuzz","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-03T16:05:10.000Z","size":101,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-03T16:33:33.236Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/aksbuzz.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-03T14:16:33.000Z","updated_at":"2025-10-03T16:05:13.000Z","dependencies_parsed_at":"2025-10-03T16:33:40.884Z","dependency_job_id":null,"html_url":"https://github.com/aksbuzz/flippr","commit_stats":null,"previous_names":["aksbuzz/flippr"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/aksbuzz/flippr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksbuzz%2Fflippr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksbuzz%2Fflippr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksbuzz%2Fflippr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksbuzz%2Fflippr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aksbuzz","download_url":"https://codeload.github.com/aksbuzz/flippr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aksbuzz%2Fflippr/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000721,"owners_count":26082862,"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-10-08T02:00:06.501Z","response_time":56,"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":[],"created_at":"2025-10-08T23:30:06.876Z","updated_at":"2025-10-08T23:30:08.869Z","avatar_url":"https://github.com/aksbuzz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flippr\n\n**A Simple and Fast Feature Flagging Service**\n\nFlippr is a feature flagging service that helps developers release features safely. It lets you change your application's behavior in different environments (like production or staging) without deploying new code.\n\n \n\n## Core Features\n\n*   **Dynamic Configuration \u0026 Toggling:**  Instantly enable or disable features with a simple switch.\n* **Multivariate Flags (Variants)**: Serve different string, number, or JSON values to your users for A/B testing, phased rollouts, and remote configuration.\n*   **Multiple Environments:** Manage flags for `development`, `staging`, and `production` and more separately.\n*   **Fast Evaluation:** A high-speed API for checking flag status with very low latency.\n*   **Simple UI:** A web dashboard to manage all your projects, environments, and flags.\n\n## Architecture\n\nFlippr uses a **Control Plane / Data Plane** architecture to separate safe management from fast delivery.\n\n*   **Control Plane (Management API)**\n    *   **Purpose:** The UI and API used to create projects, configure environments, define flags\n    *   **Technology:** Node.js, Express, Redis, PostgreSQL.\n    *   **Characteristics:** Prioritizes data safety and consistency. It writes to the PostgreSQL database (the source of truth) and pushes the final, evaluated flag value to the Redis cache.\n\n*   **Data Plane (Evaluation API)**\n    *   **Purpose:** The API your applications call to check if a feature is enabled.\n    *   **Technology:** Go, Redis.\n    *   **Characteristics:** Prioritizes speed and high availability. It only reads the pre-calculated value from the Redis cache.\n\n## Tech Stack\n\n*   **Backend (Control Plane):** Node.js, Express, TypeScript\n*   **Backend (Data Plane):** Go\n*   **Frontend:** React\n*   **Database:** PostgreSQL, Redis\n*   **Containerization:** Docker\n\n## Running Locally\n\nYou will need Docker installed locally.\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https://github.com/your-username/flippr.git\n    cd flippr\n    ```\n\n2.  **Set up environment variables:**\n    Each service needs its own `.env` file. Copy the example files:\n    ```bash\n    cp services/management-api/.env.example services/management-api/.env\n    cp services/evaluation-api/.env.example services/evaluation-api/.env\n    ```\n\n3.  **Run with Docker Compose:**\n    ```bash\n    docker-compose up --build\n    ```\n\n4.  **Access the services:**\n    *   **Management UI:** `http://localhost`\n    *   **Management API (Node.js):** `http://localhost:4000`\n    *   **Evaluation API (Go):** `http://localhost:8080`\n\n## API Usage Examples\n\n### To Change a Flag's State\n\nUse the **Management API** to change a flag's state for a specific environment.\n\n```bash\ncurl --location --request PATCH 'http://localhost:4000/api/v1/flags/{flagId}/environments/{environmentId}' \\\n--header 'Content-Type: application/json' \\\n--data '{\n    \"isEnabled\": true,\n    \"servingVariantId\": \"3333-variant-variant-...\"\n}'\n```\n\n### To Evaluate a Flag's Value\n\nUse the **Evaluation API** from your application's SDK.\n\n*Replace {sdkKey} with the key for your environment and {flagKey} with the key of your flag.*\n\n```bash\ncurl --location --request GET 'http://localhost:8080/api/v1/evaluate/flags/{flagKey}' \\\n--header 'Authorization: {sdkKey}'\n```\n\n**Success Response:**\n\nThe API returns a JSON object with a single value key, which can hold a boolean, string, number, or object.\n\n*For a boolean flag:*\n\n```json\n{\n    \"value\": true\n}\n```\n\n*For a string variant:*\n\n```json\n{\n    \"value\": \"Buy Now\"\n}\n```\n*For a JSON object variant:*\n\n```json\n{\n    \"value\": {\n        \"fontSize\": 16,\n        \"theme\": \"dark\"\n    }\n}\n```\n\n*If the flag does not exist:*\n```json\n{\n   \"value\": null\n}\n```\n\n## SDK Example (JavaScript)\n\n```javascript\nimport { FlipprClient } from 'flippr-sdk';\n\nconst flippr = new FlipprClient({ \n    sdkKey: 'prod_abc123...',\n    baseUrl: 'http://localhost:8080'\n});\n\n// Example 1: Getting a string variant for an A/B test\nasync function getButtonText() {\n  const buttonText = await flippr.getVariant\u003cstring\u003e('new-checkout-button', 'Default Text');\n  // buttonText will be \"Buy Now!\" or \"Proceed to Payment\", etc.\n  document.getElementById('checkout-btn').innerText = buttonText;\n}\n\n// Example 2: Getting a number for remote configuration\nasync function getApiRateLimit() {\n  const limit = await flippr.getVariant\u003cnumber\u003e('api-rate-limit', 100);\n  // Configure an API client with the remotely-configured limit\n}\n\n// Example 3 Getting a JSON object for complex configuration\ninterface UiConfig {\n  showAlerts: boolean;\n  theme: 'light' | 'dark';\n}\nasync function applyUiConfig() {\n  const defaultConfig: UiConfig = { showAlerts: false, theme: 'light' };\n  const config = await flippr.getVariant\u003cUiConfig\u003e('ui-config', defaultConfig);\n  \n  if (config.showAlerts) {\n    // ...\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksbuzz%2Fflippr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faksbuzz%2Fflippr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faksbuzz%2Fflippr/lists"}