Main Components
ConnectionsDashboard
The primary component that orchestrates the entire UI. Located atcomponents/connections-dashboard.tsx:142.
Features:
- Fetches connection data from
/api/connectionsevery 5 seconds - Manages React Flow nodes and edges state
- Provides tab navigation between diagram and table views
- Handles process termination via kill button
app/page.tsx.
React Flow Nodes
psys defines two custom node types for the diagram view:ListenerNode
Represents a process listening on a port. Defined atcomponents/connections-dashboard.tsx:44.
Props:
- Border with primary color accent
- Process icon + optional Docker icon
- Service label with optional “(typical: X)” suffix
- Port number below label
- Source handle on the right for connections
TargetNode
Represents a connection target (service being connected to). Defined atcomponents/connections-dashboard.tsx:66.
Props:
- Muted border and background
- Service label (e.g., “MongoDB”)
- Address:port below label
- Target handle on the left for incoming connections
Icon Components
ProcessIcon
Dynamic icon component that displays the appropriate logo based on process type. Located atcomponents/process-icon.tsx:30.
Props:
| Type | Icon | Source |
|---|---|---|
psys | psys logo | components/psys-icon.tsx |
node | Node.js logo | components/ui/svgs/nodejs.tsx |
next | Next.js icon | components/ui/svgs/nextjsIconDark.tsx |
redis | Redis logo | components/ui/svgs/redis.tsx |
mongo | MongoDB icon | components/ui/svgs/mongodbIconLight.tsx |
postgres | PostgreSQL logo | components/ui/svgs/postgresql.tsx |
mysql | MySQL icon | components/ui/svgs/mysqlIconLight.tsx |
apache | Server icon | lucide-react Server |
ssh | Terminal icon | lucide-react Terminal |
generic | Box icon | lucide-react Box |
DockerIcon
Displays the Docker whale logo for containerized processes. Located atcomponents/docker-icon.tsx:5.
Props:
shadcn/ui Components
psys uses shadcn/ui components for consistent styling. All components are incomponents/ui/.
Card
Location:components/ui/card.tsx
Components:
Card- Container wrapperCardHeader- Header sectionCardTitle- Title textCardContent- Main content area
components/connections-dashboard.tsx:245
Table
Location:components/ui/table.tsx
Components:
Table- Table wrapperTableHeader- Header row containerTableBody- Body rows containerTableRow- Individual rowTableHead- Header cellTableCell- Data cell
components/connections-dashboard.tsx:275
Badge
Location:components/ui/badge.tsx
Variants:
default- Primary stylesecondary- Muted styledestructive- Error styleoutline- Outlined style
components/connections-dashboard.tsx:339
Button
Location:components/ui/button.tsx
Variants: default, destructive, outline, secondary, ghost, link
Sizes: default, sm, lg, icon
Usage in psys:
components/connections-dashboard.tsx:225
Tabs
Location:components/ui/tabs.tsx
Components:
Tabs- ContainerTabsList- Tab buttons containerTabsTrigger- Individual tab buttonTabsContent- Content for each tab
components/connections-dashboard.tsx:233
Service Logos
All service logos are incomponents/ui/svgs/ and follow a consistent API:
Available SVGs:
nodejs.tsx- Node.js logonextjsIconDark.tsx/nextjsLogoLight.tsx- Next.js logosredis.tsx- Redis logomongodbIconLight.tsx/mongodbIconDark.tsx/mongodbWordmarkLight.tsx/mongodbWordmarkDark.tsx- MongoDB variationspostgresql.tsx/postgresqlWordmarkLight.tsx/postgresqlWordmarkDark.tsx- PostgreSQL variationsmysqlIconLight.tsx/mysqlIconDark.tsx/mysqlWordmarkLight.tsx/mysqlWordmarkDark.tsx- MySQL variationsdocker.tsx- Docker whale logo
Component Utilities
buildFlow
TransformsConnectionsData into React Flow nodes and edges. Located at components/connections-dashboard.tsx:78.
Signature:
- Create listener nodes (left side) with vertical spacing
- Build a map of unique connection targets
- Create target nodes (right side) for each unique target
- Create edges from listeners to targets
- Deduplicate edges to prevent visual clutter
- Listeners:
x: 40,y: 40 + index * (NODE_HEIGHT + GAP) - Targets:
x: 40 + LISTENER_NODE_WIDTH + 120,y: 40 + index * (NODE_HEIGHT + GAP)