Skip to content

Latest commit

 

History

History
126 lines (93 loc) · 5.12 KB

development-setup.md

File metadata and controls

126 lines (93 loc) · 5.12 KB

Fortis development setup

Travis CI status Docker Pulls for project-fortis-services

Architecture overview

One-time setup

Getting the code

First, you need to get the code:

git clone https://github.com/CatalystCode/project-fortis.git
cd project-fortis

Setting up Azure resources

Then, you need to set up some services in Azure by running the following Bash script (e.g. via the Windows Subsystem for Linux):

./project-fortis-pipeline/localdeploy/setup-development-azure-resources.sh \
  -i YOUR_SUBSCRIPTION_ID_HERE \
  -l YOUR_CLOSEST_AZURE_LOCATION_HERE \
  -o .env-secrets

This script will deploy to Azure a number of services used by Fortis, such as ServiceBus, EventHubs, Cognitive Services, PostgreSQL, and so forth. The secrets to access these services are stored in a .env-secrets file which the rest of the development setup will leverage. All the services are stored inside of a single resource group whose name is stored under the FORTIS_RESOURCE_GROUP_NAME key in the secrets file.

Generating Mapbox access token

Mapbox is a service that allows you to simply create beautiful maps and location services through APIs and SDKs. They have extensive documentation which you can find here.

Next, you need to create a Mapbox access token. If you don't have one yet, you can create a new one for free by signing up. Once you have the token, append it to the .env-secrets file like so:

MAPBOX_ACCESS_TOKEN=your_mapbox_access_token_here

Authentication

You may also want to add your email address to the USERS or ADMINS list in the .env file; otherwise you wouldn't be able to log into your Fortis site! Alternatively, you can also clear out the value for the key AD_CLIENT_ID in the .env file in order to disable authentication entirely. This is for example useful if you want to talk directly to the GraphQL server via the GraphiQL tool instead of accessing the API endpoints via the UI.

Preparing Docker

This project runs entirely inside of Docker containers orchestrated by docker-compose, so please ensure that you have installed Docker on your system, e.g. Docker for Windows.

We're using a volume mount to enable support for code hot-reload. As such, please ensure that you've shared the drive on which your code resides with Docker via the "Shared Drives" tab in the Docker settings.

The containers created for this project use quite a lot of resources, so if any of the services die with exit code 137, please give more memory to Docker via the "Advanced" tab in the Docker settings.

Running the service

Now you can start the full Fortis pipeline with one command:

docker-compose up --build

This will start all the Docker services and gather logs in the terminal. Note that the first time you run this command, it will take upwards of 90 minutes to start since your personal feature service database is getting populated.

After all the Docker services started, head over to the following URLs to play with the services:

After making changes, you can re-build and re-start the affected services using:

docker-compose up --build -d

Note that any changes to the React code in project-fortis-interfaces folder will be automatically detected and re-loaded so the re-build step above won't be necessary for changes to the frontend.

If you're facing any issues, refer to the Development FAQ.