A modern todo application built with vanilla JavaScript (ES6+) following clean architecture principles, featuring IndexedDB persistence and smooth animations.
- Clean Architecture - State → Rules → Actions → UI pattern
- IndexedDB Persistence - Todos saved locally and persist across sessions
- Smooth Animations - Create/destroy animations for better UX
- Modern ES6+ - Modules, classes, arrow functions, async/await
- Filter System - View all, active, or completed todos
- Statistics - Track total, active, and completed todos
- Responsive Design - Works on mobile, tablet, and desktop
- Dark Theme - Beautiful dark UI with gradient accents
- Open
index.htmlin your browser - Start adding todos!
- Your todos are automatically saved
This project demonstrates modern web development patterns:
- Getting Started - Understand the structure
- Architecture - Learn the design patterns
- Building Tutorial - Build it step-by-step
- IndexedDB Guide - Learn browser storage
- Animations Guide - CSS & JS animations
State (TodoState)
↓
Rules (TodoLogic) → Pure functions, no side effects
↓
Actions (add, toggle, delete)
↓
UI (Renderer + EventHandler) → DOM updates with animations
↓
Storage (IndexedDBService) → Persistent data
todo-app/
├── index.html
├── src/
│ ├── core/ # Pure logic
│ │ ├── constants.js
│ │ ├── TodoLogic.js
│ │ └── utils.js
│ ├── services/ # External integrations
│ │ └── IndexedDBService.js
│ ├── state/ # Orchestration
│ │ └── TodoState.js
│ ├── ui/ # Rendering & events
│ │ ├── Renderer.js
│ │ └── EventHandler.js
│ └── main.js # Entry point
├── styles/
│ ├── main.css
│ ├── components.css
│ └── animations.css
└── docs/ # Tutorials
- ✅ Async/await & Promises
- ✅ IndexedDB API
- ✅ Modules (import/export)
- ✅ Classes & static methods
- ✅ Array methods (map, filter, sort)
- ✅ Spread operator
- ✅ Template literals
- ✅ Optional chaining
- ✅ CSS Variables
- ✅ Flexbox layout
- ✅ Keyframe animations
- ✅ Transitions
- ✅ Responsive design
- ✅ Custom scrollbars
- ✅ Separation of concerns
- ✅ Pure functions
- ✅ State management
- ✅ Event handling
- ✅ CRUD operations
- ✅ Persistent storage
- Type in the input field
- Press Enter or click "Add"
- Todo appears with animation
- Check/Uncheck - Toggle completion status
- Delete - Click X button (appears on hover)
- Filter - View all, active, or completed
- Clear Completed - Remove all completed todos
Enter- Add new todoEscape- Clear input (when focused)
// Todos automatically saved to browser database
await storage.addTodo(newTodo);// CSS animations triggered by JavaScript
element.classList.add('todo-entering');static createTodo(text) {
return { id, text, status, createdAt };
}async addTodo(text) {
await this.storage.addTodo(newTodo);
await this.renderer.animateAddTodo(newTodo);
}- Add todo categories/tags
- Add due dates
- Change color scheme
- Add drag-and-drop reordering
- Add todo editing
- Add priority levels
- Export/import todos
- Add cloud sync (Firebase)
- Add collaborative features
- Add recurring todos
- Rebuild in React/Vue/Svelte
Built with ❤️ using vanilla JavaScript and IndexedDB