Installation
There are 2 ways you can integrate Waypost into your application. The easiest way is to use Docker. For this, please follow the instructions on the Quickstart page. You also have the option to clone each component from GitHub — keep reading to learn how.
Install the Waypost Feature Flag Manager App
This contains the client, server, and PostgreSQL database.
git clone https://github.com/waypost-io/waypost.git
Follow the instructions below, which are also available in the repo’s README.
Database Setup
- With Postgres installed, log in to the Postgres console and create a new database called "waypost".
CREATE DATABASE waypost;
\c waypost
- Run all of the queries in the
/server/waypost_db_setup.sqlfile to create the Waypost schema locally. - Make sure that the credentials in the
.envfile match your Postgres login credentials (see "Local Setup").
Local Setup
- Clone the Waypost repository.
git clone https://github.com/waypost-io/waypost.git
cd waypost
- Install dependencies.
cd client
npm install
cd ../server
npm install
- Add
.envfile in theserverdirectory with the following environment variables. Make sure the URL’s andWEBHOOK_VALIDATORare correct.
POSTGRES_DB="waypost"
POSTGRES_USER=<user>
POSTGRES_PASSWORD=<password>
POSTGRES_HOST="localhost"
POSTGRES_PORT=5432
WEBHOOK_VALIDATOR="secret"
FLAG_PROVIDER_URL="http://localhost:5050"
and optionally in the client directory if you want to run tests
NODE_ENV="development"
- Start the back-end from the
serverdirectory.
npm start
- Open a new terminal and start the front-end from the
clientdirectory.
cd ../client
npm start
The client will run on port :3000 and the server will run on port :5000.
Install the Flag Provider service
The flag provider service is an Express app that accepts SSE connections to serve real-time feature flag updates to clients using Waypost SDKs.
- Clone the flag provider repository (https://github.com/waypost-io/waypost-flag-provider)
git clone https://github.com/waypost-io/waypost-flag-provider.git
cd waypost-flag-provider
- Install dependencies
npm install
- Add a
.envfile to the root directory with the environment variablesWEBHOOK_VALIDATORandFEATURE_FLAG_MANAGER_URL. Example:
WEBHOOK_VALIDATOR="secret"
FEATURE_FLAG_MANAGER_URL="http://localhost:5000"
- Start the application
npm start
The flag provider app will run on port :5050.
Note: For the Flag Provider to function properly, it should be deployed and connected with a running Waypost feature flag management app.