Environment Setup

Local Development

Set up DevStride development on your local machine.

Local Development Setup

This guide walks you through setting up DevStride on your local machine.

Prerequisites

1. Node.js 18+

Install via nvm:

nvm install 18
nvm alias default 18
npm install -g pnpm

2. AWS CLI v2

# macOS
brew install awscli

# Or download from AWS
# https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html

3. Docker

Install from docker.com

4. AWS SSO Access

You'll receive an email invite to https://devstride.awsapps.com/start

Quick Setup with ds init

The easiest way to configure your local environment:

git clone git@github.com:devstride/devstride.git
cd devstride
pnpm install
./ds init
Run ./ds without arguments to see an interactive menu of all available commands.

The init wizard will:

  • Configure your developer name (DEVSTRIDE_STAGE)
  • Set up your AWS SSO profile
  • Add environment variables to your shell
  • Authenticate with AWS
  • Fetch shared secrets to create your .env file

After init completes:

source ~/.zshrc  # Apply shell changes
# Add your DB_CONNECTION_STRING to .env (from Neon Console)
./ds run backend

Manual Setup

If you prefer manual configuration:

1. Add Environment Variables

Add to your ~/.zshrc or ~/.bashrc:

export DEVSTRIDE_STAGE=yourname  # e.g., phil
export AWS_PROFILE=devstride-yourname
export DEVSTRIDE_DEV_PROFILE=devstride-yourname
export DEVSTRIDE_REGION=us-east-1

2. Configure AWS SSO

aws configure sso
# SSO start URL: https://devstride.awsapps.com/start
# SSO Region: us-east-1
# CLI profile name: devstride-yourname

3. Set Up .env

Fetch shared secrets from AWS:

./ds cloud-dev setup-secrets

Or copy .env.sample to .env and ask a team lead for the values.

Important: Add your personal DB_CONNECTION_STRING from Neon Console > Your Branch > Connection Details.

First Run

# Start the backend
./ds run backend

# After deployment completes, stop and run migrations
./ds migrations run

# Set up configuration
./ds script set-config

# Start both services
./ds run backend  # Terminal 1
./ds run ui       # Terminal 2

Running Tests

# Pull DynamoDB image (first time only)
docker pull amazon/dynamodb-local

# Run tests
cd backend && pnpm test

# Run with coverage
cd backend && pnpm coverage

Troubleshooting

AWS Credentials Expired

aws sso login

Database Connection Issues

  1. Verify your Neon branch exists
  2. Check .env has correct DB_CONNECTION_STRING
  3. Test connection: ./ds migrations run

Port Already in Use

The backend runs on port 3000 by default. Kill any existing processes:

lsof -i :3000 | grep LISTEN | awk '{print $2}' | xargs kill -9