PowerShell Scripts

This directory contains PowerShell scripts used by the setup-gui app to help set up and run projects in the FoodTruckNerds workspace. These scripts are typically used for projects like ftn-site-vercel and other workspace projects that the setup-gui app helps bootstrap.

setup.ps1 — Initial Setup

Sets up the development environment for the project.

Usage:

.\setup.ps1 [options]

Options:

  • -SkipNodeCheck — Skip Node.js version check

  • -SkipCorepack — Skip Corepack setup

  • -SkipDependencies — Skip dependency installation

  • -SkipConvex — Skip Convex setup instructions

  • -CreateEnvFiles — Create template environment files

What it does:

  1. Checks Node.js version (requires 22+)

  2. Enables Corepack

  3. Installs pnpm via Corepack

  4. Installs project dependencies

  5. Provides Convex setup instructions

  6. Optionally creates template environment files

run.ps1 — Development Server

Starts the development server and handles various tasks.

Usage:

.\run.ps1 [options]

Options:

  • -Build — Build the project for production

  • -Production — Start the production server

  • -Lint — Run ESLint

  • -Format — Format code with Prettier

  • -Help — Show help message

Examples:

.\run.ps1              # Start development server
.\run.ps1 -Build       # Build for production
.\run.ps1 -Production  # Start production server
.\run.ps1 -Lint        # Run linting
.\run.ps1 -Format      # Format code

Quick Start

  1. First time setup:

.\setup.ps1 -CreateEnvFiles
  1. Configure environment variables:

    • Edit .env.local with your API keys

    • See the docs for required services

  2. Start Convex dev server (in separate terminal):

npx convex dev
  1. Start the Next.js development server:

.\run.ps1
  1. Open your browser at http://localhost:3000

Prerequisites

  • Node.js 22+

  • PowerShell 5.1+

  • Administrator privileges (for Corepack setup)

Required Services

Before running the app, you’ll need accounts for:

Troubleshooting

Execution policy:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Node.js version:

node --version

Corepack issues: try running PowerShell as Administrator.

Missing dependencies:

.\setup.ps1 -SkipNodeCheck -SkipCorepack

Environment variables to configure in .env.local:

  • Radar SDK keys

  • Convex deployment URL

  • Square API credentials

  • NextAuth secret

  • Encryption key

Notes

  • These scripts are helper scripts used by the setup-gui app when setting up workspace projects

  • Scripts are designed to be run from project directories (e.g., ftn-site-vercel)

  • Keep the Convex dev server running while developing (for projects that use Convex)

  • The development server uses Turbopack (for Next.js projects)

  • All scripts include error checking and helpful messages