Examples & Scenarios
Welcome to the Vertical Template examples library. This section provides practical, real-world code examples and complete scenarios to help you build applications faster.
What You'll Find Here
Code Snippets
Ready-to-use TypeScript code examples covering all aspects of VT development. Copy, paste, and adapt these snippets to your needs.
Industry Scenarios
Complete vertical application examples for specific industries. Each scenario includes data models, configurations, components, and AI integration patterns.
Tutorials
Step-by-step guided walkthroughs for building features from scratch.
Quick Reference by Category
Configuration Examples
| Example | Description | Complexity |
|---|---|---|
| Minimal Config | Bare-bones tenant configuration | Beginner |
| Full-Featured Config | Complete config with all features | Intermediate |
| Multi-Tenant Setup | Multiple tenants with shared config | Advanced |
| Theme Customization | Custom branding and styling | Beginner |
| Store Persistence | Configure store slices with persistence | Intermediate |
| Conditional Visibility | Show/hide components based on state | Intermediate |
Component Examples
| Example | Description | Complexity |
|---|---|---|
| Custom Dashboard Widget | Build a metrics dashboard | Intermediate |
| Form with Validation | Complete form with field validation | Intermediate |
| Data Table with Filters | Searchable, filterable table | Intermediate |
| File Upload Component | Multi-file upload with progress | Advanced |
| Chat Interface | AI chat with SSE streaming | Advanced |
| Conditional Rendering | Component visibility based on auth/state | Beginner |
API Integration Examples
| Example | Description | Complexity |
|---|---|---|
| Fetch Resources | Basic CRUD with useResources | Beginner |
| BFF Proxy Pattern | Secure API calls via BFF | Intermediate |
| SSE Streaming | Real-time chat streaming | Advanced |
| Document Upload | Upload with progress tracking | Intermediate |
| Batch Operations | Bulk create/update resources | Advanced |
| Error Handling | Robust error handling patterns | Intermediate |
State Management Examples
| Example | Description | Complexity |
|---|---|---|
| useStoreValue Basics | Read store values | Beginner |
| useSetStore Patterns | Update store state | Beginner |
| Computed Selectors | Derive state from store | Intermediate |
| Store Slices | Organize state by feature | Intermediate |
| Persistence | Persist store to localStorage | Intermediate |
| Reset State | Clear store on logout | Beginner |
AI Integration Examples
| Example | Description | Complexity |
|---|---|---|
| Chat Component | AI chat interface | Intermediate |
| Document Q&A | RAG-based document queries | Advanced |
| Classification | Auto-classify records with AI | Advanced |
| Prompt Templates | Reusable prompt patterns | Intermediate |
| Streaming Responses | Handle SSE streams | Advanced |
| AI-Assisted Forms | Auto-fill forms with AI | Advanced |
Deployment Examples
| Example | Description | Complexity |
|---|---|---|
| Azure Deployment | Deploy to Azure with GitHub Actions | Advanced |
| Environment Config | Manage dev/staging/prod configs | Intermediate |
| CI/CD Pipeline | Automated testing and deployment | Advanced |
| Docker Setup | Containerize VT application | Advanced |
| Monitoring | Add logging and monitoring | Advanced |
Understanding the Examples
Complexity Levels
- Beginner: Basic concepts, minimal setup, single file
- Intermediate: Multiple concepts, moderate setup, 2-3 files
- Advanced: Complex patterns, full integration, multiple files and concepts
Code Conventions
All examples follow these conventions:
- TypeScript: All code is TypeScript with proper typing
- Platform SDK: Uses official
@eai/platform-sdkpatterns - VT Hooks: Leverages VT React hooks (useResources, useStoreValue, etc.)
- Error Handling: Includes proper error and loading states
- Comments: Annotated to explain key concepts
- Copy-Paste Ready: Minimal modifications needed to use
Example Structure
Each code example includes:
- Description: What the code does and when to use it
- Prerequisites: Required setup or dependencies
- Code: Fully working TypeScript code
- Explanation: Key concepts and patterns used
- Customization: How to adapt it to your needs
- Related: Links to related examples or docs
Recipes Concept
Recipes are small, focused examples that solve a specific problem. They're designed to be:
- Focused: One concept or feature per recipe
- Practical: Solves a real development task
- Minimal: No unnecessary code
- Adaptable: Easy to customize
Recipe Categories
- Quick Wins: Simple patterns that save time
- Common Tasks: Frequently needed functionality
- Best Practices: Recommended approaches
- Troubleshooting: Solutions to common problems
- Performance: Optimization techniques
- Security: Auth and validation patterns
Industry Scenarios
Complete examples of vertical applications for specific industries:
Available Scenarios
-
Immigration Case Management
- Client intake and case tracking
- Document collection workflows
- Status updates and notifications
- Attorney assignment and management
-
Property Management Portal
- Property and unit listings
- Tenant management
- Maintenance request tracking
- Lease and document management
-
Healthcare Patient Portal
- Patient records and profiles
- Appointment scheduling
- Document upload and management
- Provider communication
-
Education Course Platform
- Course catalog and enrollment
- Student progress tracking
- Assignment submission
- Grade management
-
Government Permits System
- Permit application workflows
- Review and approval process
- Public status lookup
- Document requirements
Each scenario includes:
- Complete data model (Object Types)
- Tenant configuration
- Custom components
- AI integration examples
- Deployment guidance
How to Use These Examples
1. Browse and Search
Use the category tables above to find examples by feature or complexity level.
2. Copy and Adapt
All examples are production-ready. Copy the code and customize:
- Replace placeholder names with your domain terms
- Adjust TypeScript types to match your data
- Modify styling to match your theme
- Add business logic specific to your needs
3. Combine Patterns
Mix and match examples to build complete features:
// Combine: Resource fetching + Custom component + Store
import { useResources } from '@eai/platform-sdk/react';
import { useStoreValue } from '@/lib/store';
import { CustomDashboard } from '@/components/CustomDashboard';
export const DashboardPage = () => {
const { resources } = useResources({ objectType: 'case' });
const filters = useStoreValue('dashboard.filters');
return <CustomDashboard resources={resources} filters={filters} />;
};
4. Learn by Building
Follow the tutorials for step-by-step guidance on building complete features.
Contributing Examples
Have a useful pattern or example to share? Contributions are welcome!
What Makes a Good Example
- Solves a real problem developers face
- Follows VT and platform best practices
- Includes clear comments and explanation
- Is type-safe with no
anytypes - Handles errors and edge cases
Submission Guidelines
- Use the example template format
- Test the code thoroughly
- Include TypeScript types
- Add comments for complex logic
- Link to related documentation
Getting Help
Not Finding What You Need?
- Check the Component Patterns guide
- Review the SDK Documentation
- Explore AI Development Patterns
- Ask in the Community Forum
Example Request
Missing an example? Request it:
- Describe the use case
- Explain what you've tried
- Share relevant code or config
- Specify complexity level
Related Resources
Documentation
- Configuration Reference - Complete config API
- React Hooks - VT hook documentation
- Platform SDK - SDK reference
- TypeScript Guide - Type patterns
Tutorials
- Quick Start - Build your first feature
- Custom Components - Create custom UI
- AI Integration - Add AI features
- Deployment - Deploy to production
Tools
- EAI CLI - Command-line tools
- VS Code Extension - Enhanced development experience
- Template Generator - Scaffold new features
- Type Generator - Generate types from config
Next Steps
- Start Simple: Try the Code Snippets for quick wins
- Go Deeper: Explore Industry Scenarios for complete examples
- Learn by Doing: Follow a Tutorial step-by-step
- Get AI Help: Use AI Workflow Patterns to accelerate development
Happy coding with Vertical Template!