Skip to content

Deployment

John Jones edited this page Jun 10, 2019 · 6 revisions

The original instance of IIRMa runs on Amazon Web Service's Elastic Container Service. However the project's two codebases, the backend and frontend, could conceivably run on any infrastructure that supports:

  • PHP 7
  • MySQL
  • Neo4j
  • Redis
  • SMTP Email

The following are instructions for preparing the codebase to be run in a containerized environment like AWS's ECS:

Backend

From within the project folder in a Terminal window, run:

# make build_backend

This builds a Docker image tagged networkmap-backend. You may push that to the container repository of your choice for hosting.

Backend Environment Variables

The Docker image supports the following environment variables:

  • API_PREFIX: Always set this to api. (Required)
  • APP_DEBUG: Set to true to see additional debug messages from Laravel. Set to false normally. (Required)
  • APP_ENV: Set to production. (Required)
  • APP_KEY: Set this to a random string
  • APP_LOG: Set to errorlog. (Required)
  • APP_LOG_LEVEL: Set to error. (Required)
  • APP_URL: Set to the fully-qualified URL that the Laravel app will be accessible on.
  • BROADCAST_DRIVER: Set to log. (Required)
  • CACHE_DRIVER: Set to file. (Required)
  • CRUNCHBASE_KEY: Set this to the key provided by Crunchbase. (Only applicable if using Crunchbase data.)
  • DB_CONNECTION: Set to mysql. (Required)
  • DB_PORT: Set to the port your MySQL instance is listening on. Usually 3306. (Required)
  • DB_DATABASE: Set to the database name of your MySQL instance. (Required)
  • DB_USERNAME: Set to the username of your MySQL instance. (Required)
  • DB_HOST: Set to the hostname of your MySQL instance. (Required)
  • DB_PASSWORD: Set to the password of your MySQL instance. (Required)
  • DEFAULT_ADMIN_EMAIL: Set to the email/username you'd like to use for the admin interface.
  • DEFAULT_ADMIN_PASSWORD: Set to the password you'd like to use for the admin interface. You may change this later using the Laravel admin interface.
  • DEFAULT_API_EMAIL: Set to the email/username you'd like to use for the api access.
  • DEFAULT_API_PASSWORD: Set to the password you'd like to use for the api access. You may change this later using the Laravel admin interface.
  • IMPACTSPACE_KEY: Set this to the key provided by Impactspace. (Only applicable if using Impactspace data.)
  • MAIL_DRIVER: Set this to the type of mail server being used. Usually smtp. (Required)
  • MAIL_ENCRYPTION: Set this to the type of encryption used, if any. Usually tls. (Required)
  • MAIL_FROM: Set this to the sender email address. (Required)
  • MAIL_HOST: Set this to the hostname of the email server. (Required)
  • MAIL_PASSWORD: Set this to the password for the email account on the server. (Required)
  • MAIL_PORT: Set this to the port the mail server is listening on. (Required)
  • MAIL_USERNAME: Set this to the username for the email account on the server. (Required)
  • NEO4J_HOST: Set to the hostname of your Neo4j instance. (Required)
  • NEO4J_USERNAME: Set to the username of your Neo4j instance. (Required)
  • NEO4J_PASSWORD: Set to the password of your Neo4j instance. (Required)
  • QUEUE_DRIVER: Set to sync. (Required)
  • REDIS_PORT: Set to the port your Redis instance is listening on. Usually 6379. (Required)
  • REDIS_HOST: Set to the hostname of your Redis instance. (Required)
  • SESSION_DRIVER: Set to file. (Required)

Frontend

By default, the docker-compose.yml file loads the WordPress theme as a volume for development purposes, but in production, the theme should be included in the image. To do that, open the file frontend/Dockerfile and uncomment line 54, so that it looks like this:

COPY theme /var/www/wordpress/wp-content/themes/networkmap

Then, from within the project folder in a Terminal window, run:

# make build_frontend

This builds a Docker image tagged networkmap-frontend. You may push that to the container repository of your choice for hosting.

Frontend Environment Variables

  • WORDPRESS_DATABASE: Set to the database name of your MySQL instance. (Required)
  • WORDPRESS_DATABASE_USER: Set to the username of your MySQL instance. (Required)
  • WORDPRESS_DATABASE_HOST: Set to the hostname of your MySQL instance. (Required)
  • WORDPRESS_DATABASE_PASSWORD: Set to the password of your MySQL instance. (Required)
  • NETWORKMAP_API_USER: Set to the value specified in DEFAULT_API_EMAIL
  • NETWORKMAP_API_PASS: Set to the value specified in DEFAULT_API_PASSWORD
  • NETWORKMAP_API_ENDPOINT: Set to the hostname of the Backend
  • NETWORKMAP_API_VERSION: Always set to v1

Production Deployment

With the two images built, networkmap-backend and networkmap-frontend, you may configure a production hosting environment modeled after the test one specified in the docker-compose.yml file of this repository.

Table of Contents

  1. About
  2. How to Use IIRMa
  3. Technical Details
    1. Overview
    2. Getting Started
      1. Setup
      2. Deployment
    3. Back End
      1. Data Flow
      2. Database Schemas
      3. Creating New Data Sources
    4. Front End
      1. Data Flow
      2. Caching

The Origins of IIRMa

In 2017, The Case Foundation launched the Impact Investing Network Map, with data partners Impact Space and CrunchBase, to present the best publicly available data on impact investments to better inform the sector of the size, breadth and depth of the impact investing ecosystem. We believed that incorporating engaging data visualizations to display connections between investors and companies would not only bring greater accessibility and transparency to Impact Investing data but would demonstrate growth and inspire action in this catalytic movement.

We are appreciative of the resources and expertise provided by our advisors to build the initial product and their influence can be seen throughout IIRMa. We utilized elements of the CASE Smart Impact Capital, Impact Capital 101: Supply and Demand diagram to help illustrate the flow of capital between the supply and demand side actors. Check out the full video to learn more on capital flows within Impact Investing.

Clone this wiki locally