How yogeshp-code/heartbeat works
Project type and purpose
• This is a monorepo housing a full-stack web application called Heartbeat Portal.
• Purpose: Provide a unified, low-cost dashboard that displays real-time ECS cluster and service metrics across AWS environments.
• Frontend: Next.js + React for UI/UX.
• Backend: FastAPI for REST API endpoints, AWS ECS data retrieval, and JWT-based authentication.
File structure
Top-level
├── backend/ ← FastAPI service
│ ├ Dockerfile
│ ├ main.py ← App entrypoint
│ ├ auth/ ← Authentication module (models, encryption, JWT, database)
│ ├ routes.py ← API route definitions
│ └ requirements.txt
├── frontend/ ← Next.js application
│ ├ Dockerfile
│ ├ app/ ← Next.js App Router pages (login, layout, loading)
│ ├ components/ ← Shared UI library components and theme provider
│ ├ src/ ← React components, contexts (AuthContext), API client, types
│ ├ hooks/ ← Custom React hooks (useMobile, useToast)
│ ├ public/, styles/, config files
│ └ package.json
├── images/
└── readme.md
Extract insights from README
• Monorepo with two subsystems (backend/front).
• Backend authenticates users (JWT) and calls AWS ECS APIs to fetch cluster/service data.
• Frontend consumes backend API, handles login flow, stores JWT, and renders dashboard components.
• Containerized via Docker for portability.
Detail without overthinking
• Decompose each major subsystem into sub-components (Auth, Routes, ECS Client, UI Components, Context).
• Data flow from User → Frontend → Backend → AWS and back.
• Where JWT is generated, stored, and validated.
• Containerization as a deployment concern.