← Vault Index
Source: tools/cadence/cadence-build-guide.md

Web App Build & Deploy Guide

Lessons from the Cadence Project


Overview

This guide documents the complete process of building and deploying a full-stack web application using Claude Code on a Chromebook. The Cadence task management app was built in two sessions totaling approximately 8 hours.

Final Stack:

Live URLs:


Phase 1: Environment Setup (Chromebook)

Enable Linux on Chromebook

  1. Settings → Advanced → Developers → Linux development environment
  2. Turn on and wait for installation

Install Node.js

sudo apt update
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install nodejs -y

Verify:

node --version
npm --version

Install Claude Code

sudo npm install -g @anthropic-ai/claude-code

Authenticate Claude Code

claude

Phase 2: Project Creation

Start a New Project

mkdir ~/project-name
cd ~/project-name
claude

Planning Interview

Claude Code will ask about:

Auto-Approval Settings

Speed up development by allowing Claude Code to auto-approve common commands:


Phase 3: Development Workflow

Starting Development Servers

cd ~/project-name
npm run dev

This typically runs both:

Giving Instructions to Claude Code

Be specific and detailed:

Good instruction:

Add a forgot password feature:
1. POST /api/auth/forgot-password - accepts email, generates reset token
2. POST /api/auth/reset-password - accepts token and new password
3. Add frontend pages for both flows
4. Add "Forgot password?" link on login page

Vague instruction (avoid):

Add password reset

When Claude Code Gets Stuck


Phase 4: Git & GitHub

Initialize Git

git init
git add .
git commit -m "Initial commit"

Create GitHub Repository

  1. Go to https://github.com/new
  2. Create repo (can be private)
  3. Don't initialize with README

Generate Personal Access Token

  1. Go to https://github.com/settings/tokens/new
  2. Name it (e.g., "project-name")
  3. Expiration: 7-90 days
  4. Check repo scope
  5. Generate and copy token

Push to GitHub

git remote add origin https://github.com/USERNAME/REPO.git
git push -u origin master

When prompted:

Subsequent Pushes

git add .
git commit -m "Description of changes"
git push origin master

Phase 5: Deployment

Backend: Railway

Initial Setup:

  1. Go to https://railway.app
  2. Sign in with GitHub
  3. Click New Project → Deploy from GitHub repo
  4. Select your repository
  5. In Settings, set Root Directory to server

Add PostgreSQL:

  1. Inside your project, press Ctrl + K
  2. Type "postgres" and select "Add PostgreSQL"
  3. Click on your backend service → Variables
  4. Click New Variable → Add Reference → select Postgres DATABASE_URL

Required Environment Variables:

VariableValue
JWT_SECRETany-random-string
JWTREFRESHSECRETanother-random-string
NODE_ENVproduction
DATABASE_URL(auto-linked from Postgres)
RESENDAPIKEY(if using email)
RESENDFROMEMAILonboarding@resend.dev

Custom Domain:

  1. Service → Settings → Networking/Domains
  2. Add custom domain (e.g., api.yourdomain.com)
  3. Add CNAME record in your DNS provider

Frontend: Vercel

Initial Setup:

  1. Go to https://vercel.com
  2. Sign in with GitHub
  3. Click Add New Project
  4. Import your repository
  5. Set Root Directory to client
  6. Framework Preset: Vite

Required Environment Variables:

VariableValue
VITEAPIURLhttps://your-api-domain.com

Custom Domain:

  1. Project → Settings → Domains
  2. Add your domain
  3. Add CNAME record: your-subdomain → cname.vercel-dns.com

vercel.json (in client folder):

{
  "buildCommand": "npm run build",
  "outputDirectory": "dist",
  "framework": "vite",
  "rewrites": [{"source": "/(.*)", "destination": "/index.html"}]
}

CORS Configuration

The backend must allow requests from the frontend domain. In server/src/index.js:

app.use(cors({
  origin: ['https://your-frontend-domain.com', 'http://localhost:5173'],
  credentials: true
}));

Phase 6: Troubleshooting

Deployment Not Working?

The #1 Lesson: Sometimes you need to wait. Deployments, DNS, and SSL all take time to sync. If you've done everything right, step away for 10-15 minutes.

Common Issues & Fixes

ProblemSolution
Vercel: "No Output Directory named public"Set outputDirectory to dist in vercel.json
API calls return 404Check VITEAPIURL in Vercel, ensure it includes https://
CORS errorsAdd frontend domain to CORS origin array in backend
"Server error" on registrationCheck all environment variables are set in Railway
Data disappears after deploySwitch from SQLite to PostgreSQL
Login doesn't work after deployRedeploy Vercel without build cache
Git push failsCreate new GitHub token and push manually

Vercel Won't Auto-Deploy?

Manually redeploy:

  1. Go to Deployments tab
  2. Click three dots on latest → Redeploy
  3. Uncheck "Use existing build cache"

Check API Health

curl https://your-api-domain.com/api/health

Should return: {"status":"ok"}

View All Users (Admin)

curl https://your-api-domain.com/api/admin/users

Delete a User (Admin)

curl -X DELETE https://your-api-domain.com/api/admin/users/USER_ID

Test API Endpoint Directly

curl -X POST https://your-api-domain.com/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{"email":"test@test.com","password":"Test1234!"}'

Key Terminal Commands Reference

Navigation

cd ~/project-name          # Go to project folder
pwd                        # Show current directory
ls                         # List files

Claude Code

claude                     # Start Claude Code
exit                       # Exit Claude Code
# Press Esc to interrupt a stuck command

Git

git status                 # Check what's changed
git add .                  # Stage all changes
git commit -m "message"    # Commit with message
git push origin master     # Push to GitHub
git log --oneline -5       # View last 5 commits

View/Edit Files (without nano)

cat filename               # View entire file
cat filename | head -20    # View first 20 lines
cat filename | grep "text" # Search for text in file

Edit Files with sed

sed -i 's/old-text/new-text/' filename

Check if Server is Running

curl https://your-api-domain.com/api/health

Project Checklist

Before Starting

Before Deploying

After Deploying


Costs

ServiceFree Tier
Claude CodeRequires Claude Pro ($20/month)
Railway$5/month credit, then pay-as-you-go
VercelFree for hobby projects
Resend3,000 emails/month free
GitHubFree for private repos

Next Project Template

When starting your next project, tell Claude Code:

Create a [type of app] with:
- React frontend with [specific features]
- Express backend with JWT authentication
- PostgreSQL database
- These main features: [list features]

Use the same monorepo structure as Cadence with /client and /server folders.

Guide created from the Cadence build sessions, January 25-26, 2026