Updated documentation with architecture changes

This commit is contained in:
Nathan Schneider
2025-05-12 23:18:34 -06:00
parent bec25d8622
commit 2a9d4669f0
2 changed files with 13 additions and 5 deletions

View File

@@ -28,12 +28,15 @@ The new architecture uses a direct template system:
2. Templates contain the full content for all stages and components
3. The index.js file imports and exports all templates
4. Templates are loaded dynamically in builder.js using ES Modules
5. Stages and components are now consolidated in a single YAML file
6. Template selection is now an expandable section rather than a dropdown
The template loading process now follows these steps:
1. When the page loads, the `fetchTemplates()` function is called
2. The function dynamically imports the templates index file using ES modules
3. The templates are stored in memory and used to populate the dropdown
3. The templates are stored in memory and used to populate the template options
4. When a template is selected, the content is directly applied to the form fields
5. The template cards show both the title and description for better user understanding
Benefits of this approach:
- Adding a new template is as simple as creating a new file and registering it in index.js
@@ -42,6 +45,8 @@ Benefits of this approach:
- Easier to understand and maintain
- Improved error handling and debugging capabilities
- Single source of truth for template data
- Consolidated data structure improves maintainability
- Enhanced template selection UI provides more context for users
### Template Loading Implementation
@@ -108,9 +113,9 @@ If common content needs to be shared between templates in the future, standard J
The application is still built on the following core components:
1. **Stage and Component Structure** - Defined in YAML files
1. **Stage and Component Structure** - Now defined in a single consolidated YAML file (`data/stages_array.yaml`)
2. **Templates** - Complete predefined protocols stored in individual files
3. **Builder Interface** - Interactive UI for customizing protocols
3. **Builder Interface** - Interactive UI for customizing protocols, with improved template selection
4. **Export System** - Tools to export protocols in various formats
## Adding New Features