How siriknikita/poly-micro-frontend-demo works
Project type and purpose
• This is a single-page React application (SPA) whose purpose is to serve as the frontend UI for managing microservices: authentication, testing, monitoring, CI/CD pipelines, and release management.
• It does not include its own backend code; it depends on external microservice APIs and leverages an in-browser IndexedDB for local data.
File structure
• Top-level folders:
• src/components – feature-based UI modules (auth, help, monitoring, pipelining, releases, testing)
• src/context – React Context providers for global state (Guidance, Project, Release, Toast)
• src/db – Dexie wrapper for IndexedDB (db.ts, seeding/reset scripts)
• src/hooks – reusable custom hooks for data fetching and UI logic
• src/utils – utilities around release management and sync
• Configuration files for Vite, Tailwind, TypeScript, ESLint, Vitest, GitHub Actions, Vercel, Docker/SonarQube.
README insights
• Tech stack: React 18 + TypeScript, Vite, Tailwind, React Router, React Context, Dexie (IndexedDB), Vitest, Recharts, React Toastify.
• Features: JWT-based auth; AI-assisted testing; real-time monitoring; CI/CD pipeline visualization; release management.
• Patterns: SOLID principles in React, feature-based organization, separation of concerns (hooks vs components), context API for global state.
Main components
A. Frontend SPA (hosted on Vercel or CDN)
• React app entry (main.tsx → App.tsx)
• Feature modules: Auth, Testing, Monitoring, Pipelining, Releases, Help
• Shared UI services: React Router, Context Providers, Toast notifications
• Local storage: IndexedDB via Dexie (src/db/db.ts)
B. External Services / APIs
• Auth API – issues JWTs, role-based ACL
• Test Service API – AI test generation, execution results
• Monitoring API – streaming metrics, logs
• Pipeline Orchestrator API – fetch pipelines, trigger builds/deploys
• Release Management API – versioning, changelogs
C. CI/CD & DevOps (for the repository)
• GitHub Actions – lint, test, build, release workflows
• Docker & SonarQube – static analysis (optional)
D. Local Developer Tools
• Vite dev server
• Vitest runner
• ESLint / Prettier
• Docker-Compose for SonarQube
Relationships and data flows
1. User interacts with Browser → SPA UI
2. SPA UI:
• Retrieves/stores session data & cached entities in IndexedDB
• Calls Auth API for login/register; receives JWT → stored in context
• Calls Test API, Monitoring API, Pipeline API, Release API
• UI updates via React Context + hooks; charts via Recharts
3. All API calls attach JWT in headers → backend microservices
5. GitHub Actions push build artifacts to Vercel; trigger documentation updates
Architectural patterns & design principles
• Feature-based modularization: each domain (auth, monitoring, testing, pipelining, releases) in its own directory
• Separation of concerns:
• UI components render only presentation
• Business logic & data fetching in custom hooks
• Global state in React Context providers
• Constants & utilities extracted to dedicated modules
• SOLID: components follow SRP; open-closed via props; Liskov in interchangeable buttons; DI via hooks & contexts
• Offline-first / caching: Dexie (IndexedDB) for UX stability
• Component labels: Auth Service, Test Service, Monitoring Service, Pipeline Orchestrator, Release Manager
• Annotations for protocols (HTTP, WebSocket) and data formats (JSON, JWT)