How williamrolando88/scientech-private works
Main System Components
a) Frontend Layer:
• Next.js Application (src/pages)
• Component Structure
• Dashboard Components
• Auth Components
• Shared Components
• Theme System (src/lib/theme)
b) Core Business Logic Layer:
• Modules (src/lib/modules)
• Balance Calculator
• Document Parser
• Import Calculator
• Double Entry Accounting
c) Service Layer:
• Firebase Services
• Authentication
• Firestore Database
• Custom Services (src/services)
d) Data Layer:
• Types and Schemas (src/types, src/lib/schemas)
• Constants and Enums
Component Relationships
Key interactions:
Client Browser → Next.js Pages → Components → Services → Firebase
• ↓
• Business Logic
• ↓
• Data Layer
Specific Implementation Details
Crucial elements:
a) Authentication Flow:
• Login Component → AuthGuard → Firebase Auth
• RoleBasedGuard for permissions
b) Data Flow:
• Firestore Collections
• Cache Hooks (src/hooks/cache)
• Query Management
Key Subsystems to Highlight
a) Dashboard Modules:
• Import Calculator
• Document Parser
• Balance Calculator
• Sales/Purchases Management
b) Authentication System:
• Guards
• Role Management
• Firebase Integration
Integration Points
Connections:
• Firebase Configuration
• API Endpoints
• External Service Integration
Development Environment
Configuration elements:
• Environment Variables
• Build Process
• Deployment Flow
This will provide a clear understanding of the system's architecture while maintaining enough detail for implementation guidance.