How abhi-95-18/trustshare works
TrustShare is a web platform for encrypted file management and controlled collaboration. Users authenticate through the frontend and FastAPI, then manage files, folders, and shares; the backend also records activity and exposes monitoring capabilities. The README documents PostgreSQL, MongoDB, and Redis roles, while sampled source confirms file encryption/storage and audit behavior. Frontend-to-API and documented infrastructure links are shown at the system level; unsampled page-to-endpoint wiring is not inferred.
Main entry points: main.py FastAPI application · audit.py Audit and activity · database.py PostgreSQL · auth.py Authentication routes
Components 24
Web client
- Next.js interface
frontend/app - API client
frontend/lib/api.ts - Token storage
frontend/lib/auth.ts
API and identity
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/api/auth.py - Identity and sessions
backend/app/services/auth.py - JWT authorization
backend/app/api/dependencies.py
File collaboration
- File operations
backend/app/api/files.py - Folder operations
backend/app/api/folders.py - Folder logic
backend/app/services/folder.py - Encryption workflow
backend/app/services/file_utils.py - File encryption
backend/app/services/encryption.py - Encrypted storage
backend/app/services/storage.py - Sharing routes
backend/app/api/shares.py - Share and session records
backend/app/models/collaboration.py
Security and monitoring
- Monitoring routes
backend/app/api/monitoring.py - Audit and activity
backend/app/services/audit.py - Security detection
backend/app/services/security_monitor.py - Notifications
backend/app/services/notifications.py
Persistence
- PostgreSQL
backend/app/core/database.py - MongoDB
backend/app/core/mongodb.py - Redis
backend/app/core/redis.py
Other components
- User
- S3 storage
Connections 34
- User → Next.js interface: uses
README.md - Next.js interface → API client: requests through
- API client → Token storage: uses
frontend/lib/api.ts - Next.js interface → FastAPI application: calls REST API
README.md - FastAPI application → Authentication routes: registers
backend/app/main.py - FastAPI application → File operations: registers
backend/app/main.py - FastAPI application → Folder operations: registers
backend/app/main.py - FastAPI application → Sharing routes: registers
backend/app/main.py - FastAPI application → Monitoring routes: registers
backend/app/main.py - Authentication routes → Identity and sessions: delegates to
backend/app/api/auth.py - Authentication routes → JWT authorization: depends on
backend/app/api/auth.py - Authentication routes → Redis: uses OAuth state
backend/app/api/auth.py - Authentication routes → Audit and activity: records activity
backend/app/api/auth.py - Identity and sessions → PostgreSQL: persists identity
backend/app/services/auth.py - JWT authorization → PostgreSQL: checks sessions
backend/app/api/dependencies.py - File operations → Encryption workflow: processes files
backend/app/api/files.py - File operations → Audit and activity: records activity
backend/app/api/files.py - File operations → PostgreSQL: reads and writes
backend/app/api/files.py - Encryption workflow → File encryption: uses
backend/app/services/file_utils.py - Encryption workflow → Encrypted storage: uses
backend/app/services/file_utils.py - Encrypted storage → S3 storage: stores objects
- Folder operations → Folder logic: delegates to
backend/app/api/folders.py - Folder operations → PostgreSQL: reads and writes
backend/app/api/folders.py - Sharing routes → Share and session records: manages
backend/app/api/shares.py - Sharing routes → Audit and activity: records activity
backend/app/api/shares.py - Sharing routes → Notifications: notifies users
backend/app/api/shares.py - Sharing routes → PostgreSQL: reads and writes
backend/app/api/shares.py - Monitoring routes → Audit and activity: queries activity
backend/app/api/monitoring.py - Monitoring routes → Notifications: uses
backend/app/api/monitoring.py - Audit and activity → MongoDB: stores events
backend/app/services/audit.py - FastAPI application → PostgreSQL: health checks
backend/app/main.py - FastAPI application → MongoDB: health checks
backend/app/main.py - FastAPI application → Redis: health checks
backend/app/main.py - Security detection → Audit and activity: analyzes activity