Skip to main content

Backend Prereqs

This page outlines the tools and setup required before running any OSU Sustainability Office backend projects locally.

What you need

IDE

Use any editor you like. VS Code works great.

  • If using VS Code, make sure you install extensions that are relevant to the repository (Vue, ESLint, Prettier, etc.)

NVM / Node.JS

Using a version manager makes switching Node versions seamless.

Docker

Yarn (required only for wiki development)

Install after Node is set up. You may have to re-run this if you switch NodeJS versions with NVM as listed below.

  • npm install --global yarn

AWS Setup

Used for deploying serverless backends.

info

AWS CLI and SAM CLI can be installed immediately, but you cannot configure credentials until OSU IT activates your account.

warning

Some AWS instructions may become outdated as AWS updates its policies or UI. Always cross-check with Official AWS IAM Docs

Step 1: Account Setup

Step 2: Create IAM User

  • Go to IAM Users
  • Click Add User
    • Name format: yourname-cli
    • Check both AWS Console Access and Password options
    • Copy permissions from an existing user ending with -cli (e.g., samantha-cli)
  • Finish creation, and note your temporary password.

Step 3: Create Access Keys

AWS CLI

Used to verify AWS credentials.

Run after installation:

  • aws configure
    • Fill in all details (refer to IAM section for Access Key ID and Secret Access Key)
    • Region: us-west-2
    • Output Format: json

MySQL Workbench

Used for debugging database.

Step 1: Download MySQL Workbench

Step 2: Create a new connection using the + icon

Step 3: Setup MySQL

  • Select the energy_data schema
  • Limit to 50,000 rows to avoid it taking too long
  • Run test query, e.g. select * from data order by time DESC;
  • Click the lightning symbol to run query. sql example

Get Project Running Locally

Step 1: Start Docker Desktop (Backend will not work without Docker running)

Step 2: Open two terminal windows in the project directory.

Terminal 1 (Backend)

cd backend

npm install (first time only)

sam local start-api

Terminal 2 (Frontend):

npm install (first time only)

npm run serve
note

Need both backend and frontend running for it to work.

Current Issues and Planning

Check shared google drive: