How jasminpradhan/owlex_smart_financial_advisor works
What this project is (type + purpose)
Owlex is a full-stack web application:
• Frontend: React SPA that renders dashboards, calculators, charts, profile, and a chatbot UI
• Backend: Flask REST API with modular structure (auth/routes/models/utils) and an AI “agent” layer using LangGraph orchestrating Gemini Flash 2.0
• Database: SQLite for persistence (likely users/auth + profile data + maybe chat history/preferences)
• Static/seed data: backend/data/market_data.json for market comparisons or recommendation inputs
Frontend boundary (frontend/)
Key cues:
• src/pages/* → page-level routes: login, registration, dashboard
• src/dashboard/* → dashboard subviews: overview, returns
• src/components/* → feature components:
• chatbot.js (chat UI)
• calculators (fd.js, mfunds.js, lscagr.js)
• marketcomp.js, riskprofilesug.js, profile.js, etc.
• src/utils/private_route.js and src/utils/userContext.js → auth gating + user session context
• Charts: Chart.js/Recharts (not visible as files, but in README)
Architecture implication: a React SPA with protected routes that calls Flask endpoints; visual analytics are client-rendered.
Backend boundary (backend/)
Key cues:
• backend/main.py → likely entrypoint to run Flask
• backend/backend/app.py → Flask app factory / app setup
• backend/backend/auth.py → authentication blueprint/routes
• backend/backend/bot_routes.py → chatbot endpoints (API surface for AI)
• backend/backend/models.py → ORM/data models (likely SQLite-backed)
• backend/backend/utils.py → helpers (token handling, validation, etc.)
• backend/agent/agent.py → AI agent workflow; LangGraph orchestration; Gemini calls
• backend/backend/database.db → SQLite database file
• backend/data/market_data.json → local market dataset for comparisons/recommendations
Architecture implication: Flask API with at least two main route groups: Auth and Bot/AI; models persist to SQLite; agent is a separate module invoked by bot routes.
Shows: React app, Flask API, SQLite DB, Market JSON data, Gemini (external), LangGraph agent module.
Shows: Flask app → Blueprints (auth.py, bot_routes.py) → services (agent.py) → persistence (models.py/SQLite) + static data (market_data.json) + external Gemini.
At minimum:
• Login/registration flow
• Chatbot conversation / recommendation flow
This repo is small enough that “separating into as many components as possible” is feasible and will improve precision.
Frontend ↔ Backend (REST)
• React pages/components → Flask endpoints
• Login/Registration pages → /auth/* routes
• Dashboard components → endpoints for profile/returns/market comparisons (if implemented)
• Chatbot component → /bot/* routes
Backend → Database
• auth.py and/or profile endpoints → models.py → SQLite
(store users, hashed passwords, risk profile, preferences, maybe chat history)
Backend → AI Agent → External LLM
• bot_routes.py → agent/agent.py (LangGraph workflow) → Gemini API
• Then response flows back: Gemini → agent → bot_routes → frontend chatbot UI
Backend → Market Data
• bot_routes.py or dashboard endpoints → read market_data.json
(used for market comparison / context for recommendations)
Architectural patterns to explicitly annotate
• SPA + REST API: React client consumes Flask JSON endpoints.
• Flask modularization via Blueprints: auth routes and bot routes are separated.
• Agentic workflow boundary: LangGraph-based orchestration is a distinct “service module” within the backend.
• External AI provider integration: Gemini is not part of your deployable system; it’s an external dependency.
• SQLite for development persistence: show as a single DB (and optionally note “dev-only” in label).
• “React SPA (MUI, Chart.js/Recharts)”
• “Auth (private routes via JWT/session)”
• “Flask Blueprints: auth.py, bot_routes.py”
• “Agent: LangGraph workflow (agent.py)”
• “SQLite (dev)”
• “Market dataset (JSON)”
• “External LLM API: Gemini Flash 2.0”
Agent (LangGraph) optionally pulls
• user profile from SQLite (models)
• market context from market_data.json
Practical “don’t overthink” checklist (repo-grounded)
• Frontend exists: frontend/src/* (pages, components, utils)
• Backend routes exist: backend/backend/auth.py, backend/backend/bot_routes.py
• Agent exists: backend/agent/agent.py (LangGraph/Gemini per README)
• Persistence exists: backend/backend/database.db, backend/backend/models.py
• Market dataset exists: backend/data/market_data.json