How sritechprojects/cavista_hackathon works
Main Components
• Frontend (Client):
• Located in the “client” directory.
• Built using a modern JavaScript framework (React, based on file naming like App.jsx and component structure).
• Organized around several pages and layouts for different user roles (auditor, seller, supplier, and general forms).
• Contains assets, utilities, contexts (AuthContext, UserContext), and state management modules.
• Backend (Server):
• Resides in the “server” directory.
• Likely implemented in Node.js (evidenced by files like app.js and usage of packages via package.json).
• Organized into controllers based on domains (HealthCareInventory, Suppliers, admin, orders, products, seller) and includes configuration files (TokenVerify.js, authorize.js, emailSender.js).
• Uses Prisma as an ORM for database interactions (found in server/prisma and server/lib/prisma.js).
• Filtering/Recommendation API:
• Housed in the “api” directory containing Python scripts (collab_filtering.py and content_filtering.py).
• These components are likely used as specialized modules that offer recommendation or filtering functionality to the main backend.
• Supporting Documents & Configurations:
• “documents” directory contains JSON files (customer.json, product.json, seller.json) which might be used as seed data or test data.
• Other configuration files (e.g., .gitignore, environment variables in server/.env) set up the deployment and build environment.
Relationships and Data Flow
• The Client interacts with the Backend via RESTful API calls (or possibly other API protocols), sending user actions (logins, product reviews, etc.) and receiving responses that update the UI.
• The Backend acts as the central orchestrator:
• It handles API calls from the frontend.
• It processes requests by routing them through various controllers (for authentication, order processing, product management, etc.).
• It interacts with the database (via Prisma) for CRUD operations.
• It may invoke the Python scripts from the “api” folder to perform recommendation filtering tasks.
• The Filtering API (Python scripts) can be depicted as a specialized service that the backend calls to enhance the recommendation and content filtering functionality.
Architectural Patterns and Technologies
• Modular Separation: The project shows a clean separation by isolating the frontend, backend, and filtering components. This modular setup follows common microservices or service-oriented architecture patterns, though all parts are maintained in one code repository.
• Role-based Layouts and Components: In the client, multiple layouts and page components are designed for different user roles (auditor, seller, supplier) indicating a role-based access design.
• ORM and Database Abstraction: The use of Prisma indicates that the system relies on an abstraction layer for robust database operations.
• API Integration: The presence of distinct API folders (one in Python for filtering and one in Node.js for typical REST endpoints) shows a polyglot approach—leveraging the strengths of different languages for specific tasks.