How okeson453/aegisshare-enterprise works
Purpose and Runtime
AegisShare is a React 18/TypeScript single-page frontend for a zero-knowledge, compliance-oriented secure file-sharing platform. It is built and served with Vite, styled with Tailwind/CSS, navigated with React Router v6, and uses Zustand stores. Browser-side cryptographic utilities support the zero-knowledge boundary. Entry points are src/main.tsx, src/App.tsx, and index.html.
Application Shell and Navigation
The main app composes protected routes, global layout, error handling, and user-facing pages. Shared application chrome is centered in src/components/layout/AppLayout.tsx, while authorization gating is implemented at src/components/routing/ProtectedRoute.tsx. Core product routes cover vault/files, key management, policy, audit, compliance, access control, and threat intelligence under src/pages/.
Domain State and Service Boundary
UI components access domain state through Zustand stores and hooks; network/service calls are isolated from pages. Main domains map consistently:
• Authentication: src/store/authStore.ts, src/services/auth.ts, src/hooks/useAuth.ts
• Files/vault: src/store/filesStore.ts, src/services/files.ts, src/hooks/useFiles.ts
• Keys, policies, audit, and threats: src/store/keysStore.ts, src/store/policyStore.ts, src/store/auditStore.ts
The transport boundary is src/services/api.ts; mock service implementations in src/services/mock/ indicate frontend operation can be decoupled from a live backend.
Secure Sharing and Cryptography
File workflows are presented through vault pages and reusable file components, including upload, listing, and detail interaction: src/pages/Vault/Vault.tsx, src/components/files/UploadModal.tsx, src/components/files/FileDetailPanel.tsx. Client-side crypto primitives include AES-GCM, Argon2, and ECIES in src/utils/crypto/aesGcm.ts, src/utils/crypto/argon2.ts, and src/utils/crypto/ecies.ts. Token handling and browser-side security controls sit at src/utils/tokenManager.ts, src/utils/csp.ts, and src/utils/sri.ts.
Governance, Audit, and Policy
Compliance-oriented workflows are first-class user surfaces: audit-chain visualization, policy authoring/simulation, access control, and compliance reporting. Key paths are src/pages/AuditChain/AuditChain.tsx, src/pages/PolicyEngine/PolicyEngine.tsx, and src/pages/AccessControl/AccessControl.tsx. Policy evaluation has an external integration boundary through src/lib/opaClient.ts, with related UI in src/components/policy/PolicySimulator.tsx.
Administrative Control Plane
A separate admin application/module organizes operational administration, likely rendered from the primary app’s admin route. src/admin/AdminApp.tsx and src/admin/AdminLayout.tsx establish its shell. Admin state/services are independent from general-product state, e.g. src/admin/store/adminOverviewStore.ts, src/admin/services/adminOverview.ts, and src/admin/services/backup.ts. Major operational domains include users, roles, incidents, backup recovery, service health, sovereignty, license features, and audit logs under src/admin/pages/.
Real-Time, Observability, and Deployment
WebSocket functionality is abstracted by src/lib/websocket.ts and src/hooks/useWebSocket.ts, supporting live operational or threat data. Client performance monitoring utilities are in src/utils/performanceMonitor.ts and src/utils/webVitals.ts; deployment monitoring settings are centralized in config/monitoring.config.ts. Environment-specific frontend configuration uses .env.development and .env.production, with production deployment automated by .github/workflows/deploy-production.yml.
Main entry points: App.tsx App router · authStore.ts Authentication domain · Vault.tsx Vault file workflows · PolicyEngine.tsx Governance surfaces
Components 20
Application Shell
- Vite entry
src/main.tsx - App router · Composes routes, error handling, and product surfaces.
src/App.tsx - Application layout
src/components/layout/AppLayout.tsx - Protected routes
src/components/routing/ProtectedRoute.tsx
Product Domains
- Authentication domain
src/store/authStore.ts - Vault file workflows · Upload, listing, and file detail interactions.
src/pages/Vault/Vault.tsx - File upload
src/components/files/UploadModal.tsx - Files domain
src/store/filesStore.ts - Browser cryptography · AES-GCM, Argon2, and ECIES primitives.
src/utils/crypto/aesGcm.ts - Governance surfaces · Compliance-oriented audit, policy, and access-control workflows.
src/pages/PolicyEngine/PolicyEngine.tsx - Policy simulation
src/components/policy/PolicySimulator.tsx - OPA integration
src/lib/opaClient.ts
Admin Control Plane
- Admin application · Separate operational administration module.
src/admin/AdminApp.tsx - Admin layout
src/admin/AdminLayout.tsx - Admin overview
src/admin/store/adminOverviewStore.ts
Client Platform
- API transport · Pages and domain services are decoupled from backend transport.
src/services/api.ts - Real-time client
src/lib/websocket.ts - Token security
src/utils/tokenManager.ts - Client observability
src/utils/performanceMonitor.ts - Production deployment
.github/workflows/deploy-production.yml
Connections 21
- Vite entry → App router: mounts
- App router → Application layout: renders
- App router → Protected routes: guards routes with
- Protected routes → Authentication domain: checks session
- Authentication domain → API transport: auth requests
- Authentication domain → Token security: manages tokens
- App router → Vault file workflows: routes to
- Vault file workflows → File upload: opens
- Vault file workflows → Files domain: uses
- File upload → Browser cryptography: protects files with
- Files domain → API transport: file requests
- App router → Governance surfaces: routes to
- Governance surfaces → Policy simulation: includes
- Policy simulation → OPA integration: evaluates through
- App router → Admin application: hosts admin route
- Admin application → Admin layout: uses
- Admin application → Admin overview: loads operations
- Admin overview → API transport: admin requests
- Governance surfaces → Real-time client: receives live data
- App router → Client observability: records performance
- Production deployment → App router: deploys production build