How aryan0dhankhar/containerlease works
ContainerLease is a web platform for authenticated, resource-limited Docker leases. Users sign in, configure an image and lease duration, provision a container, then inspect its status and logs; background cleanup enforces expiry. The map preserves the documented presets, snapshots, security, observability, and lifecycle capabilities. Several backend relationships are documented rather than shown in sampled implementation excerpts, so those edges cite the README; unsampled details are not inferred.
Main entry points: containerApi.ts Container API client · handler HTTP handlers · App.tsx App shell · cleanup_worker.go Cleanup worker
Components 26
Web interface
- React entry
frontend/src/main.tsx - App shell
frontend/src/App.tsx - Sign-in landing
frontend/src/components/HomePage.tsx - Login form
frontend/src/components/LoginForm.tsx - Provision form
frontend/src/components/ProvisionFormEnhanced.tsx - Command center
frontend/src/components/CommandCenter.tsx - Log viewer
frontend/src/components/ContainerLogs.tsx - Container API client
frontend/src/services/containerApi.ts - Container types
frontend/src/types/container.ts
HTTP and access
- Server bootstrap
backend/cmd/server/main.go - HTTP handlers
backend/internal/handler - Auth and access control
backend/internal/security
Lease services
- Authentication service
backend/internal/service/auth_service.go - Container service
backend/internal/service/container_service.go - Snapshot service
backend/internal/service/snapshot_service.go
Runtime and state
- Docker integration
backend/internal/infrastructure/docker/client.go - Lease repository
backend/internal/repository/lease_repository.go - Container repository
backend/internal/repository/container_repository.go - Snapshot repository
backend/internal/repository/snapshot_repository.go - Redis client
backend/internal/infrastructure/redis/client.go - Database
backend/pkg/database/db.go
Lifecycle and telemetry
- Cleanup worker
backend/internal/worker/cleanup_worker.go - Metrics and tracing
backend/internal/observability/metrics/metrics.go
Other components
- Developer
- Docker Engine
- Redis
Connections 28
- Developer → Sign-in landing: opens
- React entry → App shell: mounts
frontend/src/main.tsx - App shell → Sign-in landing: shows signed-out
frontend/src/App.tsx - App shell → Provision form: shows provisioning
frontend/src/App.tsx - App shell → Command center: shows dashboard
frontend/src/App.tsx - Sign-in landing → Login form: renders
frontend/src/components/HomePage.tsx - Login form → Container API client: authenticates
frontend/src/components/LoginForm.tsx - Provision form → Container API client: requests lease
frontend/src/components/ProvisionFormEnhanced.tsx - Command center → Container API client: loads and manages
frontend/src/components/CommandCenter.tsx - Log viewer → Container API client: subscribes to logs
frontend/src/components/ContainerLogs.tsx - Container API client → Container types: uses types
frontend/src/services/containerApi.ts - Container API client → Server bootstrap: calls HTTP API
- Server bootstrap → HTTP handlers: routes requests
backend/cmd/server/main.go - Server bootstrap → Auth and access control: applies middleware
backend/cmd/server/main.go - HTTP handlers → Container service: delegates provisioning
- HTTP handlers → Snapshot service: handles snapshots
- HTTP handlers → Authentication service: handles authentication
- Authentication service → Database: uses user storage
- Container service → Docker integration: creates containers
- Container service → Lease repository: stores lease
- Snapshot service → Snapshot repository: persists snapshots
- Lease repository → Redis client: uses Redis
- Docker integration → Docker Engine: controls
- Redis client → Redis: connects to
- Cleanup worker → Lease repository: finds expired leases
- Cleanup worker → Docker integration: removes containers
- Cleanup worker → Redis client: clears lease state
- HTTP handlers → Metrics and tracing: emits telemetry