📗
UpGrade Platform - Documentation
6.0
6.0
  • UpGrade Overview
  • Creating an Experiment
    • Unit of Assignment
    • Simple Experiment
    • Factorial Experiment
    • Inclusion and Exclusion
    • Schedule and Post-Rule
    • Exporting Experiment Data and Design
  • Creating a Feature Flag
  • How UpGrade Works
  • Researcher Guide
  • Developer Guide
    • ⚡Quick Start: Running UpGrade Locally with Docker
    • ⚡Quick Start: Running locally w/o Docker
    • UpGrade + AdapComp (Mooclet) in Docker
    • 🚶‍♀️Walkthroughs
      • Your Application and UpGrade
      • Example 1: A Quiz Web App
      • Example 2: An Online Math Game
    • 📚Reference
      • API
      • Client Libraries
        • TypeScript / JS
          • Class: UpgradeClient
          • Class: Assignment
          • SDK Interfaces
            • Interface: IMetric
            • Interface: IExperimentUser
            • Interface: IExperimentUserAliases
            • Interface: ILog
            • Interface: IMarkExperimentPoint
            • Interface: IMetric
            • Interface: IRequestOptions
            • Interface: IResponse
            • Interface: IUser
            • Interface: IUserGroup
      • Environment Variables
        • Frontend Environment
        • Backend Environment
      • Context Metadata
      • Metrics
      • Setting up Google-Auth
      • API Authorization
      • Data Architecture
    • 👨‍💻Contributing Code
      • Branching Workflow (Git-Flow)
      • Pull Request Expectations
    • 😅Troubleshooting
      • Relation ‘experiment_condition’ already exists
      • User not found. Authorization error
      • Token is not present in the request header
      • nodemon exits without explanation
      • Unable to find New Relic module configuration
      • No email received for export data
      • Opening a new tab in UpGrade prompts for re-authorization
      • Error: Cannot find module 'upgrade_types' (or a type from 'upgrade_types' does not exist)
  • Glossary
Powered by GitBook
On this page
  • Local setup (w/o docker)
  • macOS
  • Linux
  1. Developer Guide

Quick Start: Running locally w/o Docker

PreviousQuick Start: Running UpGrade Locally with DockerNextUpGrade + AdapComp (Mooclet) in Docker

Local setup (w/o docker)

If the dockerized approach is a no go, or you want to run things manually, these instructions should help (they are a bit dated, but should get you most of the way there!)

macOS

Backend

  1. Make sure you have node.js installed. If not, and follow the installation instructions.

  2. Download and install the latest release of Postgres from

  3. Open Postgres and click "Initialize".

  4. Click "Server Settings" and change the name to "dev".

  5. Download and install Datagrip from

  6. Open Datagrip and click "New Project".

  7. Enter "PostgreSQL" as a new project name and click "OK".

  8. Click "+" -> "Data Source" -> "PostGreSQL".

  9. Enter "postgres" for the "User" field and click "OK".

  10. Open the Terminal and run node -v to check the version of node installed on your system.

  11. If the version is not 16.15.0, run the following commands to install this version:

    sudo npm install -g n sudo n 16.15.0

  12. Run the following commands in the Terminal: git clone https://github.com/CarnegieLearningWeb/UpGrade.git (Note: If you don't have git, install it using using the command: brew install git) cd UpGrade/backend/packages/Upgrade cp .env.example .env

  13. Open the ".env" file, find the "TYPEORM_SYNCHRONIZE" variable and set it to false, and find the “ADMIN_USERS” variable and add your account email address to it.

  14. Open the "src/config.json" file and add your email and role under the "adminUsers" key.

  15. Open your terminal and type cd ~/UpGrade/backend Run the command npm ci in this directory. Then type cd ~/UpGrade/backend/packages/Upgrade Run the command npm ci in this directory as well. (These commands are to be used only during the initial setup to install dependencies)

  16. Once the above command finishes, run the following command in the "backend/packages/Upgrade" directory: npm run dev

  17. After a few seconds, you should see a message "Aloha, your app is ready on http://localhost:3030/api" in the Terminal console.

  18. If you open in your browser, you should see something like the following on the page:{"name":"A/B Testing Backend","version":"2.0.0","description":"Backend for A/B Testing Project"}

