FlagShip is a self-hosted feature flag management platform. It allows you to toggle features in real-time without redeploying your application.
- 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.
-
Clone the Repo:
git clone https://github.com/TouseefQ/flagship.git cd flagship -
Start the Stack:
docker-compose up --build
- Dashboard: http://localhost:3000
- API: http://localhost:4000
This repository includes a JavaScript SDK (sdk-js) that you can install in your own apps to consume these flags.
(In this monorepo, you can install the local tarball or publish to NPM)
npm install flagship-sdk-jsInitialize 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();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');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.
