Skip to content
This repository has been archived by the owner on Dec 8, 2017. It is now read-only.

Open Opportunities Infrastructure

Dave Cole edited this page Oct 29, 2015 · 2 revisions

The Node.js application (API and front-end website)

The hosted Open Opportunities application spans three environments, which are listed in DEPLOY.md.

The main application is hosted in Cloud.gov, 18F's Cloud Foundry environment. The organization and spaces for each environment are also listed in DEPLOY.md along with information about the configuration variables.

The CF apps use the following Cloud Foundry services:

  • redis-openopps a redis database for session storage
  • s3-midas-assets a user configuration service for AWS S3 credentials (for uploaded photos and attachments)
  • deploy-credentials a user configuration service for the deployment user's credentials
  • psql-openopps the main postgres database for the application
  • env-openopps the configuration variables

File storage

Uploaded files (user photos and file attachments are stored on AWS S3 in the midas-assets bucket in the us-east-1 region. Each file is prefixed by the domain of its environment, such as openopps-test.18f.gov/uploads.

Domains

All domains are managed through AWS Route 53. The test and staging server are covered by the *.18f.gov wildcard configuration for Cloud.gov, and openopps.digitalgov.gov is managed as its own hosted zone.

The production domain also uses an ELB (openopps-prod) to terminate its SSL and balance traffic against the Cloud Foundry instances, following the same configuration for other Cloud Foundry applications.

Cron service

To send time-based reminders, we run a cron task every 15 minutes. Since we want this to execute once across each environment, regardless of how many instances we have in a given environment, we run the script on an external service. We are using AWS Data Pipeline (openopps-cron:2) with a task configured to curl the cron endpoint of the application every 15 minutes. The endpoint is protected by a shared secret token set in the applications configuration service.

Email service

We use Mandrill to send automated email messages from the application.

Monitoring

We use New Relic to monitor the application across environments and troubleshoot things like slow endpoints.