Frontend

  1. In your Terminal window, type cd ~/UpGrade/frontend/ Then, run the following command in the Terminal: npm ci (This is used only during the initial setup to install dependencies)

  2. Once the above command finishes, run the following command: npm run start

  3. After the login, you should see the "Experiments" page with a welcome message, and two buttons to import or add an experiment.

Note:- After running both the frontend and backend, check DataGrip "{db-name} -> postgres -> public -> tables -> user" to verify whether your email has admin access.

Linux

Backend

  1. Install PostgreSQL client: sudo apt install postgresql-client

  2. Install PostgreSQL server: sudo apt install postgresql-server

  3. Steps to create a PostgreSQL database for upgrade user

    1. run sudo -u postgres psql(it will start postgress and show 'postgres#').

    2. run CREATE USER ${username} PASSWORD '${password}';

    3. run CREATE DATABASE ${DatabaseName};

    4. run GRANT ALL on DATABASE ${DatabaseName} to {username};

    5. run ALTER USER {username} with Superuser;

    6. run CREATE extension "uuid-ossp";

    7. \q to exit

  4. Open Datagrip and click "New Project".

  5. Enter "PostgreSQL" as a new project name and click "OK".

  6. Click "+" -> "Data Source" -> "PostGreSQL".

  7. Enter "postgres" for the "User" field and click "OK".

  8. Open the Terminal and run node -v to check the version of node installed on your system.

  9. If the version is not 16.15.0, run the following commands to install this version:

    sudo npm install -g n sudo n 16.15.0

  10. Run the following commands in the Terminal:git clone https://github.com/CarnegieLearningWeb/UpGrade.git cd UpGrade/backend/packages/Upgrade cp .env.example .env Note: Install git if you don’t have it, using the command:

    sudo apt-get install git

  11. Open the ".env" file, find the "TYPEORM_SYNCHRONIZE" variable and set it to false, and find the “ADMIN_USERS” variable and add your account email address to it.

  12. Open your terminal and change your directory to "backend" once and also to "backend/packages/Upgrade" directory. Run the following command in both: npm ci (To be used only during the first setup time to install the dependencies)

  13. Once the above command finishes, run the following command in "backend/packages/Upgrade" directory: npm run dev

  14. After a few seconds, you should see a message "Aloha, your app is ready on http://localhost:3030/api" in the Terminal console.

Frontend

  1. In your Terminal window, type cd ~/UpGrade/frontend/ and run the following command in the Terminal: npm ci (To be used only during the first setup time to install the dependencies)

  2. Once the above command finishes, run the following command: npm run start

  3. After the login, you should see the "Experiments" page with a welcome message, and two buttons to import or add an experiment.

Note:- After running both the frontend and backend, check DataGrip "{db-name} -> postgres -> public -> tables -> user" to verify whether your email has admin access.

After a few seconds, your default browser would automatically launch and display the login page. Or you can open in your browser and log in with your account.

Install Postgres database in your system (version 11 or above. Link: ).

Download and install Datagrip from

If you open in your browser, you should see something like the following on the page:{"name":"A/B Testing Backend","version":"2.0.0","description":"Backend for A/B Testing Project"}

After a few seconds, your default browser would automatically launch and display the login page. Or you can open in your browser and log in with your account.

⚡
download here
https://postgresapp.com/downloads.html
https://www.jetbrains.com/datagrip/download/#section=mac
http://localhost:3030/api
http://localhost:4200
https://www.postgresql.org/download/linux/
https://www.jetbrains.com/datagrip/download/#section=linux
http://localhost:3030/api
http://localhost:4200