T420 Development Guide

Complete setup, testing, and deployment guide for the T420 ecosystem

Version: 2.0 (Consolidated) Last Updated: 2026-01-08 Consolidated From: 12 setup guides + QUICKSTART.md + guides/QUICK_START.md


Table of Contents


Prerequisites

Required:

  • Node.js: v18+ (v20 recommended)

  • npm: v9+

  • Git: For version control

For Full Features:

  • Supabase Account: Database access (free tier available)

  • Twilio Account: WhatsApp notifications (optional, $15 free credit)

  • SendGrid Account: Email notifications (optional, free tier available)


Quick Start (5 Minutes)

1. Clone & Install

2. Create .env File

Create .env in project root:

3. Start Development Server

Visit: http://localhost:3000/

That's it! You're running T420 locally.


Environment Configuration

Supabase Setup (Required)

Option 1: Use Existing Project

  1. Go to https://supabase.com/dashboard

  2. Select your project

  3. Go to Settings β†’ API

  4. Copy:

    • Project URL β†’ VITE_SUPABASE_URL

    • anon/public key β†’ VITE_SUPABASE_ANON_KEY

    • service_role key β†’ VITE_SUPABASE_SERVICE_ROLE_KEY

Option 2: Create New Project

  1. Go to https://supabase.com

  2. Click Start your project

  3. Create organization (if needed)

  4. Click New project

  5. Fill in:

    • Name: T420-production (or your choice)

    • Database Password: Generate strong password

    • Region: Choose closest to you

  6. Wait ~2 minutes for provisioning

  7. Copy API credentials (see Option 1)

Product Configuration

Set VITE_PRODUCT to control which app loads:


Database Setup

Apply Schema and RLS Policies

Option 1: Via Supabase Dashboard (Easiest)

  1. Go to https://supabase.com/dashboard/project/YOUR_PROJECT_ID/sql/new

  2. Open database/add-row-level-security.sql

  3. Copy contents

  4. Paste into SQL editor

  5. Click Run

Option 2: Via psql Command Line

Enter your database password when prompted.

Option 3: Via Supabase CLI

Verify Database Setup

Run the check script:

Expected output:


WhatsApp Integration

Optional - Only needed for WhatsApp notifications.

Step 1: Sign Up for Twilio (10 minutes)

  1. Go to https://www.twilio.com/try-twilio

  2. Sign up with your email

  3. Verify your phone number

  4. Get $15 free credit

Step 2: Get Account Credentials

  1. Go to https://console.twilio.com

  2. Look for Account Info section:

    • Account SID: ACxxxxxxxxxxxxxxxx

    • Auth Token: Click "Show" to reveal

  3. Copy both values

Step 3: Set Up WhatsApp Sandbox

  1. Left sidebar: Messaging β†’ Try it out β†’ Send a WhatsApp message

  2. You'll see:

  3. Open WhatsApp on your phone

  4. Send that message to +1 415 523 8886

  5. Receive confirmation message

  6. Your sandbox number: whatsapp:+14155238886

Step 4: Add to .env

Testing WhatsApp (via curl)

Note: Twilio API calls from browser are blocked by CORS. For production, use backend API or Supabase Edge Functions.


Email Configuration

Optional - Needed for magic link authentication.

Step 1: Sign Up for SendGrid (10 minutes)

  1. Go to https://signup.sendgrid.com/

  2. Sign up with your email

  3. Fill out form:

    • Company: "FleetOS" or your name

    • Role: "Developer"

    • Reason: "Transactional Emails"

  4. Verify your email (check inbox)

Step 2: Create API Key

  1. After email verification, go to SendGrid dashboard

  2. Left sidebar: Settings β†’ API Keys

  3. Click Create API Key

  4. Name: FleetOS Production

  5. Permissions: Full Access

  6. Click Create & View

  7. COPY THE API KEY NOW (you can't see it again!)

Step 3: Verify Sender Email

  1. Left sidebar: Settings β†’ Sender Authentication

  2. Click Verify a Single Sender

  3. Fill out form:

    • From Name: FleetOS

    • From Email: your-email@gmail.com

    • Reply To: Same as above

    • Company Address: Your address (required)

  4. Click Create

  5. Check your email and click verification link

  6. Once verified, use that email as VITE_SENDGRID_FROM_EMAIL

Step 4: Add to .env

Test Email

  1. Restart dev server: npm run dev

  2. Go to supplier signup page

  3. Enter your email

  4. Check inbox for magic link


Running the Applications

FleetOS (Zero-Signup Flow)

Set product in .env:

Features:

  • Zero-signup request/response

  • Supplier onboarding

  • Fleet coordination

  • Magic link authentication

Robo-Hub (B2B Marketplace)

Set product in .env:

Features:

  • Shepherd dashboard

  • RFQ management

  • Contract negotiations

  • Zone assignments

Robo-Dapp (Separate Next.js App)

Features:

  • Wallet authentication (MetaMask, WalletConnect)

  • DAO governance

  • On-chain operations


Project Structure


Testing

Manual Testing

FleetOS Zero-Signup Flow:

  1. Visit http://localhost:3000/ (with VITE_PRODUCT=fleetos)

  2. Click "Get My Free Agent Number"

  3. Fill form with email

  4. Check email for magic link

  5. Click link β†’ Should log in

  6. Test service request flow

Robo-Hub Dashboard:

  1. Visit http://localhost:3000/ (with VITE_PRODUCT=robo-hub)

  2. Login as Shepherd

  3. Create RFQ

  4. Test contract flow

Database Verification

API Testing

Use browser console to test services:


Troubleshooting

Common Issues

1. "npm install" fails

2. Supabase connection error

3. Email not sending

Check:

  • SendGrid API key is correct

  • Sender email is verified in SendGrid dashboard

  • API key has "Full Access" permissions

  • Check spam folder

Debug:

4. WhatsApp not working

Remember: WhatsApp calls from browser are blocked by CORS.

Solutions:

  • Test via curl (see WhatsApp section)

  • Use Twilio console test tool

  • Move to backend API for production

Links expire in 24 hours. Request a new one by logging in again.

6. Port 3000 already in use

7. Vite build errors


Production Deployment

Pre-Deployment Checklist

Build for Production

Output: dist/ directory

Deploy to Netlify

Environment Variables for Production

Add to hosting platform:

  • VITE_SUPABASE_URL

  • VITE_SUPABASE_ANON_KEY

  • VITE_SUPABASE_SERVICE_ROLE_KEY

  • VITE_SENDGRID_API_KEY

  • VITE_SENDGRID_FROM_EMAIL

  • VITE_SENDGRID_FROM_NAME

  • VITE_TWILIO_ACCOUNT_SID

  • VITE_TWILIO_AUTH_TOKEN

  • VITE_TWILIO_WHATSAPP_FROM

  • VITE_PRODUCT

Production Database Setup

  1. Create production Supabase project

  2. Apply schema: Run database/add-row-level-security.sql

  3. Run migrations: Execute all files in database/migrations/

  4. Seed data (optional): Run seed scripts if needed

Post-Deployment


Additional Resources

Documentation:

External Resources:


Version: 2.0 (Consolidated) Consolidated From: 12 setup guides + 2 quickstart files Last Updated: 2026-01-08 Maintained By: Development Team

Last updated

Was this helpful?