Skip to content
Language map of the United States
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
language_map
postgres
scripts
.env.dev.sample
.env.prod.sample
.env.test.sample
.gitignore
.travis.yml
LICENSE
Makefile
README.md
docker-compose.prod.yml
docker-compose.yml
locustfile.py

README.md

Language Map of the US

Build Status Donate

This language map of the United States provides insight into multilingualism and language use in the United States.

There are two different geographic areas used: states and PUMAs (Public Use Microdata Areas). PUMAs are contained within states, are built on census tracts and counties, and contain at least 100,000 people.

The app consists of an API written in Elixir and a simple Javascript frontend that consumes the API to visualize and filter the data.

Data

The dataset for this project is the 2012-2016 American Community Survey (ACS) 5-year Public Use Microdata Sample (PUMS).

Requirements

Docker and Docker Compose is the only dependencies required to run the app.

This project expects to be run on a Unix-like environment (uses a makefile) but the make targets are just a convenience (the docker-compose commands can be run directly).

Setup

  1. Create .env file (and add secrets)
    cp .env.dev.sample .env
    
  2. Build and install dependencies:
    make build deps
    
  3. Create database and load it with data:
    make db data
    
    Alternatively, you can run make db-dump which will download a database dump and load it into your database, which should be faster.

Run

To run the app, run make serve. The app should then be running on http://localhost:4000 (or whatever port you set in .env).

Tests

Run tests via make test.

Releases

To make a new release, simply run ./scripts/release.sh and follow the prompts (you will need permissions to the GitHub and the Docker Hub repos).

Deployment

To do a production deploy, you must have Docker and Docker Compose installed on the machine you're deploying to (see Requirements). For deployments, no Docker images should need to be built as they should already exist in Docker Hub (see Releases). Note that the tags for the Docker images correspond to the releases.

To deploy, do the following on the machine you're deploying to:

  1. Download and unzip the latest master:
    wget https://github.com/pcaisse/language-map-us/archive/master.zip
    unzip master.zip
    
  2. Move into new directory:
    cd language-map-us-master
    
  3. Create a production .env file and add secrets:
    cp .env.prod.sample .env
    
  4. Run the deploy script. Note that the script must be run with either the --recreate flag for an initial or "clean slate" deployment (this will drop and recreate the database) or --update to update an existing deployed version.
    ./scripts/deploy.sh --recreate
    
    or
    ./scripts/deploy.sh --update
    

Support

If you'd like to make a donation to help support this project, you can do so via PayPal. Thank you!

You can’t perform that action at this time.