This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ChiCo is a property management automation platform built with TypeScript, React, and Express. It provides SMS-based lead automation, tenant communication tools, and visitor entry management for small landlords (1-10 properties).
npm run dev # Start development server (Express + Vite HMR)npm run build # Build client (Vite) and server (esbuild) for production
npm start # Run production servernpm run db:push # Push schema changes to database (Drizzle Kit)npm run check # Run TypeScript type checkingCurrently no dedicated test suite is configured. Type safety is enforced through TypeScript strict mode and Zod validation at runtime.
- Client: React SPA with Vite, located in
/client - Server: Express API server, located in
/server - Shared: Common types and schemas in
/shared - Database: PostgreSQL with Drizzle ORM
- Routing: Wouter for lightweight client-side routing
- UI Components: shadcn/ui components in
/components/ui - Pages: Route components in
/pages(home, dashboard, demo, not-found) - State Management: TanStack Query for server state
- Forms: React Hook Form with Zod validation
- Styling: Tailwind CSS with custom theme variables
- Entry Point:
index.ts- Express server with Vite integration - Routes:
routes.ts- API route registration - Database:
db.ts- Drizzle ORM configuration - Storage:
storage.ts- Database abstraction layer with interfaces - Services:
claude.ts- AI lead categorization with rule-based fallbackopenai.ts- GPT-4o integration for advanced AI featurestwilio.ts- SMS messaging integration with webhook handling
- Session Storage: PostgreSQL-backed sessions
- Vite Integration:
vite.ts- Development middleware and static file serving
Core entities with relationships:
- users: Authentication and profile management
- properties: Property management with user ownership
- tenants: Tenant records linked to properties
- leads: Lead tracking with categorization and urgency scoring
- communications: Message history and interactions
- visitorApprovals: SMS-based visitor entry approval system
@/: Maps to/client/src/@shared: Maps to/shared/@assets: Maps to/attached_assets/
- Neon Database: Serverless PostgreSQL (requires
DATABASE_URL) - Twilio: SMS messaging (requires Twilio credentials)
- OpenAI: GPT-4o for AI features (requires API key)
DATABASE_URL: PostgreSQL connection stringPORT: Server port (default: 5000)- Additional service credentials for Twilio and OpenAI integrations
- The server runs on port specified by
PORTenv var (default 5000) - In development, Vite middleware is integrated with Express for HMR
- In production, static files are served from
dist/public - Database migrations use Drizzle Kit with configuration in
drizzle.config.ts - Replit-specific tooling is conditionally loaded in development
- Services gracefully degrade to demo mode when external credentials are unavailable
- AI features support both OpenAI and Claude services for flexibility and cost optimization