A modern, responsive todo application built with Svelte 5 and TypeScript, featuring a beautiful purple gradient design with gold accents.
- ✨ Svelte 5 + TypeScript - Modern, reactive framework with type safety
- 🎨 Beautiful UI - Purple gradient background with gold accents
- ➕ Add tasks - Easy task creation with form input
- ✅ Toggle completion - Mark tasks as complete/incomplete
- 🗑️ Delete tasks - Remove tasks with a click
- ✏️ Edit tasks - Modify task text
- 🔍 Filter tabs - View All, Active, or Completed tasks
- 📊 Statistics - See task counts at a glance
- 🎯 Drag & drop - Reorder tasks easily
- 💾 Local storage - Tasks persist in browser storage
- 📱 Responsive design - Works great on mobile and desktop
- ⚡ Fast builds - Optimized Vite configuration
- Svelte 5 - Reactive UI framework
- TypeScript - Type safety
- Vite - Fast build tool and dev server
- Svelte-dnd-action - Drag and drop functionality
- Express - Backend API (for database integration)
- Install dependencies:
npm installRun the development server:
npm run devThe app will be available at http://localhost:5173
Create an optimized production build:
npm run buildThe build output will be in the dist/ directory.
Preview the production build:
npm run previewtodo-app/
├── src/
│ ├── App.svelte # Main application component
│ ├── main.ts # Entry point
│ ├── TaskForm.svelte # Task input form
│ ├── TaskList.svelte # Task list with drag & drop
│ ├── TaskItem.svelte # Individual task component
│ ├── FilterTabs.svelte # Filter buttons
│ ├── StatsDisplay.svelte # Statistics display
│ ├── vite-env.d.ts # TypeScript types for Vite
│ └── svelte-dnd-action.d.ts # Type definitions for drag & drop
├── public/
│ └── index.html # HTML entry point
├── index.js # Express server (backend)
├── package.json # Dependencies and scripts
├── tsconfig.json # TypeScript configuration
├── vite.config.ts # Vite configuration
└── dist/ # Build output (generated)
Main application component that manages:
- Task state (tasks array)
- Current filter state
- Task CRUD operations
- Statistics calculation
Form component for adding new tasks with:
- Text input with enter key support
- Validation
- Add button
Displays and manages the list of tasks with:
- Drag and drop reordering
- Filter display
- Task actions (edit, delete)
- Accessibility features
Filter buttons for viewing:
- All tasks
- Active tasks only
- Completed tasks only
Shows task statistics:
- Total count
- Completed count
- Active count
- Custom message based on state
Individual task display with:
- Checkbox for completion
- Task text
- Edit and delete buttons
- Drag handle
The app uses a beautiful purple gradient design:
- Primary gradient:
linear-gradient(135deg, #667eea 0%, #764ba2 100%) - Gold accents:
#d4af37 - Clean white container with shadow
- Smooth animations and transitions
The app is fully responsive:
- Mobile: 12px padding, smaller fonts, stacked form
- Desktop: 24px padding, larger fonts, side-by-side form
- All screens have consistent spacing and typography
For database integration, you can run the Express backend:
npm startThis will start the API server on port 3000. The frontend will proxy requests to /api through Vite's dev server.
The app supports SQLite database integration. When no tasks are found in localStorage, it will attempt to load from restaurants.db. You'll need to set up the database schema in the Express backend.
- Chrome/Edge: ✓
- Firefox: ✓
- Safari: ✓
- Mobile browsers: ✓
ISC