How afloresc/pm_flow_dashboard works
Purpose and Entry Points
PRO-FLOW is a single-page enterprise project-management dashboard for task execution, timelines, resource capacity, reporting, and AI-assisted audits. The browser enters through index.html and mounts React in src/main.tsx; src/App.tsx owns the authenticated application shell and workspace/view selection. server.ts is the Node/Express runtime entry point for development middleware, production static hosting, and backend API routes.
Authentication and Role Boundary
src/components/AuthScreen.tsx provides Firebase-backed sign-up/sign-in plus local demo sessions. Firebase mode delegates identity to Firebase Authentication and persists user roles in Firestore; demo mode stores a mock session in browser local storage. The app uses shared domain and role definitions from src/types.ts, allowing manager/member permissions to gate editing and allocation-oriented actions.
Project Data Synchronization
src/hooks/useProjectData.ts is the client data boundary and synchronization engine. It reads and writes project entities—including tasks, subtasks, resource allocations, logs, and comments—against Cloud Firestore for live collaboration, while providing LocalStorage fallback behavior when cloud access is unavailable. src/firebase.ts initializes the Firebase Auth and Firestore SDK clients used by this layer.
Workspace Modules
src/App.tsx composes the major operational views:
• src/components/TaskTracking.tsx: task CRUD, checklists, progress, logs, and discussion activity.
• src/components/GanttChart.tsx: expected-versus-actual schedule visualization and task navigation.
• src/components/ResourceAllocation.tsx: personnel/material registry, costs, assignments, and workload/overload indicators.
• src/components/AutomatedReporting.tsx: project exports, AI audit invocation, and AI-report export.
These components consume the shared project state rather than directly defining persistence infrastructure.
AI Audit Server Boundary
Gemini access is intentionally server-side: src/components/AutomatedReporting.tsx submits project/audit context to API routes exposed by server.ts. The Express layer uses the Gemini SDK and GEMINI_API_KEY environment secret, preventing that credential from reaching the browser. Returned audit results identify schedule risks, bottlenecks, cost variance, and potential resource reallocation; the client displays and exports the resulting report.
Runtime and Deployment Infrastructure
The frontend runs on React 19, TypeScript, Vite, MUI, Tailwind, Motion, and Lucide. vite.config.ts configures the frontend build; server.ts serves Vite during development and built static assets in production. Firebase deployment/project configuration and data-access policy are represented by firebase.json, firebase-blueprint.json, and firestore.rules. Node.js 18+ is the material runtime; Firebase Authentication, Cloud Firestore, and Gemini are the external managed services.
Security and Persistence Boundaries
Browser code may access Firebase through src/firebase.ts under Firestore rules in firestore.rules; durable authorization must therefore be enforced by Firebase policies rather than UI role checks alone. Server-only Gemini credentials belong in environment configuration (.env.example) and are mediated by server.ts. LocalStorage is a resilience/demo store, not an authoritative collaborative data source.
Main entry points: App.tsx App shell · AuthScreen.tsx Auth screen · firebase.ts Firebase client · server.ts Express server
Components 19
Browser app
React dashboard and client data boundary.
- HTML entry
index.html - React mount
src/main.tsx - App shell · Owns authenticated workspace and view selection.
src/App.tsx - Auth screen · Supports Firebase identities and local demo sessions.
src/components/AuthScreen.tsx - Domain roles · Manager/member permissions gate client actions.
src/types.ts - Project sync · Synchronizes project entities with cloud storage or local fallback.
src/hooks/useProjectData.ts - Firebase client
src/firebase.ts - Task tracking · Tasks, checklists, progress, logs, and comments.
src/components/TaskTracking.tsx - Gantt chart · Expected-versus-actual schedule view.
src/components/GanttChart.tsx - Resource allocation · Assignments, costs, and workload indicators.
src/components/ResourceAllocation.tsx - Automated reporting · Exports projects and invokes AI audits.
src/components/AutomatedReporting.tsx - LocalStorage · Resilience and demo storage, not collaborative authority.
Node server
Hosting and server-side AI boundary.
- Express server · Serves Vite/static assets and exposes backend API routes.
server.ts - Vite build
vite.config.ts - Gemini API key · Kept out of browser code.
.env.example
Managed services
Firebase and Gemini services.
- Firebase Auth
- Cloud Firestore · Live project data and user roles.
- Firestore rules · Enforces durable browser data access authorization.
firestore.rules - Gemini API · Receives server-mediated audit requests.
Connections 20
- HTML entry → React mount: loads
- React mount → App shell: mounts
- App shell → Auth screen: authenticates through
- App shell → Project sync: uses shared state
- App shell → Task tracking: composes
- App shell → Gantt chart: composes
- App shell → Resource allocation: composes
- App shell → Automated reporting: composes
- Auth screen → Domain roles: uses roles
- Auth screen → Firebase client: uses
- Auth screen → LocalStorage: demo session
- Project sync → Firebase client: uses
- Project sync → LocalStorage: fallback
- Firebase client → Firebase Auth: authenticates with
- Firebase client → Cloud Firestore: reads and writes
- Firestore rules → Cloud Firestore: authorizes access
- Automated reporting → Express server: AI audit API
- Express server → Gemini API: invokes audit
- Gemini API key → Express server: configures
- Vite build → Express server: development middleware