This guide is specifically designed for Jules AI to quickly set up and work on the Duramation project.
Jules VMs come pre-installed with:
- ✅ Node.js v22.16.0 (matches our requirement)
- ✅ pnpm 10.12.1 (compatible with our 10.22.0 requirement)
- ✅ PostgreSQL client tools
- ✅ Git, curl, and other standard tools
Use this setup script in Jules configuration:
#!/bin/bash
set -e
# Verify Node.js version
echo "Node version: $(node -v)"
echo "pnpm version: $(pnpm -v)"
# Install dependencies
echo "Installing dependencies..."
pnpm install
# Build shared packages first (required before apps can build)
echo "Building shared packages..."
pnpm build:packages
# Generate Prisma client (required for type safety)
echo "Generating Prisma client..."
cd packages/db
pnpm db:generate
cd ../..
# Verify build
echo "Verifying TypeScript compilation..."
pnpm typecheck
echo "✅ Setup complete!"duramation/
├── apps/
│ ├── frontend/ # Next.js 15 Dashboard (Port 3000)
│ └── inngest-app/ # Workflow Engine (Port 3001)
├── packages/
│ ├── db/ # Prisma ORM + Database Schema
│ ├── shared/ # Shared types & utilities
│ ├── integrations/ # Provider integrations (Google, Slack, etc.)
│ ├── eslint-config/ # Linting configuration
│ └── typescript-config/ # TypeScript configurations
└── scripts/ # Build & deployment scripts
pnpm dev # Start all apps in dev mode
pnpm dev:frontend # Start frontend only (port 3000)
pnpm dev:backend # Start backend only (port 3001)pnpm build # Build everything
pnpm build:packages # Build shared packages only
pnpm build:frontend # Build frontend app
pnpm build:backend # Build backend apppnpm lint # Lint all packages
pnpm typecheck # Type check all packages
pnpm format # Format code with Prettiercd packages/db
pnpm db:generate # Generate Prisma client
pnpm db:migrate # Run migrations
pnpm db:studio # Open Prisma StudioNo environment variables are strictly required for:
- Installing dependencies
- Building packages
- Type checking
- Linting
For running the apps, you'll need:
Frontend (apps/frontend/.env):
# Clerk Authentication
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY="pk_test_..."
CLERK_SECRET_KEY="sk_test_..."
# Database
DATABASE_URL="postgresql://user:password@host:port/db"
# Inngest
INNGEST_EVENT_KEY="your_inngest_event_key"
INNGEST_SIGNING_KEY="your_inngest_signing_key"
# Optional: Redis Cache
UPSTASH_REDIS_REST_URL="https://..."
UPSTASH_REDIS_REST_TOKEN="..."Backend (apps/inngest-app/.env):
# Database
DATABASE_URL="postgresql://user:password@host:port/db"
# Inngest
INNGEST_SIGNING_KEY="your_inngest_signing_key"
INNGEST_EVENT_KEY="your_inngest_event_key"
# Clerk
CLERK_SECRET_KEY="sk_test_..."
# Optional: Provider OAuth credentials
GOOGLE_OAUTH_CLIENT_ID="..."
GOOGLE_OAUTH_CLIENT_SECRET="..."The following environment variables exist in your system:
POSTGRES_PRISMA_URL="postgresql://user:password@host:port/db"
UPSTASH_REDIS_REST_URL="your_upstash_redis_rest_url" UPSTASH_REDIS_REST_TOKEN="your_upstash_redis_rest_token"
GOOGLE_OAUTH_CLIENT_ID="your_google_oauth_client_id" GOOGLE_OAUTH_CLIENT_SECRET="your_google_oauth_client_secret"
cd apps/frontend
pnpm dev # Start dev server on port 3000
pnpm lint # Lint frontend code
pnpm typecheck # Check typesKey directories:
src/app/- Next.js App Router pagessrc/components/- Reusable React componentssrc/features/- Feature-specific modulessrc/hooks/- Custom React hooks
cd apps/inngest-app
pnpm dev # Start dev server on port 3001
pnpm update-templates # Sync workflow templates to DBKey directories:
src/inngest/functions/- Workflow definitionssrc/services/- Business logicsrc/lib/- Utilities and helpers
cd packages/integrations
# Edit provider files
pnpm build # Build the packageSolution: Build shared packages first
pnpm build:packagesSolution: Generate Prisma client
cd packages/db
pnpm db:generate
cd ../..Solution: This is a known compatibility issue. Use as any cast:
resolver: zodResolver(schema as any)Solution: Jules has pnpm 10.12.1, project uses 10.22.0 - this is compatible, no action needed
- All code must be fully typed (no
anyexcept for known compatibility issues) - Use strict mode
- Prefer
interfaceovertypefor object shapes - Use
constassertions where appropriate
- Use
'use client'directive for client components - Prefer server components by default
- Use App Router conventions
- Keep components small and focused
- Components: PascalCase (
UserProfile.tsx) - Hooks: camelCase with
useprefix (useWorkflowRealtime.ts) - Utilities: camelCase (
formatDate.ts) - Constants: UPPER_SNAKE_CASE (
MAX_RETRIES)
Currently, the project doesn't have a comprehensive test suite. When adding tests:
# Frontend tests (when implemented)
cd apps/frontend
pnpm test
# Backend tests (when implemented)
cd apps/inngest-app
pnpm testpnpm typecheck # Check for type errors
pnpm lint # Check for linting issues# Frontend logs
cd apps/frontend
pnpm dev # Logs appear in console
# Backend logs
cd apps/inngest-app
pnpm dev # Logs appear in consolecd packages/db
pnpm db:studio # Opens Prisma Studio (requires DATABASE_URL)turbo.json- Turborepo build configurationpnpm-workspace.yaml- Workspace configurationpackages/db/prisma/schema.prisma- Database schemapackages/typescript-config/- Shared TypeScript configs
README.md- Main project documentationapps/inngest-app/ADDING_WORKFLOWS.md- Workflow creation guideapps/inngest-app/INTEGRATION_BEST_PRACTICES.md- Integration patternsSIMPLE_WORKFLOW_SOLUTION.md- Workflow architecture overview
- Docs: https://www.inngest.com/docs
- Key concepts: Functions, Steps, Events, Retries
- Docs: https://nextjs.org/docs
- Key features: App Router, Server Components, Server Actions
- Docs: https://www.prisma.io/docs
- Key commands: generate, migrate, studio
Before submitting changes, ensure:
-
pnpm typecheckpasses -
pnpm lintpasses -
pnpm build:packagessucceeds - No console errors in dev mode
- Changes follow existing code patterns
- Types are properly defined (no
anyunless necessary)
- Zod + react-hook-form compatibility: Some Zod schemas (with
z.coerce.number()orz.record()) requireas anycast inzodResolver() - Next.js auto-generated files: The
.next/directory generates many type warnings - these can be ignored - Prisma client generation: Must be run after schema changes and before type checking
- Always build packages first: Run
pnpm build:packagesbefore working on apps - Use turbo for speed: Turbo caches builds, making subsequent builds faster
- Check diagnostics: Use
pnpm typecheckto catch type errors early - Follow monorepo patterns: Changes in
packages/affect all apps - Hot reload works: Both frontend and backend support hot reload in dev mode
Last Updated: 2025-01-16 Project Version: 1.0.0 Node Version Required: 22.x Package Manager: pnpm 10.x