How akash-selvaraj/sigil-network-mesh-maker works
Project type and purpose
• This is a full-stack web application called “Sigil”:
• Frontend: Next.js + React + Tailwind CSS
• Backend: Python server (Flask or FastAPI in app.py) running Reinforcement Learning (RL) agents
• Purpose: In flood scenarios, collect and analyze mobile network speed data using RL agents to suggest optimal hotspots, then display the results on an interactive map.
File structure
• Top level
• Configuration: .eslintrc.json, tsconfig.json, tailwind.config.ts, next.config.mjs, postcss.config.mjs
• Project Document, README, .gitignore, VSCode settings
• backend/
• app.py – Python server entry point, defines HTTP endpoints
• dqn_agent.py, q_learning_agent.py – two RL algorithms for hotspot selection
• image.py – utilities for generating or processing heatmap images
• requirements.txt – Python dependencies
• src/app/ (Next.js “app router”)
• layout.tsx – shared page layout
• page.tsx – main UI, fetches data from backend
• Components/HeatMap.tsx – displays the RL-generated heatmap overlay
• Components/SubmitData.tsx – form or button to trigger data collection or analysis
• globals.css, fonts/ – styling
• package.json / lockfiles – Node dependencies (axios, next, react, tailwind, etc.)
Extract architecture insights from README
• Frontend communicates over HTTP (REST or JSON) with the Python backend.
• RL agents are invoked on-demand to analyze new data or re-train policies.
• No external database mentioned; data persistence may be in-memory or flat files.
• Emphasis on real-time responsiveness and visual map overlays.
Main components & their interactions
a. User’s Web Browser (React/Next.js)
b. Next.js Frontend Server (Node.js)
c. Python RL Backend Server (Flask/FastAPI)
d. RL Modules
• Q-Learning Agent
• DQN Agent
e. Heatmap Generator (image.py)
f. (Optional) Data Store or Cache (in-memory or disk)
g. External Services (e.g., mobile speed API, if any)
h. Network (HTTP/JSON)
• Data flow:
1. User visits Next.js UI → Next.js serves React page
2. User triggers data fetch/analysis (SubmitData) → Frontend issues HTTP POST/GET to backend endpoint (/analyze, /heatmap)
3. Backend app.py receives request → selects RL agent (DQN or Q-Learning) → processes input data → generates heatmap image or JSON of hotspot coordinates
4. Backend responds with JSON or URL to generated heatmap
5. Frontend receives response → HeatMap component renders overlay
6. User sees updated hotspot suggestions
Architectural patterns & design principles
• Separation of concerns: UI vs. analysis logic
• Modular RL code: interchangeable agent modules
• Stateless HTTP API for triggering analysis
• Component-based frontend (Next.js app router + React)