![](https://private-user-images.githubusercontent.com/905984/253347071-3e0bbfe1-72f8-4cdc-95e9-3002d9058789.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjM5MzI0NjIsIm5iZiI6MTcyMzkzMjE2MiwicGF0aCI6Ii85MDU5ODQvMjUzMzQ3MDcxLTNlMGJiZmUxLTcyZjgtNGNkYy05NWU5LTMwMDJkOTA1ODc4OS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwODE3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDgxN1QyMjAyNDJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT00Y2VmODJkNzUwZDYwNWFmNzllNjAyMjMwNGZlNTdmOTc0YmY3YTQzMzk3MDUwN2JiMjUxZGM1ZTRhYmExODhlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.06j1Q2_OMIDEsTpXXL-ju-a-pP7cQTu-GuDMOmlHEsw)
SwitchFeat is an open-source, self-hosted platform that makes it very easy to manage your feature flags and run A/B tests straight from your infrastructure. No external servers involved, no latency in sending flags data over the internet. Your data stays within your network.
Just wrap your logic around a feature flag and use SwitchFeat API to toggle that code on or off, based on multiple conditions and user segments.
The easiest way to start using SwitchFeat is using the Docker image.
You can either clone the repo and generate the image yourself using our docker-compose.yml file, like this:
git clone https://github.com/switchfeat-com/switchfeat.git
cd switchfeat
docker-compose up -d
Or you can just download the premade image from the official Github Registry like this:
docker run --name switchfeat-com -d -p 4000:4000 ghcr.io/switchfeat-com/switchfeat:main
Once the download is complete, an additional step is needed to set the environment variables within the Docker image itself.
The image already contains a .env.example file which contains all env variables names.
Please fill the values for the variables in the required section, rename the file to .env
and restart the container.
Once done, SwitchFeat will be available at http://localhost:4000
The SwitchFeat project has been configured using Lerna framework which allows to manage multiple projects in the same repo (monorepo).
To build the project use the following command in the root folder of the project:
npm run build
To start both the server and the ui, simply run:
npm run start
SwitchFeat will be available at http://localhost:4000
For convenience during the development phase, the package.json file esposes two additional scripts which allow to run the server and the UI on separate ports. This simplifies working on the frontend, where the UI can be updated without running a full build on both projects on every change.
The following command will run the UI process on http://localhost:3000
npm run dev:start-ui
The following command will run the Server process on http://localhost:4000
npm run dev:start-api
Either it be a bug fix, an update to our documentation, a feature request, contributions are extremely welcome!
Look at the public roadmap to see what's coming and where you can help.