Skip to content

A self-hosted feature flag management platform. Includes a Node.js API, a React Admin Dashboard, and a custom JavaScript SDK for real-time feature toggling.

Notifications You must be signed in to change notification settings

TouseefQ/flagship

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚩 FlagShip: Open Source Feature Flagging

FlagShip is a self-hosted feature flag management platform. It allows you to toggle features in real-time without redeploying your application.

FlagShip Admin Dashboard

🌟 Features

  • Central Control: Admin Dashboard to manage flags.
  • Fast SDK: Lightweight JavaScript SDK for React/Node.
  • Self-Hosted: Runs entirely in Docker (Node + Postgres + Redis).
  • Developer Friendly: Simple useFlag() hooks.

🚀 Quick Start (Run the Platform)

  1. Clone the Repo:

    git clone https://github.com/TouseefQ/flagship.git
    cd flagship
  2. Start the Stack:

    docker-compose up --build

💻 Integration Guide (For Developers)

This repository includes a JavaScript SDK (sdk-js) that you can install in your own apps to consume these flags.

1. Install the SDK

(In this monorepo, you can install the local tarball or publish to NPM)

npm install flagship-sdk-js

2. Initialize the Client

Initialize the client once at the start of your application (e.g., in index.js or App.js). This connects your app to the FlagShip server.

import FlagShip from 'flagship-sdk-js';

// Create the client instance pointing to your FlagShip server
const client = new FlagShip({
  serverUrl: 'http://localhost:4000' // Change this to your production URL
});

// Fetch the latest flags from the server
await client.init();

3. Use in Code

Once initialized, you can check feature status synchronously anywhere in your app.

// Check if a feature is enabled
if (client.isEnabled('dark-mode')) {
  console.log("Dark mode is ON");
  enableDarkMode();
} else {
  console.log("Dark mode is OFF");
  enableLightMode();
}

// Example: Safely checking a non-existent flag (returns false)
const isBetaUser = client.isEnabled('super-secret-beta');

🛠️ Architecture

This project is a Monorepo designed for scalability:

  • /server: Node.js + Express API (The Brain)

  • /dashboard: React Admin UI (The Control Room)

  • /sdk-js: Isomorphic Client Library (The Connector)

  • docker-compose.yml: Orchestrates Postgres, the API, and the Nginx-served Dashboard.

About

A self-hosted feature flag management platform. Includes a Node.js API, a React Admin Dashboard, and a custom JavaScript SDK for real-time feature toggling.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published