flag-management
v1.0.0
Published
Flag Management at Emarsys
Readme
Flag Management
Getting Started
Preparations
Install libpq and ensure it is in the path and available to compilers.
brew install libpq# Add Homebrew libpq settings to ~/.zshrc
export PATH="/opt/homebrew/opt/libpq/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/libpq/lib:$LDFLAGS"
export CPPFLAGS="-I/opt/homebrew/opt/libpq/include:$CPPFLAGS"Install knex and vitest globally.
npm install knex vitest @vitest/ui -gFirst Run...
- Setup your NPM_TOKEN...
- Copy
.env.exampleto.envwithcp .env.example .env - Replace
somestringvaluein.envwith your NPM token. - Ensure that
NPM_TOKENis exported in your shell (~/.zshrcor~/.zshprofile).NPM_TOKEN=yourtokenfromnpmui
- Copy
- Run NPM install -
npm i --workspaces - Build the generic containers for clients and services (to speed up later builds)...
docker build -t emarsys/fastify-server --build-arg NPM_TOKEN=$NPM_TOKEN ./docker/fastify-serverdocker build -t emarsys/vue-client --build-arg NPM_TOKEN=$NPM_TOKEN ./docker/vue-client
- Start the database instance (and create the databases)...
docker compose up -d db - Migrate the databases to their latest version...
npm run knex migrate:latest --workspaces --if-present - Load database seeds for teams...
npm run knex seed:run --workspace=packages/team-service - Load database seeds for flags...
npm run knex seed:run --workspace=packages/flag-management-service - Start the API and Client services...
docker compose up -d
Flag Types
- Flipper - "feature toggle" with an expiration date.
- Feature - "permission toggle"
