A web app for browsing D&D 5e spells. Built with Svelte 5, Vite, and Tailwind CSS.
Spell list with search and filters |
Detailed spell view with markdown |
Responsive spell list |
Spell details with back button |
Light, dark, and system theme options |
Cache stats widget |
You need Node.js (v16+) and Bun.
# Install dependencies
bun install
# Run dev server
bun run dev
# Build for production
bun run build
# Preview production build
bun run preview
src/
├── lib/
│ ├── CacheStats.svelte # Cache stats widget
│ ├── Filters.svelte # Search and filter controls
│ ├── SpellDetail.svelte # Spell detail view
│ ├── SpellList.svelte # Spell list
│ ├── ThemeToggle.svelte # Theme switcher
│ ├── api.svelte.js # API calls
│ ├── cache.svelte.js # Caching
│ └── markdown.svelte.js # Markdown rendering
├── App.svelte # Main app
├── app.css # Global styles
├── main.js # Entry point
└── types.svelte.js # Type definitions
The code follows single responsibility principle - each file does one thing. Components handle UI, utilities handle logic.
API responses are cached in memory to avoid rate limits:
There's a little cache stats widget in the bottom-right corner if you want to see what's cached.
You can pick light mode, dark mode, or just use your system preference. Your choice gets saved in localStorage.
Uses JSDoc for type hints instead of TypeScript. Each module has a single responsibility - API stuff in api.svelte.js, markdown rendering in markdown.svelte.js, etc.
Caching Improvements
Features
Infrastructure
Spell data from D&D 5e API. D&D is owned by Wizards of the Coast.