A modern, feature-rich todo list application built with SvelteKit, showcasing best practices in web development.
src/
├── lib/
│ ├── components/ # Reusable Svelte components
│ │ ├── TodoInput.svelte # Input form for new todos
│ │ ├── TodoList.svelte # List container for todos
│ │ ├── TodoItem.svelte # Individual todo item
│ │ ├── TodoFilters.svelte # Filter buttons
│ │ └── TodoStats.svelte # Statistics dashboard
│ ├── stores/ # State management
│ │ ├── todoStore.ts # Basic store implementation
│ │ └── persistentTodoStore.ts # Store with localStorage
│ ├── types/ # TypeScript definitions
│ │ └── todo.ts # Todo-related types
│ └── utils/ # Utility functions
│ └── localStorage.ts # LocalStorage helpers
├── routes/ # SvelteKit routes
│ ├── +layout.svelte # Root layout with navigation
│ ├── +page.svelte # Home page with todo app
│ ├── about/
│ │ └── +page.svelte # About page
│ └── api/
│ └── todos/ # API endpoints (demo)
│ ├── +server.ts # CRUD API routes
│ └── stats/
│ └── +server.ts
├── app.css # Global styles
└── app.html # HTML template
Clone the repository:
git clone <repository-url>
cd todo-list
Install dependencies:
npm install
Start the development server:
npm run dev
Open your browser to http://localhost:5173
npm run dev - Start development servernpm run build - Build for productionnpm run preview - Preview production buildnpm run check - Run type checkingnpm run lint - Check code formattingnpm run format - Format code with Prettiernpm run build
The build output will be in the build directory, ready to be deployed to any static hosting service.
The project includes example API routes to demonstrate SvelteKit's server-side capabilities:
GET /api/todos - Fetch all todosPOST /api/todos - Create a new todoPUT /api/todos - Update a todoDELETE /api/todos - Delete a todoGET /api/todos/stats - Get statisticsThe application demonstrates both basic and persistent store implementations, showing how to extend Svelte's store functionality.
Filtered todos and statistics are computed using derived stores, automatically updating when dependencies change.
Small, focused components are composed to build complex UIs while maintaining reusability.
Full type safety from data models to component props, catching errors at compile time.
MIT
Built to showcase SvelteKit development expertise.