The following are instructions for setting up your local machine for Flipt development. For info on using VSCode Remote Containers / GitHub Codespaces, see #remote containers below.
Before starting, make sure you have the following installed:
- GCC Compiler
- SQLite
- Go 1.16+
- Protoc Compiler
- Clone this repo:
git clone https://github.com/markphelps/flipt
- Run
make bootstrap
to install required development tools - Run
make test
to execute the test suite - Run
make server
to build and run the server locally - Run
cd ui && yarn run dev
to build and run the ui dev server - Run
make help
to see a full list of possible make commands
Flipt is built with Go 1.16+. To reliably build Flipt, make sure you clone it to a location outside of your $GOPATH
.
Configuration for running when developing Flipt can be found at ./config/local.yml
. To run Flipt with this configuration, run:
make server
Changing certain types of files such as the protobuf, ui or documentation files require re-building before they will be picked up in new versions of the binary.
After changing flipt.proto
, you'll need to run make proto
. This will regenerate the following files:
rpc/flipt.pb.go
rpc/flipt.pb.gw.go
Running make assets
will regenerate the embedded assets (ui, api documentation).
The UI is built using Yarn and webpack and is also statically compiled into the Flipt binary.
The ui/README.md has more information on how to build the UI and also how to run it locally during development.
Flipt now supports VSCode Remote Containers/GitHub Codespaces.
These technologies allow you to quickly get setup with a Flipt development environment either locally or 'in the cloud'.
For VSCode Remote Containers (devcontainers), make sure you have Docker and the ms-vscode-remote.remote-containers extension installed. Then simply clone this repo, open it in VSCode and run the Remote-Containers: Open Folder in Container
command in VSCode.
If you have access to GitHub Codespaces, simply open Flipt in a codespaces from the Code
tab in the repo on GitHub.
Regardless of whether you are using Remote Containers or GitHub Codespaces, you'll need to run a couple tasks to successfully build/run Flipt in these environments.
Then run the Server/Client run command to start the server and client.
This should publish three ports 8080
, 8081
, 9000
.
8081
is the UI dev port that runs the yarn dev server
that you can open in your browser.