How pavansai/forage-jpmc-swe-task-2 works
Project type and purpose
• From the README (“JPMC Task 2 starter repo”) and the file tree, this is a small full-stack data-streaming demo.
• The “src” folder is a React/TypeScript single-page application; the top-level “datafeed” folder is a Python microservice that reads a CSV and streams data.
File structure
• Top level:
• package.json, tsconfig.json, public/ & src/ → React/TypeScript frontend
• datafeed/requirements.txt & server3.py → standalone Python “data feed” backend
• test.csv & datafeed/test.csv → static CSVs as the data source
• No monolithic MVC; it’s a two‐component architecture (frontend + backend service) with a file‐based data store (CSV).
Extract insights from README
• Minimal documentation, so architecture must be inferred from folder names and file contents.
• Key behavior: Browser UI (Graph.tsx) uses DataStreamer.ts to get live data from the Python service.
Main components
a. Frontend SPA (React/TypeScript)
• Components: App.tsx, Graph.tsx, DataStreamer.ts
• Static assets: public/index.html, CSS files
• Build toolchain: package.json (npm), Webpack/CRA implied
b. Backend Datafeed Service (Python)
• server3.py (Flask or simple HTTP/WebSocket server)
• requirements.txt for dependencies
• test.csv as the data source
c. Data Source
• CSV files (datafeed/test.csv or top-level test.csv)
d. External Entities
• Developer’s browser or user clients
• (Optional) Static file hosting or Node dev server
Relationships and data flows
• User opens browser → requests index.html (static host or dev server) → bundle.js/CSS delivered
• React App boots → DataStreamer.ts opens HTTP or WebSocket connection to Python service on e.g. localhost:5000
• Python server reads CSV rows → streams JSON payloads over the connection
• Graph.tsx renders streaming data in real time
• HTTP GET for static assets
• API/WebSocket connection from frontend to backend
• File I/O from Python server to CSV
Architectural patterns and design principles
• Component‐based UI (React) separated from data service
• Single responsibility: Python service only handles data streaming, frontend only handles presentation
• Use of static file hosting vs. microservice deployment
• Loose coupling via well‐defined API / WebSocket interface