How shikhar0x/cloudvault works
CloudVault is a self-hosted file storage and sharing product. Users enter through the Next.js dashboard or account pages, then use the REST API to authenticate, organize folders, upload and download files, create expiring public links, and check storage usage. The backend separates route handling from domain services, with PostgreSQL metadata and a provider-based object-storage layer. The README documents the broader frontend capabilities; source excerpts show backend registration and selected service calls, so unsampled frontend-to-API details are represented only at the documented boundary.
Main entry points: main.py FastAPI application · dependencies.py JWT and ownership · folder.py SQLAlchemy models · interface.py Storage provider interface
Components 25
Web application
- File explorer
frontend/src/app/page.tsx - Login and registration
frontend/src/app/login/page.tsx - Public share portal
frontend/src/app/share/[token]/page.tsx - API client
frontend/src/lib/api.ts
API entry and routes
- FastAPI application
backend/app/main.py - Authentication routes
backend/app/modules/auth/router.py - File routes
backend/app/modules/files/router.py - Folder routes
backend/app/modules/folders/router.py - Sharing routes
backend/app/modules/sharing/router.py - Quota routes
backend/app/modules/storage/router.py
Domain services
- Authentication service
backend/app/modules/auth/service.py - File management
backend/app/modules/files/service.py - Folder hierarchy
backend/app/modules/folders/service.py - Share links
backend/app/modules/sharing/service.py - Usage calculation
backend/app/modules/storage/service.py
Identity and access
- JWT and ownership
backend/app/core/dependencies.py - Password and token primitives
backend/app/core/security.py
Persistence and storage
- Database sessions
backend/app/database/session.py - SQLAlchemy models
backend/app/database/models/folder.py - Storage provider interface
backend/app/infrastructure/storage/interface.py - Local storage
backend/app/infrastructure/storage/local.py - S3 storage
backend/app/infrastructure/storage/s3.py
Other components
- User
- PostgreSQL
- Object storage
Connections 38
- User → File explorer: manages files
- User → Login and registration: signs in
- User → Public share portal: opens share
- File explorer → API client: uses API
- Login and registration → API client: uses API
- Public share portal → API client: uses API
- API client → FastAPI application: REST requests
- FastAPI application → Authentication routes: registers
backend/app/main.py - FastAPI application → File routes: registers
backend/app/main.py - FastAPI application → Folder routes: registers
backend/app/main.py - FastAPI application → Sharing routes: registers
backend/app/main.py - FastAPI application → Quota routes: registers
backend/app/main.py - Authentication routes → Authentication service: calls
backend/app/modules/auth/router.py - File routes → File management: calls
backend/app/modules/files/router.py - Folder routes → Folder hierarchy: calls
backend/app/modules/folders/router.py - Sharing routes → Share links: calls
backend/app/modules/sharing/router.py - Quota routes → Usage calculation: calls
backend/app/modules/storage/router.py - Authentication routes → JWT and ownership: requires identity
backend/app/modules/auth/router.py - File routes → JWT and ownership: requires identity
backend/app/modules/files/router.py - Folder routes → JWT and ownership: requires identity
backend/app/modules/folders/router.py - Sharing routes → JWT and ownership: protects creation
backend/app/modules/sharing/router.py - JWT and ownership → Password and token primitives: validates token
backend/app/core/dependencies.py - JWT and ownership → Database sessions: loads user
backend/app/core/dependencies.py - Authentication service → Password and token primitives: hashes and signs
backend/app/modules/auth/service.py - Authentication service → SQLAlchemy models: reads and writes users
backend/app/modules/auth/service.py - File management → SQLAlchemy models: reads and writes files
backend/app/modules/files/service.py - Folder hierarchy → SQLAlchemy models: reads and writes folders
backend/app/modules/folders/service.py - Folder hierarchy → Storage provider interface: deletes objects
backend/app/modules/folders/service.py - Share links → SQLAlchemy models: reads and writes links
backend/app/modules/sharing/service.py - Share links → Storage provider interface: resolves provider
backend/app/modules/sharing/service.py - Usage calculation → SQLAlchemy models: reads usage data
backend/app/modules/storage/service.py - Storage provider interface → Local storage: selects backend
backend/app/infrastructure/storage/__init__.py - Storage provider interface → S3 storage: selects backend
backend/app/infrastructure/storage/__init__.py - File management → Storage provider interface: stores and streams
backend/app/modules/files/service.py - Database sessions → PostgreSQL: opens sessions
backend/app/database/session.py - SQLAlchemy models → PostgreSQL: maps records
- Local storage → Object storage: reads and writes
- S3 storage → Object storage: reads and writes