How algowizzzz/docasst works
Project type and purpose
• This is a full-stack “Doc Review Assistant” application:
• Backend: Python Flask app (app/…).
• Frontend: React-based rich-text editor built with Lexical (editor/src/…).
• Storage: Filesystem-based (data/documents, data/uploads) via core/store & core/vfs.
• AI integrations: Claude Vision for PDF→JSON, RiskGPT for chat/Q&A, custom prompt pipelines.
File structure
• Top-level directories:
• app/: Flask application – server.py, routes, socketio handlers, auth, config loader.
• core/: Business logic – agents, suggestion engines, chat history, comment model, template processor, virtual FS.
• tools/: Low-level utilities – file I/O, PDF processor (poppler-utils wrapper), LLM client abstractions.
• web/: Jinja2 templates + static CSS/JS for non-SPA pages and legacy views.
• editor/: React+Lexical source & build config – custom editor components, plugins, UI primitives, API clients.
• config/: JSON/YAML definitions of agents, prompts, templates, and user credentials.
• data/: Persists JSON-ified docs and uploaded files.
• Key architectural cues:
• MVC-style Flask server rendering Jinja2 for initial page loads.
• REST+WebSocket (Socket.IO) endpoints for real-time editing and AI suggestions.
• Modular “core” layer keeps business rules separate from transport.
• Editor as a single-page app bundle served by Flask or static files.
README insights
• Features call out six-section analysis, AI chat, comments, text improvement.
• Quick-start confirms Flask + Lexical-React build pipeline + poppler for PDF.
• User Browser (UI)
• Frontend Editor (React/Lexical bundle)
• Flask Backend
• Core Services
• Tooling Modules
• Filesystem Storage
• External AI Services
b. Relationships and interactions:
• Browser → Editor bundle (served via Flask static route)
• Editor ←→ Flask WebSocket (Socket.IO) for live edits & AI prompts
• Flask REST API endpoints → Core Services (agent.py, ai_suggestions, chat_history)
• Core Services → Tools (pdf_processor, llm_client) → External AI APIs (Anthropic/Claude, RiskGPT)
• Core Services → Filesystem (via core/store & core/vfs) for document persistence
• Flask → Jinja2 Templates (web/templates) for non-editor pages (login, settings)
c. Architectural patterns/design principles:
• Layered architecture: Transport (app/routes) → Business Logic (core) → Persistence (data/)
• Plugin/agent pattern in core for extensibility of analysis phases
• Real-time event-driven editing via Socket.IO
• Clear separation of concerns:
– app/ handles HTTP & auth
– core/ implements domain logic
– tools/ manage 3rd-party integrations
d. Key technologies/frameworks:
• Python, Flask, Flask-SocketIO, Jinja2
• Node.js, React, Lexical Editor
• poppler-utils for PDF parsing
• JSON/YAML configuration
• Socket.IO for real-time comms
• External LLM APIs (Claude Vision, RiskGPT)
Detail
• Sub-components where relevant (e.g., within Core Services, show agent.py vs chat_history vs template_processor).
• WebSocket handler as a distinct element under app/socketio_handlers.py.
• Build step: editor/src → build → served static assets.
• Don’t over-compartmentalize beyond logical layers, but separate each folder as a component.