How yukesh4349/finora-ai works
Purpose and entry points
Finora AI is a retail-finance platform combining POS checkout, inventory, vendor invoice processing, fraud checks, reporting, and role-specific operations. The React/Vite client starts at frontend/src/main.jsx and routes through frontend/src/App.jsx. The Express REST API starts at backend/index.js; root scripts orchestrate both runtimes via package.json.
Client application and user workflows
The frontend provides public/authentication views plus focused operational screens for owners and staff. Dashboard composition is centered on business-owner analytics, invoice upload, invoice creation/POS, and specialized embedded modules.
• frontend/src/pages/BusinessOwnerDashboard.jsx
• frontend/src/pages/UploadInvoiceFullPage.jsx
• frontend/src/pages/CreateInvoiceFullPage.jsx
• frontend/src/components/dashboard/PosBillingModule.jsx
• frontend/src/components/dashboard/AiAssistantModule.jsx
Client-side service boundaries separate REST calls and direct Supabase access/configuration:
• frontend/src/services/api.js
• frontend/src/services/supabaseClient.js
• frontend/src/services/postgresDb.js
API composition and authorization
backend/index.js is the API composition root, mounting domain route modules. Authentication and role enforcement form the security boundary before protected financial, inventory, and employee operations.
• backend/routes/auth.js
• backend/middleware/rbac.js
• backend/routes/dashboard.js
• backend/routes/settings.js
Primary route domains split responsibilities across vendors, expenses, payments, transactions, employee/payroll, analytics, and reporting:
• backend/routes/vendors.js
• backend/routes/expenses.js
• backend/routes/payments.js
• backend/routes/reports.js
Invoice intelligence and fraud-control pipeline
Vendor invoice ingestion is a core write path: uploaded document data is scanned through NVIDIA Nemotron Vision with Tesseract fallback, converted into structured invoice/items data, then evaluated for duplicate/anomalous bills before downstream storage and inventory updates. AI assistant requests are exposed separately from document OCR.
• backend/routes/invoices.js
• backend/routes/ai.js
• frontend/src/pages/UploadInvoiceFullPage.jsx
This boundary depends on file upload handling, NVIDIA AI credentials, and potentially outbound webhook processing; document extraction should remain server-side because it uses privileged external AI credentials.
POS, sales, and inventory synchronization
Checkout flows originate in the POS UI, submit customer bills/sales through the API, and deduct stock. Vendor-invoice saves move in the opposite direction by increasing or updating inventory, supplier pricing, MRP, and low-stock state.
• frontend/src/components/dashboard/PosBillingModule.jsx
• backend/routes/customer_bills.js
• backend/routes/inventory.js
• backend/routes/invoices.js
Financial effects are represented through dedicated transaction and payment interfaces rather than being confined to UI state:
• backend/routes/transactions.js
• backend/routes/payments.js
Persistence, runtimes, and external services
Node.js/Express is the backend runtime; React 18/Vite is the browser runtime. PostgreSQL is the system of record through Supabase, with a dual database adapter and SQL schemas defining relational persistence. Supabase credentials include an elevated service-role path, so backend-only usage is a material trust boundary.
• backend/db.js
• backend/supabase_schema.sql
• backend/schema.sql
External dependencies include Supabase PostgreSQL, NVIDIA Nemotron Vision, Tesseract OCR, and configured webhook endpoints. A local fallback dataset exists at backend/data.json, likely supporting development or degraded persistence.
Main entry points: db.js Database adapter · rbac.js Authentication & RBAC · invoices.js Invoice routes · api.js REST client
Components 20
React/Vite Client
- Client entry & routes · Bootstraps the browser app and route composition.
frontend/src/main.jsx - Owner dashboard
frontend/src/pages/BusinessOwnerDashboard.jsx - Invoice upload
frontend/src/pages/UploadInvoiceFullPage.jsx - POS billing
frontend/src/components/dashboard/PosBillingModule.jsx - REST client
frontend/src/services/api.js - Client Supabase access · Direct browser-side Supabase access and configuration.
frontend/src/services/supabaseClient.js
Express API
- API composition root · Mounts domain routes and API middleware.
backend/index.js - Authentication & RBAC · Protects role-scoped financial, inventory, and employee operations.
backend/middleware/rbac.js - Dashboard & settings
backend/routes/dashboard.js - Invoice routes · Accepts vendor invoices and coordinates stock-affecting saves.
backend/routes/invoices.js - AI assistant API · Separates assistant requests from document extraction.
backend/routes/ai.js - Sales & inventory routes · Records checkout bills and maintains stock.
backend/routes/customer_bills.js - Financial routes
backend/routes/payments.js
Invoice Intelligence
- Invoice extraction · Uses server-side vision extraction with OCR fallback.
backend/routes/invoices.js - Duplicate & anomaly checks · Evaluates extracted bills before storage and inventory updates.
backend/routes/invoices.js
Data & External Services
- Database adapter · Backend access includes an elevated service-role trust boundary.
backend/db.js - Supabase PostgreSQL · Relational persistence defined by SQL schemas.
backend/supabase_schema.sql - Vision OCR providers · NVIDIA Nemotron Vision with Tesseract fallback.
- Webhook endpoints
- Local fallback data · Supports local development or degraded persistence.
backend/data.json
Connections 25
- Client entry & routes → Owner dashboard: renders
- Client entry & routes → Invoice upload: routes to
- Client entry & routes → POS billing: hosts
- Owner dashboard → REST client: loads operations data
- Invoice upload → REST client: uploads invoices
- POS billing → REST client: submits checkout
- REST client → API composition root: REST requests
- Client Supabase access → Supabase PostgreSQL: direct client access
- API composition root → Authentication & RBAC: enforces protected access
- Authentication & RBAC → Dashboard & settings: authorizes
- Authentication & RBAC → Invoice routes: authorizes
- Authentication & RBAC → Sales & inventory routes: authorizes
- Authentication & RBAC → Financial routes: authorizes
- Invoice routes → Invoice extraction: processes uploads
- Invoice extraction → Vision OCR providers: extracts document data
- Invoice extraction → Duplicate & anomaly checks: structures invoices
- Duplicate & anomaly checks → Database adapter: persists approved data
- Invoice routes → Sales & inventory routes: updates received stock
- Sales & inventory routes → Database adapter: records sales and stock
- Financial routes → Database adapter: records payments and reports
- Dashboard & settings → Database adapter: reads business data
- AI assistant API → Vision OCR providers: assistant AI requests
- Database adapter → Supabase PostgreSQL: service-role database access
- Invoice routes → Webhook endpoints: optional outbound events
- Database adapter → Local fallback data: fallback