Welcome to the Jose Madrid Salsa developer docs — explore features, APIs, and deployment guides.
Jose Madrid SalsaJMS Docs

Development Setup

Full development environment setup walkthrough for Jose Madrid Salsa

Development Setup

This guide walks you through setting up a complete local development environment for the Jose Madrid Salsa platform.

Prerequisites

  • Node.js 18+ (recommended: 20 LTS)
  • PostgreSQL (local or cloud instance)
  • Git

Quick Start

Clone and Install

git clone https://github.com/your-org/josemadridsalsa.git
cd josemadridsalsa
npm install

The postinstall script automatically runs prisma generate to create the Prisma client.

Configure Environment

Copy the example environment file and fill in values:

cp .env.example .env.local

At minimum, set these variables:

# Database
DATABASE_URL="postgresql://user:pass@localhost:5432/josemadrid"

# Auth
NEXTAUTH_URL="http://localhost:3000"
NEXTAUTH_SECRET="generate-a-random-32-char-string"

# Encryption
MASTER_KEY="$(node -e "console.log(require('crypto').randomBytes(32).toString('hex'))")"

Set Up Database

Run Prisma migrations and seed the database:

npm run db:migrate     # Run migrations
npm run db:seed        # Seed base data

Additional seed scripts for specific data:

npm run db:seed:recipes         # Seed recipe content
npm run db:seed:nutrition       # Seed nutritional info & ingredients
npm run db:seed:email-templates # Seed email templates

Create Admin User

npm run create-admin

Follow the prompts to set email and password for your admin account.

Start Development Server

npm run dev

This starts Next.js with Turbopack on http://localhost:3000. The dev script uses next dev --turbo for fast refresh.

Project Structure

prisma.ts
auth.ts
rbac.ts
stripe.ts

Available Scripts

npm run dev          # Start with Turbopack
npm run dev:fast     # Start on port 3000 explicitly
npm run dev:debug    # Start with Node inspector
npm run clean        # Clear .next cache
npm run fresh        # Clean + reinstall + dev
npm run db:migrate   # Run pending migrations
npm run db:push      # Push schema changes (dev only)
npm run db:seed      # Seed database
npm run db:studio    # Open Prisma Studio GUI
npm run db:reset     # Reset database (WARNING: destructive)
npm run db:generate  # Regenerate Prisma client
npm run db:diagnose  # Diagnose connection issues
npm test             # Run Vitest tests
npm run type-check   # TypeScript type checking
npm run lint         # ESLint
npm run build        # Production build
npm run start        # Start production server
npm run analyze      # Project analysis

Tech Stack

TechnologyPurpose
Next.js 16App Router framework
React 19UI library
TypeScript 5Type safety
Prisma 6ORM / database client
PostgreSQLDatabase
Tailwind CSS 4Styling
StripePayments and tax
ResendEmail delivery
NextAuth.js 4Authentication
VitestUnit testing
PlaywrightE2E testing
Zod 4Schema validation
ZustandClient state management
TurbopackDev bundler

Optional Services

These services enhance functionality but the app runs without them:

# Payments
STRIPE_PUBLISHABLE_KEY="pk_test_..."
STRIPE_SECRET_KEY="sk_test_..."

# Email
RESEND_API_KEY="re_..."

# File uploads
UPLOADTHING_TOKEN="..."

# Shipping
SHIPPING_API_KEY="..."

# Analytics
NEXT_PUBLIC_AMPLITUDE_API_KEY="..."
NEXT_PUBLIC_GOOGLE_ANALYTICS_ID="G-..."

# Error tracking
SENTRY_DSN="..."

Graceful Degradation

The platform is designed to run without most external services. Missing API keys trigger console warnings, but the app continues to function with fallback behavior (e.g., zero tax, free shipping, skipped emails).

Database Connection

The Prisma client in lib/prisma.ts uses lazy initialization and supports multiple connection URL formats:

  1. DATABASE_URL (primary)
  2. PRISMA_DATABASE_URL (Prisma Accelerate)
  3. POSTGRES_URL (Vercel Postgres fallback)

For Prisma Accelerate connections (URLs starting with prisma://), the client automatically enables the Accelerate extension.

IDE Setup

VS Code

Recommended extensions:

  • Prisma
  • ESLint
  • Tailwind CSS IntelliSense
  • Pretty TypeScript Errors

Path Aliases

The project uses @/ as the root alias, configured in tsconfig.json:

{
  "compilerOptions": {
    "paths": {
      "@/*": ["./*"]
    }
  }
}

Troubleshooting Setup

ProblemSolution
DATABASE_URL is not setCheck .env.local exists with valid DATABASE_URL
Prisma client errorsRun npm run db:generate then restart dev server
Migration failuresRun npm run db:diagnose for connection diagnostics
Port 3000 in useUse npm run dev:fast or kill the existing process
Type errors after pullRun npm run db:generate && npm run type-check

How is this guide?

Edit on GitHub

Last updated on

On this page