Skip to content

Running the App Locally

Maria Paz Abarca edited this page Jul 17, 2024 · 2 revisions

Connecting the Web App to PostgreSQL

After setting the .env file with the proper keys and installing the project dependencies, follow these steps to connect your web app to PostgreSQL:

  1. Install PostgreSQL
    Use brew install postgresql or download it here.

    If you prefer to use a database management interface, you can install postgres.app.

  2. Install Redis
    Use brew install redis or download it here.

  3. Create the Database
    Create the database db owned by dbuser (refer to POSTGRESQL_DB & POSTGRESQL_USER keys in the .env file).

  4. Create Tables
    Use the file ./create-tables.sql to create the tables by running:

    psql -h localhost -U dbuser -d db -f path/to/create-tables.sql
    

    To verify the created tables, run:

    psql -h localhost -U dbuser -d db
    

    And once connected, list the tables with

    \dt
    
  5. Start the Redis server Start the Redis server with:

    brew services start redis
    

    Verify that Redis is running

    redis-cli ping
    

    If Redis is running, it should return PONG.

  6. Run the solution Finally, run the solution with:

    npm run dev