Add Core HR module with PostgreSQL database integration
Features Added
HR Module
- 3-step wizard for HR configuration
- Core HR (mandatory) + 4 optional sub-modules
- Payroll & Compensation
- Time & Attendance
- Compliance & Documents
- Performance & Growth
- Module selection, basic config, and preview/export
Database Layer
- PostgreSQL schema with multi-tenant architecture
- Schema-based namespacing (public + hr schemas)
- Row Level Security (RLS) policies
- 8 tables: organizations, users, org_members, module_registry, departments, positions, employees, employee_roles
- 43+ performance indexes
- Type-safe TypeScript interfaces
- Database client with CRUD helpers and transaction support
- Migration file with sample seed data (2 orgs, 5 employees)
Infrastructure
- Added pg (node-postgres) for database connectivity
- Added dotenv for environment variable management
- Added tsx for TypeScript execution in Node.js
- Created .env.example template
- Updated .gitignore to protect secrets
Documentation
- Comprehensive database README with troubleshooting
- Quick start guide for database setup
- Updated CLAUDE.md with database architecture
- HR module documentation
Technical Notes
- Uses process.env (not import.meta.env) for Node.js scripts
- Dynamic imports required for dotenv in test scripts
- RLS policies use current_setting() for auth (compatible with raw PostgreSQL)
Co-Authored-By: Claude noreply@anthropic.com