How federicocalonso/iebasuite works
1. What this repo is
- This is a React + TypeScript SPA built with Vite for electrical/technical field work.
- The product is organized as a hub of modules: client management, project management, and multiple technical tools that are either available or planned.
- The current implemented focus is on “Mis Clientes” and “Gestión de Proyectos / Relevador de Planta”; many other modules in the README are future placeholders.
2. Top-level application shape
- The app starts in src/main.tsx and is wired through a core shell/router layer in src/core.
- The HubShell, HubRouter, HubHome, and HubProjects components suggest a multi-screen application shell rather than a single-purpose editor.
- LoginScreen and AuthContext indicate that access is gated by authentication, while ClientContext, ProjectContext, ProfileContext, and SymbolsContext provide shared domain state across screens.
3. Primary user-facing subsystems
- Client management: handled by the HubClients area and the projects/ components indirectly through shared project/customer data.
- Project management: HubProjects, ProjectList, ProjectItem, ProjectHeader, and ProjectConfigDialog manage the lifecycle of a project/obra.
- Technical editor: src/screens/EditorScreen.tsx plus the editor/ component set form the main workbench for drawing and configuring a project’s physical installation.
- Future modules: the README lists several upcoming product lines such as pricing, unifilar, compliance forms, grounding, differential tests, thermography, power quality, and low-voltage systems.
4. Editor architecture
- The editor is split into a layout shell (EditorLayout) and a guided creation flow overlay (CreationFlowOverlay), which implies a step-based onboarding/configuration experience.
- The editor uses tabbed domain sections in src/components/editor/tabs/: general, project, walls, openings, circuits, connections, coverage, electrical, and master configuration.
- This indicates the editor is not just a canvas; it is a structured project model editor where geometry, electrical data, and coverage rules are edited in separate bounded areas.
5. Domain-specific visual components
- The component set in src/components/ reflects the object model of the application: WallCard, OpeningCard, CircuitoCard, ConexionCard, ElectricalCard, NetlistReport, MasterView, Preview, and SymbolDialog.
- These components suggest the UI is centered around cards/forms for each domain entity, plus a preview/reporting layer for inspection and output.
- SymbolManagerDialog and SymbolDialog point to a symbol library used by the editor and project rendering.
6. State and data flow
- The core state flow appears to be: Firebase-backed services → contexts → hooks → components.
- src/hooks/ centralizes interaction patterns such as editor state, app actions, zoom/pan, toast notifications, project installation, and project list loading.
- useEditorState, useAppActions, and useUIState likely separate domain editing, command execution, and presentation state so the editor remains manageable.
7. Backend and persistence boundaries
- The src/firebase/ folder contains clientService, profileService, projectService, and symbolService, which are the main persistence boundary.
- firebase/config.ts indicates Firebase is the external backend, likely handling auth plus project/client/symbol storage.
- ClientContext and ProjectContextCore likely wrap these services so UI components do not talk to Firebase directly.
8. Rendering and geometry pipeline
- src/lib/geometry.ts, layout.ts, renderer.ts, and symbols.ts are the computational core for the editor.
- This suggests a pipeline where the application transforms project data into layout/geometry structures and then into rendered visuals or reports.
- src/types/measurements.ts, project.ts, reports.ts, symbols.ts, ui.ts, and user.ts define the shared contract between the backend, editor, and reporting layers.
9. PWA / offline and deployment characteristics
- The presence of public/manifest.json, public/icons/, and generated service worker files in dev-dist/ indicates the app is built as a PWA-capable static frontend.
- useProjectInstallation and the service worker assets imply support for installable/offline-friendly behavior.
- .github/workflows/deploy.yaml points to a CI/CD deployment of the static build.
10. UI system and composition
- The UI is organized into reusable primitives in src/components/shared/ and styling in src/styles/.
- There is a clear distinction between shared modal/form infrastructure and domain-specific cards/dialogs.
- This means the architecture favors composition over monolithic screens, with domain screens built from shared dialogs, form fields, and cards.
11. Feature segmentation and readiness
- The README’s status column shows the repo is structured as a platform with multiple product modules, but only some are implemented today.
- The existing codebase mainly supports the project/client/editor workflow, while other compliance/reporting tools are planned but not yet part of the main runtime path.
- For an architecture diagram, it would be accurate to show those future modules as planned branches off the same hub, not as active execution paths.
12. How the main runtime likely works
- User logs in through the auth layer.
- The hub loads client/project lists from Firebase-backed services.
- Selecting or creating a project opens the editor shell.
- The editor builds up the project via tabs, dialogs, and cards, using shared state hooks and geometry/rendering helpers.
- Project artifacts and configuration are persisted back through the Firebase service layer, with the UI reflecting changes via contexts and hooks.
Main entry points: EditorLayout.tsx Editor Layout · geometry.ts Geometry Core · HubShell.tsx Hub Shell · HubProjects.tsx Projects
Components 26
App Shell
Entry, authentication, routing, and hub screens.
- Main · Vite/React bootstrap into the app.
src/main.tsx - Router · Top-level route and screen selection.
src/core/HubRouter.tsx - Hub Shell · Application frame and shared navigation chrome.
src/core/HubShell.tsx - Auth · Authentication gate and login screen.
src/core/AuthContext.tsx - Login · Sign-in entry screen.
src/core/LoginScreen.tsx - Hub Home · Landing area for module selection.
src/core/HubHome.tsx
Operations
Client and project management surfaces.
- Clients · Client management hub.
src/core/HubClients.tsx - Projects · Project list and project lifecycle hub.
src/core/HubProjects.tsx - Project List · Selectable project collection and listing UI.
src/components/projects/ProjectList.tsx - Project Header · Project summary and actions header.
src/components/projects/ProjectHeader.tsx - Project Item · Single project row/card representation.
src/components/projects/ProjectItem.tsx - Future Tools · Planned product branches such as pricing, unifilar, compliance, grounding, and testing tools.
src/features/relevador/RelevadorTool.tsx
Editor Workbench
Project modeling, drawing, and technical review.
- Editor Screen · Main technical workbench for a project.
src/screens/EditorScreen.tsx - Editor Layout · Editor frame and content composition.
src/components/editor/EditorLayout.tsx - Creation Flow · Guided setup overlay for new project creation.
src/components/editor/CreationFlowOverlay.tsx - Editor Tabs · Bounded editing areas for the project model.
src/components/editor/tabs/GeneralTab.tsx - Domain Cards · Entity-specific cards and dialogs for walls, openings, circuits, connections, and electrical data.
src/components/WallCard.tsx - Preview & Report · Visual preview and netlist/report inspection.
src/components/Preview.tsx - Symbols · Symbol selection and management for editor rendering.
src/components/SymbolDialog.tsx
Platform
Persistence, shared state, geometry, and PWA/deployment support.
- Contexts · Shared app/domain state for auth, clients, projects, profiles, and symbols.
src/core/ProjectContextCore.tsx - Hooks · Editing, UI, zoom/pan, toast, and project-loading orchestration hooks.
src/hooks/useEditorState.ts - Firebase Services · Backend boundary for client, profile, project, and symbol storage.
src/firebase/projectService.ts - Geometry Core · Layout, geometry, rendering, and symbol computation pipeline.
src/lib/geometry.ts - Types · Shared domain contracts for projects, measurements, reports, symbols, UI, and users.
src/types/project.ts - PWA Assets · Manifest, icons, and service worker assets for installable/offline behavior.
public/manifest.json - Deploy · CI workflow for static build deployment.
.github/workflows/deploy.yaml
Connections 29
- Main → Router: boots · App bootstrap hands control to routing.
- Router → Auth: gates · Routing is wrapped by authentication.
- Auth → Login: shows · Unauthenticated users land on login.
- Auth → Hub Shell: unlocks · Authenticated access enters the shell.
- Hub Shell → Hub Home: hosts · The shell provides the main landing area.
- Hub Shell → Clients: opens · Shell routes into client management.
- Hub Shell → Projects: opens · Shell routes into project management.
- Projects → Project List: contains · Project screen is centered on list selection.
- Projects → Project Header: contains · Project screen includes summary/actions header.
- Project List → Project Item: renders · Project list is composed of project items.
- Project List → Editor Screen: opens · Selecting a project leads to the editor.
- Editor Screen → Editor Layout: wraps · Editor screen is structured by the editor layout.
- Editor Layout → Creation Flow: overlays · Creation flow guides initial project setup.
- Editor Layout → Editor Tabs: organizes · Tabbed sections organize the project model.
- Editor Layout → Domain Cards: composes · Layout combines entity cards and dialogs.
- Editor Layout → Preview & Report: shows · Layout includes preview and reporting output.
- Editor Layout → Symbols: uses · Editor consumes the symbol library.
- Editor Tabs → Geometry Core: feeds · Tab edits drive layout and geometry computation.
- Domain Cards → Geometry Core: feeds · Entity edits update derived geometry and electrical structure.
- Preview & Report → Geometry Core: reads · Preview/report output is produced from computed structures.
- Contexts → Firebase Services: wraps · Contexts mediate backend services.
- Hooks → Contexts: consumes · Hooks operate on shared domain state.
- Hooks → Geometry Core: drives · Editor and UI hooks coordinate computed views.
- Firebase Services → Types: persists · Backend data is shaped by shared contracts.
- Geometry Core → Types: uses · Computation layer relies on shared domain types.
- Symbols → Firebase Services: loads · Symbol management persists through Firebase services.
- PWA Assets → Deploy: delivered by · PWA assets are included in the static deployment.
- Future Tools → Hub Home: branches from · Planned modules sit beside the core hub.
- Future Tools → Projects: shares data · Future tools are expected to reuse project context.