Welcome to your incomplete Svelte Task Dashboard! This project is intentionally about 50% complete to help you learn Svelte by filling in the gaps.
A task management dashboard built with SvelteKit that allows users to:
npm install
npm run dev
Then open http://localhost:5173 in your browser.
Complete the missing functionality to make the dashboard fully operational! The project will run even in its incomplete state, but features won't work properly until you fix them.
Work through these tasks in order (or jump around if you prefer!):
task prop exportpriorityColors object mapping (low/medium/high to colors)handleToggleComplete() functionhandleDelete() functiononMount function to load tasks from APIfilteredTaskshandleFilterChange() functionvalidateForm() function with validation ruleshandleSubmit() functiontotalTasks from the tasks arraycompletedTasks countcompletionPercentageaddTask() method in the task storedeleteTask() method in the task storetoggleComplete() method in the task storeupdateTask() method in the task storeloadTasks() async function with mock delaysaveTask() async functionremoveTask() async functiongetPriorityColor() function (wrong comparison operator)Once you've completed all the tasks above, you should be able to:
$: for computed valuesonMount for initializationbind:valueclass:directive{#each}Svelte Reactivity: Use $: before statements to make them reactive
$: doubled = count * 2; // Updates whenever count changes
Store Updates: Use update() to modify store values
update(currentValue => {
// Modify and return new value
return newValue;
});
Array Filtering: Use JavaScript's filter() method
const filtered = array.filter(item => item.status === 'todo');
Form Validation: Check string length and emptiness
if (!title || title.trim().length < 3) {
errors.title = 'Title must be at least 3 characters';
}
src/
├── routes/
│ ├── +page.svelte # Main dashboard page
│ └── +layout.svelte # App layout wrapper
├── lib/
│ ├── components/
│ │ ├── TaskCard.svelte # Individual task display
│ │ ├── TaskList.svelte # List of tasks
│ │ ├── StatsCard.svelte # Statistics display
│ │ └── AddTaskForm.svelte # Form to add tasks
│ ├── stores/
│ │ └── tasks.js # Global task state
│ └── utils/
│ └── api.js # Mock API functions
└── app.css # Global styles
Issue: Tasks don't show up on page load
onMount function in +page.svelte and the loadTasks() function in api.jsIssue: Can't add new tasks
addTask() method in tasks.js and complete the form submission in AddTaskForm.svelteIssue: Statistics show as 0
Issue: Filtering doesn't work
currentFilterIssue: Wrong priority colors or sorting
Once you've completed this project, consider:
Good luck, and happy learning! 🚀