How mayuresh-22/engagefy works
Project Type and Purpose
• This is a full‑stack web application named “Engagefy” that lets users analyze Instagram engagement metrics.
• It combines a React/Vite‑based frontend, a Node/TypeScript backend (deployed as a Cloudflare Worker via wrangler.toml), Langflow workflows (with custom components), a DataStax Astra DB for storage, and calls out to a third‑party Instagram scraping API plus OpenAI’s GPT for insights.
File Structure
• Top‑level directories:
• langflow/… holds custom Langflow components (DBReadComponent, DBWriteComponent, ScrapperComponent)
• server/… is the backend: TypeScript source, a Langflow service wrapper (services/langflow.ts), package.json, wrangler.toml for Cloudflare Workers
• web/… is the client: React + Vite, TypeScript, TailwindCSS, UI components, utilities
• Configuration files: tsconfig.json in both web and server, .env examples, ESLint, PostCSS, Tailwind, Vite config
• Patterns:
• Separation of concerns between UI, API orchestration, workflow management, and storage
• Langflow used as a micro‑orchestration layer
Pull Architecture Insights from the README
• The README already outlines a high‑level flow:
User → React Frontend → Langflow Workflow → {Instagram Scraper API, DataStax Astra DB, OpenAI GPT} → Insights → Frontend
• Key tech: React, DataStax Astra DB, Langflow, OpenAI GPT, Third‑party Instagram Scraper API
Main Components
a. User Interface
• “User” actor
• “React Frontend” (web/src, Vite)
b. API / Orchestration Layer
• “Server (Cloudflare Worker / Node + Express or native Worker)”
• Internal service “Langflow client” (server/src/services/langflow.ts)
• Custom Langflow components (langflow/custom_components)
c. Data Storage
• “DataStax Astra DB”
d. External Services
• “Instagram Scraper API”
• “OpenAI GPT Model”
e. Workflow Engine
• “Langflow” orchestration environment
Relationships & Data Flow
• User → (HTTP/HTTPS) → React Frontend
• React Frontend → (REST/HTTP) → Server API
• Server API → Langflow client triggers a workflow
• Workflow node: ScrapperComponent → calls Instagram Scraper API → returns raw engagement data
• Workflow node: DBWriteComponent → writes raw data to Astra DB
• Workflow node: DBReadComponent → (optional for cached queries) reads from Astra DB
• Workflow node: GPT integration → sends processed data to OpenAI → returns insights
• Final insights return path: Langflow workflow → Server API → Frontend → User
Architectural Patterns & Principles
• Clear separation: Presentation (frontend), Business Logic & Orchestration (server + Langflow), Data (DB), External Integrations
• Micro‑orchestration via Langflow: custom components encapsulate 3rd‑party calls and storage operations
• Serverless deployment (Cloudflare Workers) for the API layer
Essential Details to Capture
• Custom Langflow components (Scrapper, DBRead, DBWrite) as separate workflow nodes
• The two external service integrations (Instagram Scraper API, OpenAI GPT)
• The role of DataStax Astra DB (write vs. read operations)
• The end‑to‑end flow from user action to insight display