Example Mapping application built with SvelteKit - An offline, drag-and-drop tool for managing Example Mapping sessions with hierarchical structure support.
- π― Four Card Types: Epic (purple), Rule (blue), Example (green), Question (red)
- π Hierarchical Structure: Link cards in a hierarchy (Epic β Rules β Examples/Questions)
- π Visual Indicators: Parent links, children counts, and badges showing relationships
- βοΈ Inline Editing: Double-click any card to edit its content
- π±οΈ Drag & Drop: Move cards around using pointer events
- πΎ Import/Export: Save and load your mappings in two formats:
- Flat JSON: Traditional format with all cards in a single array
- Nested JSON: Hierarchical format preserving parent-child relationships
- π Link Mode: Interactive mode to create parent-child relationships between cards
- ποΈ Smart Deletion: Deleting a parent card also removes its children
- π± Offline First: Works completely offline, no backend required
- π¨ Grid Background: Visual grid for better organization
- β Fully Tested: Comprehensive test coverage with Vitest
The application supports a three-level hierarchy:
Epic (Purple)
βββ Rule (Blue)
βββ Example (Green)
βββ Question (Red)
- Parent Badge: Cards show their parent with format
β type: Parent Name - Children Counts: Parent cards display badges showing:
- Epics:
2 π(rules),3 β(examples),4 β(questions) - Rules:
2 β(examples),3 β(questions)
- Epics:
- Unlink Button:
βοΈβπ₯button to remove parent-child relationship
- Click the π Link Cards button in the toolbar
- Click a child card (the card you want to link)
- Click a parent card (the card to link to)
- The relationship is created automatically with validation
Hierarchy Rules:
- Epic cards cannot have parents
- Rules can only be linked to Epics
- Examples and Questions can only be linked to Rules
Preserves the hierarchical structure. See example-nested.json for a complete example.
{
"version": "2.0.0",
"epics": [
{
"id": "epic-uuid",
"title": "Epic A",
"rules": [
{
"id": "rule-uuid",
"title": "Rule 1",
"examples": [
{ "id": "ex-uuid", "text": "Example 1" }
],
"questions": [
{ "id": "q-uuid", "text": "Question 1" }
]
}
]
}
]
}Legacy format with all cards in a flat array:
{
"version": "1.0.0",
"cards": [
{
"id": "1",
"type": "epic",
"content": "Epic 1",
"position": { "x": 0, "y": 0 },
"parentId": "optional-parent-id"
}
]
}The nested import includes comprehensive validation:
- β Checks for missing or invalid IDs
- β Detects duplicate IDs across all entities
- β Validates required fields (title, text)
- β Ensures proper array structures
- β Provides clear error messages for invalid data
- β Prevents data corruption on import failures
Clean toolbar with card creation buttons and import/export options
Cards showing parent relationships and children counts with badges
Interactive linking mode for creating parent-child relationships
The application follows a modular structure for easy extension:
src/
βββ lib/
β βββ components/ # Svelte components
β β βββ Card.svelte
β β βββ Grid.svelte
β β βββ Toolbar.svelte
β βββ stores/ # State management
β β βββ cards.ts
β βββ services/ # Business logic
β β βββ jsonService.ts
β βββ types.ts # TypeScript types
βββ routes/ # SvelteKit routes
npm installnpm run dev
# or start the server and open the app in a new browser tab
npm run dev -- --opennpm run buildYou can preview the production build with npm run preview.
# Run tests
npm test
# Watch mode
npm run test:watch
# UI mode
npm run test:uiThe app is configured for static deployment and supports multiple platforms:
The app is configured for static deployment to GitHub Pages using GitHub Actions. Push to the main branch to automatically deploy.
The GitHub Actions workflow sets GITHUB_PAGES=true to ensure the correct base path is used.
The app can be deployed to Vercel with zero configuration:
- Import your repository to Vercel
- Vercel will automatically detect SvelteKit and use the correct settings
- Deploy!
Alternatively, you can use the Vercel CLI:
# Install Vercel CLI
npm install --global vercel
# Deploy
vercelThe vercel.json configuration file is included for optimal deployment settings.
- SvelteKit - Web framework
- TypeScript - Type safety
- Vitest - Testing framework
- @sveltejs/adapter-static - Static site generation
- GitHub Pages & Vercel - Deployment platforms
MIT License
Β© 2025 Anthony Criblez
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
