Directory Overview
Frontend Architecture
Component Structure
Container Kit follows Atomic Design principles:Atoms (src/lib/components/atoms/)
Smallest, reusable UI elements:
- Buttons, inputs, labels
- Icons, badges
- Basic terminal components
- Data table cells
Molecules (src/lib/components/molecules/)
Composed components made of atoms:
- Delete confirmation dialogs
- Terminal headers and footers
- Tooltip components
- Page footer actions
Organisms (src/lib/components/organisms/)
Complex components with business logic:
- Sidebar navigation (
app-sidebar.svelte) - Theme switcher
- Toolbar
- Site header
Pages (src/lib/components/pages/)
Full page components:
- Home dashboard
- Containerization status
- Unsupported system pages
UI Components (src/lib/components/ui/)
Shadcn-style base components:
- Alert, Alert Dialog
- Badge, Button, Card
- Checkbox, Dialog, Dropdown Menu
- Input, Label, Select
- Table, Tabs, Toast
- And more…
Services Layer
src/lib/services/
Business logic and API integration:
container.ts- Container management operationssystem.ts- System integration and platform checks
State Management
src/lib/stores/
Svelte stores for global state:
app.ts- Application-wide statetheme.ts- Theme preferences and switching
Database Layer
src/lib/db/
Database schema and types:
schema.ts- Drizzle ORM schema definitionstypes.ts- TypeScript type definitions for database entities
Routing
src/routes/
SvelteKit file-based routing:
(containerization)/- Container management routes (grouped)(fallback)/- Fallback and error routes+layout.svelte- Root layout component+page.svelte- Home page
Theming
src/themes/
Custom CSS themes:
- CSS variables for colors
- Dark/light mode definitions
- Custom styling overrides
Backend Architecture
Tauri Backend (src-tauri/)
Commands (src-tauri/src/commands/)
Tauri IPC commands for frontend-backend communication:
Services (src-tauri/src/services/)
Business logic layer:
- Container operations
- System integration
- Database queries
Main Entry Point (src-tauri/src/main.rs)
Application initialization:
Database Migrations
src-tauri/migrations/
Generated SQL migration files:
- Versioned schema changes
- Generated by Drizzle Kit
- Converted to Rust by
generate-migrations.ts
Sidecar Binaries
src-tauri/binaries/sidecar/
Bundled external binaries:
- Apple Container CLI
- Downloaded by
download-apple-container-cli.sh
Configuration
src-tauri/tauri.conf.json
Tauri application configuration:
Build System
Scripts (scripts/)
Automation and build scripts:
download-apple-container-cli.sh
Downloads Apple Container CLI for macOS:
generate-migrations.ts
Generates Rust migration bindings from SQL:
tauri-build.sh
Custom build script for production:
Package Management
package.json
Node.js dependencies and scripts:
- Frontend dependencies (Svelte, TypeScript, etc.)
- Development tools (Vite, Prettier, etc.)
- Build scripts and automation
Cargo.toml
Rust dependencies:
- Tauri framework
- Database drivers
- Serialization libraries
Configuration Files
TypeScript (tsconfig.json)
SvelteKit (svelte.config.js)
Vite (vite.config.js)
Drizzle (drizzle.config.ts)
Development Patterns
Frontend Patterns
Component Communication
Store Usage
Service Integration
Backend Patterns
Command Definition
Database Access
Testing Structure
Testing infrastructure is planned but not yet implemented.
Planned Structure
Build Artifacts
Development
.svelte-kit/- SvelteKit build cachebuild/- Frontend build outputtarget/- Rust build artifacts
Production
src-tauri/target/release/- Compiled Rust binarysrc-tauri/target/release/bundle/- macOS app bundle*.dmg- Distributable installer
Next Steps
- Review Available Scripts for development commands
- Check Contributing Guide for coding standards
- Set up your Development Environment