How omeraqeel/docunest works
Project type and purpose
• This is a full-stack web application. The front-end is a React single-page application (SPA) bootstrapped with Create React App (Vite + React + Tailwind CSS), and the back-end is a Python service (likely Flask or FastAPI) exposing RESTful endpoints for authentication, file processing, and relevance scoring.
• The README confirms standard CRA scripts; the file tree shows React code under src/, a Python backend under backend/, and JSON/config files at the root.
File structure
• Top-level:
• backend/ – Python modules:
– main.py (entry point, API routes)
– jwtAuthentication.py (JWT‐based auth middleware)
– models.py (data models, ORM)
– file_processing.py (file ingestion, parsing)
– relevance_scoring.py (business logic, ranking algorithms)
• src/ – React code:
– Components/ & ui/ – reusable UI components
– Pages/ – route-based pages (Chat, Dashboard, Workspace, Profile, SignIn, SignUp)
– store/ – Redux store slices (userSlice.js)
– hooks/, lib/, layout.jsx – app wiring, utilities, routing
• public/, index.html, package.json, tailwind.config.js, vite.config.js – front-end build/config
• No explicit database config file is shown, but models.py indicates a data persistence layer (could be PostgreSQL, SQLite, etc.).
• JWT auth and CORS will be configured in the Python backend.
README
• No mention of WebSocket or external AI services, so assume all logic lives in the Python backend.
a. Main components:
• Client (Web Browser)
• Front-end SPA (React + Vite + Tailwind)
• Back-end API Server (Python app)
• Authentication module (JWT)
• Business logic (file processing, relevance scoring)
• Data persistence (Database, File storage)
b. Relationships & interactions:
1. Client loads index.html → React SPA served (either from static host or backend)
2. SPA dispatches REST calls to the API server over HTTPS
3. User signs up / signs in → SPA calls POST /auth → JWT returned → SPA stores token
4. Subsequent API calls include JWT header → backend middleware validates token
5. For file upload/listing: SPA → backend/file_processing endpoints → files written to storage, metadata in DB
6. For relevance scoring: SPA → backend/relevance_scoring endpoints → backend applies algorithms → response returned
7. Data layer: backend ↔ database (CRUD via models.py)
c. Architectural patterns & design principles:
• SPA architecture with clear separation of concerns (UI components, routing, state management)
• RESTful API pattern in the backend
• JWT‐based stateless authentication
• Modular Python services for business logic (single-responsibility modules)
• Redux or Context for client state
d. Key technologies/frameworks:
• React, Vite, Tailwind CSS on the front end
• Python (Flask or FastAPI), PyJWT, ORM (SQLAlchemy or similar) on the back end
• Redux Toolkit for state management
• JSON config files (jsconfig.json, components.json) for feature flags or metadata
Elements
• Browser → Frontend (initial load)
• Frontend → Backend (REST calls with JWT)
• Backend → Database (ORM calls)
• Backend → Frontend (JSON responses)
• Green for API endpoints/business logic
• Orange for data stores