This document provides comprehensive information for Claude AI when working on this VibeCode Template project.
This is a full-stack web application template designed for rapid side project development with:
- Frontend: React + TypeScript + Vite + TailwindCSS + shadcn/ui
- Backend: Node.js + Express + TypeScript
- Database: PostgreSQL (via Neon) + Drizzle ORM
- Authentication: Firebase Auth
- File Storage: Firebase Storage with secure file management
- Payments: Stripe Checkout (simplified payment flow)
- Email: SendGrid
- Deployment: Optimized for quick deployment
The project focuses on backend business logic testing:
- Server tests: Located in
server/__tests__/ - Test configuration:
jest.config.cjsconfigured for server-side testing only - Test environment:
.env.testfile for test-specific environment variables
Available Test Commands:
npm test- Run all backend tests sequentially (default, low CPU usage ~20%)npm run test:parallel- Run tests with 2 parallel workers (faster but more CPU)npm run test:quick- Run without coverage analysis (faster, less memory)npm run test:single <file>- Run a specific test file
When developing:
- Use
npm run test:single <file>for testing specific features - Use
npm testfor full backend test verification
Tests use extensive mocking to avoid external dependencies:
- Firebase Auth/Storage mocked in
jest.setup.js - Database operations mocked via Drizzle ORM mocks
- Stripe API mocked to prevent real charges
- SendGrid mocked to prevent email sending
TypeScript import.meta.env errors:
- Already configured in
jest.config.cjswith global mocks - Client tests have Vite environment variables pre-configured
ESM module errors (wouter, regexparam):
- Handled via
transformIgnorePatternsin Jest config - Uses
extensionsToTreatAsEsmfor proper module handling
Mock hoisting errors:
- Define mock variables before
jest.mock()calls - Order matters due to Jest's hoisting behavior
The project uses Drizzle Kit for database migrations. Configuration is in drizzle.config.ts.
Available Commands:
npm run db:generate- Generate new migration files when schema changesnpm run db:migrate- Apply pending migrations to the databasenpm run db:push- Push schema directly to database (use for rapid development)npm run db:studio- Open Drizzle Studio UI for database explorationnpm run db:check- Check migration status and consistency
Migration Workflow:
- Make changes to schema in
shared/schema.ts - Run
npm run db:generateto create migration files - Review generated SQL in
server/migrations/ - Run
npm run db:migrateto apply changes to database
Development vs Production:
- Development: Use
npm run db:pushfor quick iterations - Production: Always use
db:generate+db:migratefor version-controlled migrations
Important Notes:
- Migrations are stored in
server/migrations/ - Migration files use timestamp prefixes (format: YYYYMMDDHHmmss)
- Never edit migration files after they've been applied
- Always review generated SQL before applying migrations