Renewa One
Building renovation management system for energy-efficient building upgrades. Manages the full lifecycle from lead intake through scenario planning, quoting, funding applications, and project execution.
Tech Stack
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite, TypeScript, TailwindCSS 4, Shadcn/ui |
| Backend | Bun, Hono, TypeScript, OpenAPI |
| Database | PostgreSQL (Fly.io managed), Drizzle ORM, Atlas migrations |
| Infrastructure | Docker, Fly.io, nginx, PgBouncer, Upstash Redis |
| CI/CD | GitHub Actions, image-based promotion |
Architecture
- Architecture Overview — System diagram and monorepo structure
- Backend Architecture — Hono framework, DI container, layered design
- Frontend Architecture — React 19, component library, state management
- Database Architecture — PostgreSQL, Drizzle ORM, 140 tables
- Shared Layer — Cross-cutting types, constants, validation
- Deployment Pipeline — Image promotion, PR previews, Fly.io
Entities
Core domain objects persisted in PostgreSQL:
| Domain | Pages |
|---|---|
| CRM | Leads, Contacts, Companies |
| Projects | Projects, Buildings, Scenarios, Building Components, Measures |
| Finance | Quotes, Invoices, Products, Funding Programs, Funding Applications |
| Documents | Documents, Document Obtaining, PDF Templates, Files |
| Operations | Users, Departments, Appointments, Audit Logs |
| Automation | Workflows, Forms |
Features
- Authentication — JWT-based auth with argon2id password hashing
- Portal — External stakeholder access (document upload, appointments)
- HubSpot Integration — Bidirectional CRM sync with webhook validation
- Form Builder — Dynamic form creation and submission
- Document Review — Document request and approval workflow
- Scenario Planning — Building renovation scenario comparison
- Energy Calculations — Energy demand and savings calculations
- Financial Calculations — Cost estimation and ROI analysis
- RBAC Authorization — Role-based access control per project
- Admin Dashboard — System administration and user management
- Feedback System — In-app user feedback collection
- Notifications — Email and SMS notifications
Patterns
- Coding Guidelines — TypeScript strict mode, naming conventions
- Service Layer Pattern — Business logic encapsulation
- Component Decomposition — Splitting large components (600+ lines)
- State Management — React Query, Zustand, URL state, forms
- React Query Pattern — Key factories, query modules
- URL State Management — Deep-linkable tabs, filters, modals, sorting
- API Layer Pattern — Frontend API client organization
- Dependency Injection — Backend DI container via Hono context
- Error Handling Pattern — Structured errors, API error responses
- Validation Pattern — Zod schemas, sanitization, LocalizedText
- Background Jobs — Async processing and scheduled tasks
- Middleware Stack — Security, CORS, rate limiting, auth
Infrastructure
- Docker Setup — Compose stack, isolated worktree environments
- Makefile Commands — Development workflow shortcuts
- CI-CD Workflows — 20 GitHub Actions workflows
- Database Migrations — Atlas-based schema management
- Database Seeding — Deterministic seeds with UUID namespaces
- Security Scanning — Trivy, Semgrep, Gitleaks, npm audit
- Git Workflow — Worktrees, branch naming, PR rules
- PR Preview Deployments — Ephemeral Fly.io apps per PR
- Scripts — Developer tooling and automation
Frontend
- Pages Overview — 96 page components
- Component Library — 623+ components, Shadcn/ui base
- Hooks — 43 custom hooks
- Routing — React Router v7 configuration
- Internationalization — German/English bilingual support
- Query Modules — 35 TanStack Query modules
Backend
- Routes Overview — 164 route files, OpenAPI specs
- Services Overview — 98 service files
- Backend Middleware — 10 middleware modules
- Library Utilities — 126 utility modules
- External Integrations — Third-party service connectors
Integrations
- HubSpot Integration — CRM sync, OAuth, webhooks
- DocuSign — Electronic signature workflows
- Azure Entra — Identity provider (SSO)
- Dataverse — Microsoft Dataverse connector
- Resend Email — Transactional email delivery
- MessageBird SMS — SMS notifications
- Sentry — Error tracking and performance monitoring