How mdarwish228/ui-skill-testing works
Repository Purpose
This repository contains two standalone TypeScript/Vite frontend implementations of a CloudCam fleet-monitoring UI: a baseline (before-skill) and a more structured successor (after-skill). Both render mock camera telemetry and simulated camera feeds; neither shows a backend, API client, or deployment service.
Application Entry Points
Each application boots a React tree from its Vite HTML entry point:
• Baseline: before-skill/index.html → before-skill/src/main.tsx → before-skill/src/ui/App.tsx
• Successor: after-skill/index.html → after-skill/src/main.tsx → after-skill/src/App.tsx
Vite configuration and package manifests are isolated per application at before-skill/vite.config.ts, before-skill/package.json, after-skill/vite.config.ts, and after-skill/package.json.
Baseline Fleet Dashboard
The baseline implementation keeps the UI and its data contracts close together under before-skill/src/ui/.
• before-skill/src/ui/App.tsx owns screen composition and selected-camera state.
• before-skill/src/ui/CameraList.tsx presents fleet-level camera selection.
• before-skill/src/ui/CameraDetails.tsx renders information for the active camera.
• before-skill/src/ui/MockVideoFeed.tsx simulates the camera stream.
• before-skill/src/mock/cameras.ts provides the static/mock fleet data consumed by the UI.
Control flow is primarily selection-driven: fleet records populate the list, a user selects a camera, and the selected record drives detail and feed rendering.
Structured Successor
The successor separates domain modeling, mock telemetry generation, presentation, and formatting.
• after-skill/src/App.tsx is the application composition and state boundary.
• after-skill/src/components/CameraSidebar.tsx provides fleet navigation and camera selection.
• after-skill/src/components/CameraView.tsx presents the selected camera’s main telemetry/detail surface.
• after-skill/src/components/MockCameraPlayer.tsx simulates video playback.
• after-skill/src/domain/types.ts defines shared camera and telemetry contracts.
This division makes UI components depend on a common domain layer rather than embedding data shapes in individual views.
Mock Telemetry Pipeline
The successor models changing operational data as a client-side stream:
• after-skill/src/mock/seed.ts defines initial mock fleet/telemetry state.
• after-skill/src/mock/useMockTelemetry.ts exposes telemetry updates through a React hook.
• after-skill/src/mock/util/rng.ts supplies randomized state evolution.
• after-skill/src/domain/types.ts constrains data exchanged between the mock layer and components.
The expected flow is seed data → randomized periodic telemetry hook → App.tsx state/composition → sidebar and camera view. This is the primary seam for replacing mock behavior with a live telemetry transport.
Presentation and Design Boundaries
The successor’s page-level and component styling is split between after-skill/src/App.css and after-skill/src/index.css; display-oriented transformations are centralized in after-skill/src/lib/format.ts. The baseline instead uses a consolidated stylesheet at before-skill/src/ui/styles.css and status display metadata in before-skill/src/ui/statusMeta.ts.
The design reference is external to application runtime code at design-system/cloudcam-fleet/MASTER.md.
Runtime and Infrastructure
Both applications are browser-only React applications built and served with Vite, using TypeScript. Dependencies are lockfile-managed independently in each subproject. before-skill/dist/ contains a prebuilt static bundle, while after-skill appears source-oriented. There is no indicated server runtime, database, authentication provider, live video platform, or telemetry backend; all operational integration boundaries currently terminate at mock modules.
Main entry points: ui/App.tsx Dashboard composition · src/App.tsx App composition · CameraView.tsx Camera view · useMockTelemetry.ts Mock telemetry stream
Components 22
Baseline UI
- Vite HTML entry
before-skill/index.html - React bootstrap
before-skill/src/main.tsx - Dashboard composition · Owns selected-camera state.
before-skill/src/ui/App.tsx - Camera list
before-skill/src/ui/CameraList.tsx - Camera details
before-skill/src/ui/CameraDetails.tsx - Mock video feed · Simulates the camera stream.
before-skill/src/ui/MockVideoFeed.tsx - Static fleet data
before-skill/src/mock/cameras.ts - Status display metadata
before-skill/src/ui/statusMeta.ts - Dashboard styles
before-skill/src/ui/styles.css
Structured successor
- Vite HTML entry
after-skill/index.html - React bootstrap
after-skill/src/main.tsx - App composition · Consumes telemetry and coordinates the selected camera.
after-skill/src/App.tsx - Camera sidebar · Fleet navigation and selection.
after-skill/src/components/CameraSidebar.tsx - Camera view · Selected-camera telemetry and detail surface.
after-skill/src/components/CameraView.tsx - Mock camera player · Simulates video playback.
after-skill/src/components/MockCameraPlayer.tsx - Camera domain contracts · Shared camera and telemetry types.
after-skill/src/domain/types.ts - Seed fleet state · Initial fleet and telemetry state.
after-skill/src/mock/seed.ts - Mock telemetry stream · Produces periodic client-side telemetry updates.
after-skill/src/mock/useMockTelemetry.ts - State randomizer
after-skill/src/mock/util/rng.ts - Display formatting
after-skill/src/lib/format.ts - Page and global styles
after-skill/src/App.css
Other components
- Design system reference · External to runtime code.
design-system/cloudcam-fleet/MASTER.md
Connections 24
- Vite HTML entry → React bootstrap: loads
- React bootstrap → Dashboard composition: mounts
- Static fleet data → Dashboard composition: provides fleet
- Dashboard composition → Camera list: renders
- Camera list → Dashboard composition: selection
- Dashboard composition → Camera details: selected camera
- Dashboard composition → Mock video feed: selected camera
- Status display metadata → Camera details: status presentation
- Dashboard styles → Dashboard composition: styles
- Vite HTML entry → React bootstrap: loads
- React bootstrap → App composition: mounts
- Seed fleet state → Mock telemetry stream: initial state
- State randomizer → Mock telemetry stream: evolves state
- Camera domain contracts → Mock telemetry stream: telemetry contracts
- Mock telemetry stream → App composition: periodic updates
- App composition → Camera sidebar: fleet and selection
- Camera sidebar → App composition: selection
- App composition → Camera view: selected telemetry
- Camera view → Mock camera player: camera feed
- Camera domain contracts → Camera sidebar: camera contracts
- Camera domain contracts → Camera view: telemetry contracts
- Display formatting → Camera view: formats display
- Page and global styles → App composition: styles
- Design system reference → Page and global styles: guides design