How 24f1000966/nexus-ai-ecommerce-analyst works
Nexus AI is a multi-tenant business-analysis platform. Companies register with identity and document details; a Super Admin reviews and approves them, after which company admins manage members and data and approved users query the analyst. The API is the runtime hub: it routes requests to role-specific services and scopes analytics to the caller’s tenant. The analyst combines SQL analytics, policy retrieval, charts, and optional LLM answer-writing. The README also documents admin audit/usage capabilities and a retained Streamlit analyst. Relationships are limited to source references and documented behavior; some unsampled page-to-endpoint details are not expanded.
Main entry points: api.js API client · main.py API and analytics entry · agent.py Agent reasoning · auth.py Registration and login
Components 26
Web application
- Routes and shell
frontend/src/App.jsx - Session and roles
frontend/src/auth/AuthContext.jsx - API client
frontend/src/api.js - Company registration
frontend/src/pages/RegisterPage.jsx - Company review
frontend/src/pages/AdminPage.jsx - Analyst dashboard
frontend/src/pages/AnalystPage.jsx - Team management
frontend/src/pages/TeamPage.jsx - Data workspace
frontend/src/pages/DataPage.jsx - Fallback analyst UI
streamlit_app.py
Identity and review
- Registration and login
backend/routers/auth.py - Application checks
backend/verification.py - JWT and access control
backend/security.py - Review and audit
backend/routers/admin.py
Company workspace
- Membership service
backend/routers/company.py - Uploads and documents
backend/routers/data.py - Tenant selection
backend/tenant_data.py
Data analyst
- API and analytics entry
backend/main.py - Agent reasoning
app/agent.py - Policy retrieval
app/rag.py - Chart generation
app/charts.py - LLM provider adapter
app/llm_backend.py
Persistence
- Tenant analytics store
app/db.py - Platform records
backend/models.py - Database sessions
backend/database.py
Other components
- Company users
- Platform owner
Connections 35
- Company users → Routes and shell: uses
- Platform owner → Routes and shell: reviews
- Routes and shell → Session and roles: provides session
frontend/src/App.jsx - Session and roles → API client: loads identity
frontend/src/auth/AuthContext.jsx - Company registration → API client: submits application
frontend/src/pages/RegisterPage.jsx - Company review → API client: requests review
frontend/src/pages/AdminPage.jsx - Analyst dashboard → API client: asks questions
frontend/src/pages/AnalystPage.jsx - Team management → API client: manages members
frontend/src/pages/TeamPage.jsx - Data workspace → API client: manages data
frontend/src/pages/DataPage.jsx - API client → Registration and login: calls auth endpoints
frontend/src/api.js - API client → Review and audit: calls review endpoints
frontend/src/api.js - API client → Membership service: calls member endpoints
frontend/src/api.js - API client → Uploads and documents: calls data endpoints
frontend/src/api.js - Registration and login → Application checks: checks formats
backend/routers/auth.py - Registration and login → JWT and access control: hashes and issues tokens
backend/routers/auth.py - Review and audit → Application checks: uses checks
backend/routers/admin.py - Review and audit → JWT and access control: enforces roles
backend/routers/admin.py - Membership service → JWT and access control: enforces roles
backend/routers/company.py - Uploads and documents → JWT and access control: enforces roles
backend/routers/data.py - API and analytics entry → Registration and login: registers router
backend/main.py - API and analytics entry → Review and audit: registers router
backend/main.py - API and analytics entry → Membership service: registers router
backend/main.py - API and analytics entry → Uploads and documents: registers router
backend/main.py - API and analytics entry → Tenant selection: selects caller tenant
backend/main.py - API and analytics entry → Agent reasoning: dispatches questions
backend/main.py - Agent reasoning → Tenant analytics store: queries data
app/agent.py - Agent reasoning → Policy retrieval: retrieves context
app/agent.py - Agent reasoning → LLM provider adapter: requests answer writing
app/agent.py - Agent reasoning → Chart generation: builds charts
- Tenant selection → Tenant analytics store: builds tenant data
backend/tenant_data.py - API and analytics entry → Platform records: logs questions
backend/main.py - API and analytics entry → Database sessions: opens sessions
backend/main.py - Database sessions → Platform records: persists records
backend/database.py - Fallback analyst UI → Agent reasoning: uses analyst
streamlit_app.py - Fallback analyst UI → Chart generation: uses charts
streamlit_app.py