TEMPLATE_SYSTEM_OVERVIEW.md
md8 kBIn solution.zip
Template System Overview
📋 What Students Get
This template system provides everything students need EXCEPT the React logic:
✅ Provided (Students DON'T need to write)
- Complete CSS - All styles pre-written in
index.css - HTML/JSX Structure - Component templates with full markup
- Sample Data - Initial events array
- Project Setup - Vite configuration, package.json
- Instructions - Step-by-step guides
❌ Students MUST Implement
- State Management -
useStatedeclarations - Event Handlers - Click handlers, form handlers
- Filtering Logic - Derived state calculations
- Conditional Rendering - Show/hide based on state
- Form Validation - Error checking and display
- Statistics Calculations - Derived metrics
📂 File Structure
react-part/
│
├── TEMPLATES/ ← Student's main resource
│ ├── QUICK_START.md ← Setup instructions
│ └── COMPONENT_TEMPLATES.md ← Code to copy
│
├── src/
│ ├── components/ ← Students create files here
│ │ └── .gitkeep ← Placeholder
│ ├── App.jsx ← Default React app (to be replaced)
│ ├── index.css ← ✅ COMPLETE CSS (400+ lines)
│ ├── main.jsx ← Entry point (don't modify)
│ └── ...
│
├── README.md ← Project overview
└── package.json ← Dependencies
🎯 How Students Use This
Step 1: Setup
npm install
npm run devStep 2: Read Templates
- Open
TEMPLATES/COMPONENT_TEMPLATES.md - Review the structure and TODOs
Step 3: Create Components
Create these files in src/components/:
EventCard.jsxFilterPanel.jsxEditEventForm.jsxStatsDashboard.jsx
Step 4: Copy & Implement
- Copy template code into each file
- Find all
// TODOcomments - Uncomment the code
- Implement the logic
Step 5: Test
npm run devVisit localhost and test functionality
🎨 CSS Class Reference
All classes are defined in src/index.css:
Layout
container- Max-width centered containercard- White card with shadow and paddinggrid grid-2- 2-column responsive grid
Buttons
btn- Base button classbtn-primary- Blue buttonbtn-secondary- Gray buttonbtn-danger- Red buttonbtn-sm- Small size
Event Cards
event-card- Card wrapperevent-card.selected- Selected state (border + background)event-card-title- Event title stylingevent-card-speaker- Speaker name styling
Badges
badge- Base badge classbadge-workshop- Blue workshop badgebadge-talk- Pink talk badgebadge-available- Green statusbadge-almost-full- Yellow statusbadge-sold-out- Red status
Forms
form-group- Field wrapper with marginform-label- Field labelform-input- Text inputform-select- Dropdown selectform-textarea- Textareaform-checkbox- Checkbox with labelform-radio- Radio button with labelform-error- Error message (red text)
Statistics
stats-grid- Grid for stat cardsstat-card- Individual stat cardstat-label- Stat label textstat-value- Large stat valuestat-unit- Unit text (%, etc.)
Alerts
alert- Base alert classalert-warning- Yellow warningalert-success- Green successalert-info- Blue info
Modal
modal-overlay- Full-screen overlaymodal- Modal containermodal-header- Modal headermodal-body- Modal contentmodal-footer- Modal actions
💡 Teaching Strategy
Focus Areas
Students must demonstrate understanding of:
-
State Management
- Where to declare state
- How to update state
- When to use derived vs stored state
-
Controlled Components
valueprop from stateonChangeupdates state- Two-way data binding
-
Derived State
- Calculate during render
- Don't use
useEffectfor filtering - Don't store calculated values
-
Conditional Rendering
- Ternary operators
- Logical AND (
&&) - Different content based on state
-
Form Validation
- Track touched fields
- Show errors conditionally
- Disable submit when invalid
What's Abstracted Away
- CSS/Styling (pre-written)
- Build configuration (Vite)
- Basic project structure
- HTML markup (in templates)
What Students Build
- React logic
- State flow
- Event handling
- Validation logic
- Conditional display
🧪 Verification Points
Q1: Event Dashboard
- State initialized correctly
- Filtering combines all conditions
- Cards display with correct classes
- Selected state highlighted
- Empty state shows when no results
Q2: Filter Panel
- All inputs are controlled
- Filter summary updates
- Reset button conditionally visible
- Filters actually filter events
Q3: Edit Form
- Form data initialized from event
- Validation runs on field blur
- Errors show only when touched
- Capacity validates against registered
- Conditional fields for workshops
- Submit disabled when errors exist
Q4: Statistics
- All metrics calculated correctly
- No statistics stored in state
- Updates when filters change
- High occupancy alert conditional
📝 Grading Focus
Full Points If:
- Uses
useStatecorrectly - No
useEffectfor filtering - All inputs controlled
- Validation works properly
- Conditional rendering correct
- No console errors
Point Deductions For:
- Storing derived state
- Using
useEffectfor filtering - Uncontrolled inputs
- Missing validation
- Hard-coded values
- Console errors
- Poor variable names
🎓 Student Success Tips
- Read templates first - Don't start coding blindly
- Implement one component at a time - Don't try everything at once
- Test frequently - Check after each TODO
- Use browser DevTools - Check console for errors
- Follow TODO order - They're sequenced logically
- Don't modify CSS - It's complete and tested
- Read exam instructions - Know the requirements
🔧 Customization Notes
If you need to modify this template:
To Change Styling:
- Edit
src/index.css - Keep class names consistent
- Update
COMPONENT_TEMPLATES.mdif classes change
To Add Components:
- Add new section to
COMPONENT_TEMPLATES.md - Include sample data if needed
- Add to checklist in
QUICK_START.md
To Change Requirements:
- Update exam instructions (separate file)
- Update TODOs in templates
- Update verification checklist
📊 Template Statistics
- CSS Lines: ~400 (complete styling)
- Template Components: 5 (+ 1 bonus)
- Total TODOs: ~50 across all components
- Sample Data: 6 events
- Estimated Completion Time: 90 minutes
✅ Quality Checklist
This template provides:
- Complete, tested CSS
- Semantic HTML structure
- Clear TODO comments
- Sample data for testing
- Multiple documentation files
- Quick start guide
- Common pitfalls guide
- Testing checklist
- Grading rubric reference
🎯 Summary
What makes this template effective:
- CSS is done - Students focus on React
- Structure provided - Reduces analysis paralysis
- TODOs guide - Clear implementation path
- Testing data included - Can verify immediately
- Multiple docs - Different learning styles
- Progressive difficulty - Builds from simple to complex
Result: Students can focus entirely on React concepts without worrying about styling or project setup.