Skip to content

Getting started

Will Lin edited this page Sep 28, 2021 · 24 revisions

This guide helps you get started running and interacting with a local development server and tests.

See also Bloom's setup wiki.

Setting up the repo and database

  1. Join GitHub.

  2. Install git on your machine.

  3. Clone the repository.

    Run this in your terminal (and/or refer to this guide):

    git clone [email protected]:CityOfDetroit/bloom.git
    
  4. Decide whether to use the Docker containers to manage postgres and redis or have those services installed directly on your machine.

Installing services directly

  1. Install PostgreSQL
  2. Install Redis

Ensure that both services are running locally before proceeding.

Using Docker containers

  1. Install Docker

  2. Install Docker Compose

  3. Add this line to your ~/.bashrc file for authentication to the postgres container as the correct user:

    export PGUSER=postgres
    
  4. Navigate to the bloom directory that you created when you cloned the repo and run the following:

    docker-compose up redis postgres
    
    • You should see some output indicating that the containers have successfully started.

    • If you wish to stop running the services, you can Ctl-C to kill the processes.

    • If you wish to run the containers in the background and not need to keep the terminal open, kill the previous containers and run:

      docker-compose up -d redis postgres
      

Installing packages

  1. Install npm and node.

    • At the time of editing, this project requires Node 14.
    • For linux machines, install the node package manager using apt:
    sudo apt-get install npm
    sudo npm install -g npm
    
    • If node --version returns anything other than 14, you'll need to install nvm or another way to manage node versions.
    • Follow the instructions for installing and configuring nvm to use Node 14
  2. Install yarn.

    • Install yarn globally by using:
    sudo npm install -g yarn
    
    • Although you could install it locally instead of globally by
  3. Run yarn install:all, which will run yarn install at both the top level and in backend/core.