How skygr0u/pfe-dashboard works
Project type and purpose
• This is a full-stack web application providing user management, chat, calendar scheduling, approval workflows, and embedded analytics (PowerBI).
• The Client-Side is a React/TypeScript SPA built with Vite. The Server-Side is a Node.js/Express REST API with MVC-style controllers and services. It integrates with Firebase for authentication, uses a relational (or NoSQL) database (configured in config/config.js), and sends emails for notifications.
File structure
• Top Level:
• Client-Side/ – React app
• Server-Side/ – Express API
• README.md (empty)
• Client-Side patterns:
• src/components, pages, layout, context, hooks, services, firebase – standard React feature folders
• Auth flow (SignIn/SignUp/ProtectedRoute), chat, calendar, pending-approvals, user CRUD, PowerBI embed
• Context providers for Auth, Theme, Sidebar
• Services layer encapsulating HTTP calls to backend
• Server-Side patterns:
• controllers/ – handle HTTP requests
• services/ – business logic (authService, chatService, calendarService, userService, approvalService, emailService)
• routes/ – map URLs to controllers
• middleware/authMiddleware.js – JWT or Firebase token validation
• config/ – DB and Firebase Admin SDK configs
README
• (No content provided – infer from structure)
a. Main components:
1. Browser (React SPA)
2. Vite Dev/Static File Server
3. Express API
4. Database (e.g. PostgreSQL or MongoDB)
5. Firebase Authentication (Firebase Auth service)
6. Email Service (SMTP, e.g. nodemailer or external API)
7. External Analytics (PowerBI)
b. Relationships and interactions:
• Browser ↔ Express API: REST calls for auth, users, chat, calendar, pending approvals
• Express API ↔ Database: CRUD operations via services
• Express API ↔ Firebase Auth: token issuance/verification (via firebase.js admin SDK)
• Express API ↔ Email Service: send password resets, approvals notifications
• Browser ↔ Firebase Auth SDK: initial sign-in & token management
• Browser ↔ PowerBI Embed: iframe or library integration for dashboards
c. Architectural patterns:
• Client: Component-based MVVM with Context for state, Service layer for API calls
• Server: MVC (Routes → Controllers → Services → Data layer)
• Layered architecture separates presentation, business logic, data access
d. Key technologies:
• React, Vite, TypeScript, Context API, React Router
• Node.js, Express, JavaScript
• Firebase Auth SDK (client) & Admin SDK (server)
• Database (configured via config/config.js)
• nodemailer or external email API
• PowerBI JavaScript Embed API
Details
• Subdomains: Authentication flow, User CRUD, Chat messaging, Calendar scheduling, Approval workflow, Analytics embed.
• Token flows: Client obtains Firebase token → includes it in REST headers → authMiddleware validates via Firebase Admin.
• Service responsibilities (e.g. emailService sends notifications).
• Don’t omit folder-level insights: e.g. Context vs. Hooks vs. Services in the client.