9.9 KiB
9.9 KiB
HelmView Project Structure
helmview/
│
├── backend/ # FastAPI Backend
│ ├── main.py # Main application file
│ ├── requirements.txt # Python dependencies
│ ├── Dockerfile # Backend Docker image
│ └── .dockerignore # Docker build exclusions
│
├── frontend/ # React Frontend
│ ├── src/
│ │ ├── components/ # Reusable React components
│ │ │ ├── ResourceCard.jsx # Resource display card
│ │ │ ├── ResourceCard.css
│ │ │ ├── YamlEditor.jsx # Monaco YAML editor
│ │ │ ├── YamlEditor.css
│ │ │ ├── UploadSection.jsx # Chart upload modal
│ │ │ ├── UploadSection.css
│ │ │ ├── RenderSection.jsx # Chart render modal
│ │ │ ├── RenderSection.css
│ │ │ ├── ExportModal.jsx # Chart export modal
│ │ │ └── ExportModal.css
│ │ │
│ │ ├── pages/ # Page components
│ │ │ ├── ProjectDashboard.jsx # Projects list page
│ │ │ ├── ProjectDashboard.css
│ │ │ ├── RenderView.jsx # Resource view page
│ │ │ └── RenderView.css
│ │ │
│ │ ├── api.js # API client (Axios)
│ │ ├── App.jsx # Root component
│ │ ├── App.css # Global styles
│ │ ├── main.jsx # Entry point
│ │ └── index.css # Base styles
│ │
│ ├── public/ # Static assets
│ ├── index.html # HTML template
│ ├── package.json # Node dependencies
│ ├── vite.config.js # Vite configuration
│ ├── Dockerfile # Development Docker image
│ ├── Dockerfile.prod # Production Docker image
│ ├── nginx.conf # Nginx config for production
│ └── .dockerignore # Docker build exclusions
│
├── docs/ # Documentation (future)
│
├── tests/ # Tests (future)
│ ├── backend/ # Backend tests
│ └── frontend/ # Frontend tests
│
├── .gitignore # Git exclusions
├── .env.example # Environment variables template
├── docker-compose.yml # Development orchestration
├── docker-compose.prod.yml # Production orchestration
│
├── README.md # Main documentation
├── QUICKSTART.md # Quick start guide
├── CONTRIBUTING.md # Contribution guidelines
├── SECURITY.md # Security policy
├── CHANGELOG.md # Version history
├── LICENSE # MIT License
└── PROJECT_STRUCTURE.md # This file
File Descriptions
Backend (/backend)
main.py
The core FastAPI application containing:
- Models: Pydantic models for request/response validation
- Storage: In-memory project database
- Helper Functions:
get_project_path()- Project directory managementsafe_extract_archive()- Secure chart extractionrun_helm_command()- Async Helm executionparse_kubernetes_resources()- YAML parsingupdate_chart_version()- Semver version bumping
- API Endpoints:
- Project CRUD operations
- Chart upload and extraction
- Helm rendering with options
- Resource updates
- Chart export and download
- Schema retrieval for autocomplete
requirements.txt
Python dependencies:
fastapi- Web frameworkuvicorn- ASGI serverpyyaml- YAML processingaiofiles- Async file operationskubernetes- K8s Python clientpython-multipart- File upload supportjsonpatch- JSON patching
Dockerfile
Multi-stage Docker build:
- Install system dependencies
- Install Helm 3
- Install Python dependencies
- Copy application code
- Configure runtime
Frontend (/frontend)
Components
ResourceCard.jsx
- Displays individual Kubernetes resources
- Expandable card interface
- Tabs for Summary and YAML views
- Integrates YamlEditor component
- Handles resource updates
YamlEditor.jsx
- Monaco Editor integration
- Kubernetes autocomplete
- Real-time YAML validation
- Schema-based suggestions
- Format and save functionality
- Kind-specific completions
UploadSection.jsx
- Drag-and-drop file upload
- File validation
- Progress indication
- Error handling
RenderSection.jsx
- Helm render options form
- Values override editor
- Lint output display
- Error reporting
ExportModal.jsx
- Export process management
- Validation status display
- Download functionality
- Error details
Pages
ProjectDashboard.jsx
- List all projects
- Create new projects
- Delete projects
- Navigate to project view
RenderView.jsx
- Main resource view
- Advanced filtering
- Resource grid layout
- Stats display
- Modals orchestration
Configuration
vite.config.js
- Dev server configuration
- Port settings (5173)
- Hot module replacement
- Build optimizations
nginx.conf
- Production web server config
- Gzip compression
- Security headers
- API proxy configuration
- Static asset caching
Docker Configuration
docker-compose.yml (Development)
- Hot reload enabled
- Volume mounts for code
- Port exposure for debugging
- Health checks
docker-compose.prod.yml (Production)
- Optimized builds
- Resource limits
- Health checks
- Restart policies
- Named volumes
Documentation Files
README.md
- Project overview
- Feature list
- Installation instructions
- Usage guide
- Architecture details
- API documentation
- Troubleshooting
QUICKSTART.md
- 3-step quick start
- Sample workflow
- Common use cases
- Troubleshooting tips
CONTRIBUTING.md
- Contribution guidelines
- Development setup
- Code style guides
- Commit conventions
- PR process
- Testing requirements
SECURITY.md
- Security features
- Vulnerability reporting
- Best practices
- Production hardening
- Compliance notes
CHANGELOG.md
- Version history
- Release notes
- Breaking changes
- Migration guides
Key Design Decisions
Backend Architecture
- Async/await: All I/O operations are async for performance
- In-memory storage: Simple start, easy to replace with database
- Sandboxed execution: Each project isolated in filesystem
- No direct Helm API: Uses CLI for maximum compatibility
Frontend Architecture
- Functional components: Modern React with hooks
- No TypeScript: Per requirements, uses JavaScript
- Component composition: Small, focused components
- CSS modules approach: Separate CSS per component
- Monaco Editor: Industry-standard editor with LSP support
Security Architecture
- Defense in depth: Multiple layers of validation
- Principle of least privilege: Minimal permissions
- Input validation: All inputs validated
- Safe defaults: Secure by default configuration
Scalability Considerations
- Stateless backend: Easy horizontal scaling
- Async operations: High concurrency support
- Docker containers: Easy deployment and scaling
- Database-ready: Structure supports easy DB integration
Development Workflow
Local Development
- Start backend:
uvicorn main:app --reload - Start frontend:
npm run dev - Make changes (hot reload active)
- Test locally
- Commit and push
Docker Development
- Start:
docker-compose up - Make changes (hot reload via volumes)
- Test in containers
- Rebuild if needed:
docker-compose up --build
Production Build
- Build images:
docker-compose -f docker-compose.prod.yml build - Test locally:
docker-compose -f docker-compose.prod.yml up - Deploy to production environment
- Monitor health checks
Extension Points
Adding New Features
New Backend Endpoint
- Add route in
main.py - Add Pydantic model if needed
- Implement handler function
- Add API client method in
frontend/src/api.js - Update documentation
New Frontend Component
- Create component file in
src/components/ - Create corresponding CSS file
- Import in parent component
- Add props and state management
- Test in isolation
New Validation Rule
- Add to
validateYaml()inYamlEditor.jsx - Add backend validation in
main.py - Update error messages
- Add tests
Database Integration
- Add SQLAlchemy models
- Add Alembic migrations
- Replace in-memory
projects_db - Update all CRUD operations
- Add connection pooling
- Update docker-compose with database service
Performance Considerations
Backend
- Async I/O for non-blocking operations
- Command timeouts prevent hanging
- Temporary file cleanup
- Efficient YAML parsing
Frontend
- Code splitting (Vite handles this)
- Lazy loading of Monaco Editor
- Debounced filter inputs
- Virtual scrolling for large lists (future)
Docker
- Multi-stage builds reduce image size
- Layer caching optimizes builds
- Resource limits prevent exhaustion
- Health checks ensure availability
Testing Strategy
Backend Tests (Future)
- Unit tests for helper functions
- Integration tests for API endpoints
- Security tests for validation
- Performance tests for Helm operations
Frontend Tests (Future)
- Component unit tests
- Integration tests for pages
- E2E tests for critical flows
- Accessibility tests
Manual Testing Checklist
- Upload various chart formats
- Render with different options
- Edit and save YAML
- Export and validate
- Filter resources
- Error handling
- Cross-browser testing
Last Updated: January 2026 Version: 1.0.0