How mclowam/structured_knowledge works
This repository implements a knowledge-library product: users authenticate, create knowledge collections, add files or URLs, and retrieve extracted or compressed content. The frontend exposes login and knowledge/library views; backend services handle identity and collection management, while a worker processes pending and extracted libraries. The payment service has no evidenced runtime behavior in the supplied material, so it is omitted. Connections reflect shown calls or indexed imports; where frontend-to-backend wiring is not evidenced, no connection is asserted.
Main entry points: App.tsx App routes · library.py Knowledge routes · worker.py Processing worker · users.py Auth routes
Components 27
Web client
- App routes
frontend/src/app/App.tsx - Login page
frontend/src/pages/LoginPage.tsx - Knowledge pages
frontend/src/pages/KnowledgeListPage.tsx - Library detail
frontend/src/pages/LibraryDetailPage.tsx - Auth context
frontend/src/auth/AuthContext.tsx - Auth API
frontend/src/api/auth.ts - Library API
frontend/src/api/library.ts
Identity service
- Auth routes
backend/auth/app/api/users.py - Auth wiring
backend/auth/app/use_cases/users.py - Auth services
backend/auth/app/services/users.py - Login and refresh
backend/auth/app/services/login.py - JWT provider
backend/auth/app/core/security/token.py - Token guard
backend/auth/app/core/security/deps.py
Knowledge library
- Knowledge routes
backend/library/app/api/library.py - Knowledge service
backend/library/app/services/knowledge.py - Library service
backend/library/app/services/library.py - Source dispatcher
backend/library/app/repositories/extractors/dispatcher.py - Processing worker
backend/library/app/worker.py - Extraction use case
backend/library/app/use_cases/extraction.py - Compression use case
backend/library/app/use_cases/compression.py - Compression agent
backend/library/app/agents/compression.py
Persistence
- Document storage
backend/library/app/storage/document_storage.py - S3-compatible store
- Library repository
backend/library/app/repositories/library.py - User repository
backend/auth/app/repositories/users.py - PostgreSQL
Other components
- User
Connections 29
- User → App routes: uses
frontend/src/app/App.tsx - App routes → Login page: routes to
frontend/src/app/App.tsx - App routes → Knowledge pages: routes to
frontend/src/app/App.tsx - App routes → Library detail: routes to
frontend/src/app/App.tsx - App routes → Auth context: provides
frontend/src/app/App.tsx - Auth context → Auth API: calls
frontend/src/auth/AuthContext.tsx - User → Auth routes: authenticates
- Auth routes → Auth wiring: resolves services
backend/auth/app/api/users.py - Auth routes → Token guard: checks identity
backend/auth/app/api/users.py - Auth wiring → User repository: builds repository
backend/auth/app/use_cases/users.py - Auth wiring → Login and refresh: builds services
backend/auth/app/use_cases/users.py - Login and refresh → JWT provider: creates tokens
backend/auth/app/services/login.py - Token guard → JWT provider: decodes tokens
backend/auth/app/core/security/deps.py - User repository → PostgreSQL: reads and writes
backend/auth/app/repositories/users.py - User → Knowledge routes: manages collections
- Knowledge routes → Knowledge service: calls
backend/library/app/api/library.py - Knowledge routes → Library service: calls
backend/library/app/api/library.py - Knowledge routes → Source dispatcher: checks file type
backend/library/app/api/library.py - Library service → Knowledge service: uses
backend/library/app/services/library.py - Library service → Document storage: uses
backend/library/app/services/library.py - Document storage → S3-compatible store: uploads and reads
backend/library/app/storage/document_storage.py - Processing worker → Library repository: lists and loads
backend/library/app/worker.py - Processing worker → Extraction use case: builds for pending
backend/library/app/worker.py - Processing worker → Compression use case: builds for extracted
backend/library/app/worker.py - Extraction use case → Source dispatcher: dispatches extraction
backend/library/app/use_cases/extraction.py - Compression use case → Compression agent: uses
- Library repository → PostgreSQL: reads and writes
backend/library/app/repositories/library.py - Knowledge pages → Library API: fetches data
- Library detail → Library API: fetches data