This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
ChittyID is a universal identity verification and management platform built as part of the ChittyOS ecosystem. It provides deterministic, privacy-preserving digital identities with progressive verification, badge collection, and comprehensive audit trails.
# Start development server (runs both frontend and backend)
npm run dev
# Build for production
npm run build
# Run production server
npm run start
# Type checking
npm run check
# Database operations
npm run db:push # Push schema changes to database- Frontend: React 18 + TypeScript + Vite + Wouter routing
- Backend: Express.js + TypeScript
- Database: Drizzle ORM with PostgreSQL (Neon serverless)
- UI Components: shadcn/ui built on Radix UI + Tailwind CSS
- State Management: TanStack Query for server state
/client- React frontend application/src/components- Reusable UI components (shadcn/ui)/src/pages- Page components for routing/src/hooks- Custom React hooks/src/lib- Utilities and configurations
/server- Express backendindex.ts- Server entry point with middleware setuproutes.ts- API route definitionsstorage.ts- Data storage layer (currently in-memory)
/shared- Shared types and schemasschema.ts- Drizzle ORM schema and Zod validation schemas
The backend follows RESTful design with these core endpoints:
- Authentication:
/api/auth/register,/api/auth/login - User Management:
/api/user/:id,/api/user/:id/dashboard - Verification:
/api/verifications,/api/verify-chittyid - Identity Sharing:
/api/user/:id/share,/api/share/:token - Badges:
/api/badges,/api/badges/:badgeId/mint - Network Stats:
/api/stats - Blockchain:
/api/user/:id/verify-blockchain,/api/user/:id/blockchain-verifications - Social Endorsements:
/api/user/:id/endorse,/api/user/:id/endorsements - Biometric:
/api/user/:id/verify-biometric,/api/user/:id/biometric-data
All API requests use JSON payloads with Zod validation schemas defined in /shared/schema.ts.
- Type Safety: Full TypeScript coverage with shared types between frontend and backend via the
/shareddirectory - Path Aliases: Use
@/for client imports and@shared/for shared code - Component Library: All UI components from shadcn/ui are in
/client/src/components/ui/ - Validation: Zod schemas for runtime validation (see
insertUserSchema,updateVerificationSchema, etc.) - Error Handling: Centralized error middleware in Express server
- Styling: Tailwind CSS with custom theme colors (electric blue/mint green) defined in CSS variables
Main tables (defined in /shared/schema.ts):
users- User profiles with ChittyID and trust metricsverification_methods- Multi-step verification tracking (email, phone, government_id, biometric, blockchain, social)badges- Achievement system definitions with NFT support (isNft, contractAddress, tokenId, rarity)user_badges- User-to-badge relationships with NFT minting trackingactivity_logs- Audit trail of user actionsidentity_shares- Secure identity sharing tokensblockchain_verifications- On-chain identity verification recordssocial_endorsements- Peer-to-peer trust endorsementsbiometric_data- Biometric verification templates and metadata
- Server runs on port from
process.env.PORT(default 5000) - Development uses Vite dev server with HMR
- Production build outputs to
/dist - Currently using in-memory storage (
/server/storage.ts) - ready for database integration - Simple password hashing in place - production should use bcrypt
- Session management configured but not fully implemented
- On-chain identity anchoring with wallet signature verification
- Support for multiple chains via chainId parameter
- Automatic "Blockchain Pioneer" NFT badge for verified users
- Transaction hash tracking for on-chain operations
- Peer-to-peer trust endorsements (professional, personal, skill)
- Trust weight system that increases user trust scores
- "Community Endorsed" badge for users with 5+ endorsements
- Public/private endorsement visibility options
- Support for face, fingerprint, and voice biometric types
- Template hashing for secure biometric storage
- Provider integration support for third-party biometric services
- "Biometric Master" NFT badge for verified users
- Select badges can be minted as NFTs
- Rarity tiers: common, rare, epic, legendary
- Transaction hash tracking for minted badges
- Smart contract integration preparation (contractAddress, tokenId fields)