CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Development Commands
Core Development
npm run start:dev- Start development server with watch mode (port 3000)npm run worker:dev- Start background worker in development mode (port 4001)npm run build- Build the application for productionnpm run start:prod- Start production server
Development Tools
npm run type:check- Run TypeScript type checking without emitting filesnpm run lint- Run ESLint with auto-fix on source filesnpm run eslint:check- Run ESLint check without fixingnpm run format- Format code with Prettiernpm run prettier:check- Check Prettier formattingnpm run prettier:write- Write Prettier formatting
Testing
npm test- Run unit tests with Jestnpm run test:watch- Run tests in watch modenpm run test:cov- Run tests with coverage reportnpm run test:e2e- Run end-to-end tests
CLI Commands
npm run cli- Run CLI commands (uses nest-commander)npm run cli:dev- Run CLI in development mode
Database
- Database migrations are handled by Prisma
npx prisma generate- Generate Prisma client (runs automatically on postinstall)npx prisma migrate dev- Run database migrations in development
Architecture Overview
Application Structure
This is a NestJS-based microservice for a parking/event pricing program with three main entry points:
- Main API Server (
src/main.ts) - REST API running on port 3000 - Background Worker (
src/worker.ts) - Queue processing worker on port 4001 - CLI Interface (
src/cli.ts) - Command-line tools using nest-commander
Core Modules
Data Processing Pipeline:
modules/data/event-matcher/- Core event matching and pricing logicmodules/data/skybox/- Integration with Skybox ticket platformmodules/data/ticketmaster/- Ticketmaster API integrationmodules/data/tickops/- TickOps service integration
Infrastructure:
modules/db/- Database service (PostgreSQL via Prisma)modules/worker/- Background job processing with BullMQmodules/cache/- Redis caching layerscrapers/- Web scraping services (Firecrawl, Playwright, etc.)
External Integrations:
- Skybox API for ticket inventory
- Ticketmaster Discovery API for event data
- MeiliSearch for full-text search
- Redis for caching and job queues
- SmartSuite for workflow management
Key Technologies
- Framework: NestJS with Express
- Database: PostgreSQL with Prisma ORM
- Queue System: BullMQ with Redis
- Search: MeiliSearch
- Monitoring: OpenTelemetry, Sentry, Pino logging
- Authentication: Google OAuth + JWT
- Validation: Joi for environment variables, class-validator for DTOs
Configuration
Environment variables are validated using Joi schema in src/config.ts. Required variables include database, Redis, API keys for external services, and authentication secrets.
Background Processing
The application uses BullMQ for background job processing. View the job dashboard at http://localhost:3000/queues when running locally.
Docker Setup
Use docker-compose up -d to start required services (database, Redis) for local development.