This is a simple Task Manager application built with Svelte, a lightweight front-end framework. This project explores Svelte's reactivity, component structure, and state management while following best practices in frontend architecture.
Unlike React or Vue, Svelte compiles code at build time, eliminating the need for a virtual DOM. This results in faster performance and smaller bundle sizes. This project was an opportunity to explore:
svelte-task-manager/
├── src/
│ ├── assets/ # Static assets (icons, images, etc.)
│ ├── components/ # UI Components
│ │ ├── DarkModeToggle.svelte # Dark mode toggle switch
│ │ ├── TaskEntry.svelte # Task input field
│ │ ├── TaskList.svelte # List of tasks
│ │ ├── TaskListItem.svelte # Individual task item
│ ├── models/ # TypeScript interfaces/models
│ │ ├── Task.ts # Task model definition
│ │ ├── TaskStatus.ts # Enum for task statuses
│ ├── repositories/ # Repository pattern for data management
│ │ ├── ITaskRepository.ts # Interface for task storage
│ │ ├── LocalStorageTaskRepository.ts # Concrete implementation using LocalStorage
│ ├── services/ # Business logic layer
│ │ ├── TaskService.ts # Handles task operations (add, remove, toggle status)
│ ├── styles/ # Styling files
│ │ ├── app.css # Global Tailwind styles
│ ├── App.svelte # Root application component
│ ├── main.ts # Entry point for the application
├── public/ # Static files
├── package.json # Project dependencies & scripts
├── tailwind.config.ts # Tailwind configuration
├── vite.config.ts # Vite configuration
Repository Pattern (repositories/
)
ITaskRepository.ts
defines a contract for task storage, allowing multiple implementations like LocalStorage or future database-backed repositories.LocalStorageTaskRepository.ts
implements the repository for LocalStorage.Service Layer (TaskService.ts
)
Component-Based UI (components/
)
Make sure you have the following installed:
Clone the repository:
git clone https://github.com/faradaysage/svelte-task-manager.git
cd svelte-task-manager
Install dependencies:
npm install
Run the development server:
npm run dev
Open the application in your browser:
http://localhost:5173
✅ Add tasks
✅ Mark tasks as complete/incomplete
✅ Delete tasks
✅ Persist tasks using LocalStorage
✅ Dark Mode toggle
✅ Responsive UI with Tailwind CSS
This project is open-source and free to use.