How pannagamd/maska-storage works
Purpose and Entry Points
MaskaStorage is a RAG knowledge-management platform: users ingest URLs/PDFs, then query their stored content in natural language. The current executable backend entry point is FastAPI in backend/app/main.py; the browser client mounts React in frontend/src/main.jsx and renders the app from frontend/src/App.jsx.
Client Boundary
The React/Vite frontend owns presentation, interaction state, and HTTP calls only; it must not access databases or execute AI processing. Its main application boundary is frontend/src/App.jsx, with styling/bootstrap support in frontend/src/App.css and frontend/src/main.jsx. It is expected to expose upload, archive, and chat experiences against backend contracts.
HTTP API and Coordination Layer
FastAPI routes receive requests and delegate work through dependency/service boundaries rather than embedding domain logic. Defined endpoint surfaces are:
• Upload ingestion: backend/app/api/routes/upload.py
• Chat/RAG queries: backend/app/api/routes/chat.py
• Archive access: backend/app/api/routes/archive.py
• Health checks: backend/app/api/routes/health.py
Shared injection/auth-related boundaries are backend/app/api/dependencies.py and backend/app/core/security.py. backend/app/main.py composes the API application.
Ingestion Pipeline
The intended upload control flow is URL/PDF submission → extraction → cleaning → chunking → embeddings → summarization/metadata → persistence. The API upload route is present at backend/app/api/routes/upload.py, but the planned AI, service, schema, and retrieval directories described in the README are not present in this tree. Those missing layers are the primary implementation gap between HTTP ingestion and storage.
Retrieval and Chat Pipeline
The intended chat flow is question → query embedding → ChromaDB similarity search/top-k ranking → prompt construction → LLM answer → response, coordinated by the backend rather than the frontend. The exposed boundary exists at backend/app/api/routes/chat.py; dedicated retrieval and AI implementation paths are absent from the current tree. ChromaDB and the LLM are therefore architectural external-service dependencies, not evidenced as integrated code here.
Persistence and Runtime Configuration
SQLite persistence is initialized through backend/app/database/base.py and backend/app/database/session.py. Runtime settings and constants are centralized in backend/app/core/config.py and backend/app/core/constants.py, with example environment inputs in backend/.env.example. The backend uses Python/FastAPI dependencies declared by backend/requirements.txt.
Deployment and Operational Boundaries
Container deployment is defined in deployment/Dockerfile and deployment/docker-compose.yml; the stated target infrastructure includes Docker and AWS. API expectations are documented separately in docs/api_contract.md, while architecture/setup references live in docs/architecture.md and docs/setup.md. Health routing provides the intended operational probe boundary via backend/app/api/routes/health.py.
Main entry points: main.py FastAPI application · App.jsx React application · upload.py Upload API · chat.py Chat API
Components 17
Browser Client
- React application · Presents upload, archive, and chat experiences.
frontend/src/App.jsx - Client bootstrap
frontend/src/main.jsx
Backend API
- FastAPI application
backend/app/main.py - Upload API
backend/app/api/routes/upload.py - Chat API
backend/app/api/routes/chat.py - Archive API
backend/app/api/routes/archive.py - Health API
backend/app/api/routes/health.py - API dependencies
backend/app/api/dependencies.py - Security
backend/app/core/security.py
Planned RAG Services
Missing implementation layers between routes and storage.
- Ingestion pipeline · Extracts, cleans, chunks, embeds, summarizes, and persists submitted content.
- RAG retrieval · Embeds questions, retrieves top-k context, builds prompts, and generates answers.
Runtime & Operations
- SQLite persistence
backend/app/database/session.py - ChromaDB · External dependency; no integration code is present.
- LLM · External dependency; no integration code is present.
- Runtime configuration
backend/app/core/config.py - Container deployment
deployment/docker-compose.yml - API contract
docs/api_contract.md
Connections 18
- Client bootstrap → React application: mounts
- React application → FastAPI application: HTTP requests
- FastAPI application → Upload API: serves
- FastAPI application → Chat API: serves
- FastAPI application → Archive API: serves
- FastAPI application → Health API: serves
- FastAPI application → API dependencies: uses
- API dependencies → Security: auth support
- Upload API → Ingestion pipeline: submit URL/PDF
- Ingestion pipeline → SQLite persistence: persist metadata/content
- Ingestion pipeline → ChromaDB: store embeddings
- Chat API → RAG retrieval: answer question
- RAG retrieval → ChromaDB: similarity search
- RAG retrieval → LLM: prompt and answer
- Archive API → SQLite persistence: read archive
- FastAPI application → Runtime configuration: loads settings
- Container deployment → FastAPI application: runs backend
- API contract → FastAPI application: documents