A modern, feature-rich todo application built with Angular 20 and styled with Tailwind CSS. This application demonstrates modern Angular development patterns including signals, standalone components, and dependency injection.
- ✅ Add new todos - Create tasks with a simple input field
- ✏️ Edit todos inline - Click on any todo text to edit it directly
- ✅ Mark todos complete - Check/uncheck todos to track completion
- 🗑️ Delete todos - Remove todos you no longer need
- 🔍 Filter todos - View all, active, or completed todos
- 📊 Task statistics - See counts of active, completed, and total tasks
- 💾 Local storage - Todos persist between browser sessions
- 🌐 External API integration - Loads initial data from DummyJSON API
- 🎨 Modern UI - Beautiful gradient design with smooth animations
- Framework: Angular 20.3.0
- Language: TypeScript 5.9.2
- Styling: Tailwind CSS 4.1.16
- State Management: Angular Signals
- HTTP Client: Angular HttpClient
- Testing: Jasmine & Karma
- Build Tool: Angular CLI
src/
├── app/
│ ├── components/ # Reusable UI components
│ │ ├── header/ # App header component
│ │ ├── create-task/ # Task creation form
│ │ ├── filter-bar/ # Filter buttons (All/Active/Completed)
│ │ ├── task-list/ # Main todo list display
│ │ └── task-stats/ # Statistics display
│ ├── models/ # TypeScript interfaces
│ │ └── todo.model.ts # Todo data models
│ ├── services/ # Business logic services
│ │ └── todo.ts # Main todo service with state management
│ ├── app.config.ts # App configuration
│ ├── app.ts # Root component
│ └── app.html # Main app template
├── main.ts # Application bootstrap
├── index.html # HTML entry point
└── styles.scss # Global styles
- Standalone Components: All components use the new standalone component API
- Angular Signals: Reactive state management using signals for better performance
- Dependency Injection: Clean service injection using the
inject()function - Computed Values: Derived state using
computed()for filtered todos and statistics
The application uses a centralized TodoService that manages all todo operations:
- Reactive State: Uses Angular signals for reactive state updates
- Local Storage: Automatic persistence to browser storage
- External API: Initial data loading from DummyJSON API
- Computed Properties: Automatically calculated filtered todos and statistics
- Header: Displays the app title
- CreateTask: Input form for adding new todos
- FilterBar: Navigation buttons for filtering todos
- TaskList: Main list displaying todos with inline editing
- TaskStats: Statistics showing task counts
- Node.js (version 18 or higher)
- npm or yarn package manager
-
Clone the repository (if applicable):
git clone <repository-url> cd basic-todos-app
-
Install dependencies:
npm install
-
Start the development server:
npm start
-
Open your browser and navigate to
http://localhost:4200
npm start- Start the development servernpm run build- Build the app for productionnpm test- Run unit testsnpm run watch- Build in watch mode for development
- Type your task in the input field at the top
- Press Enter or click the "Add" button
- Your todo will appear in the list below
- Complete a todo: Click the checkbox next to any todo
- Edit a todo: Click on the todo text, edit it, and press Enter
- Delete a todo: Click the "✕" button next to any todo
Use the filter buttons to view different sets of todos:
- All: Shows all todos
- Active: Shows only incomplete todos
- Completed: Shows only completed todos
The app displays real-time statistics:
- Active todos count
- Completed todos count
- Total todos count
The app loads initial data from the DummyJSON API. You can modify the API endpoint in src/app/services/todo.ts:
private loadDataFromAPI() {
this.httpClient
.get<TodoListResult>('https://dummyjson.com/todos')
.subscribe((result: TodoListResult) => {
this.todos.set(result.todos);
});
}The app uses Tailwind CSS for styling. You can customize the design by:
- Modifying utility classes in component templates
- Adding custom styles in component
.scssfiles - Extending Tailwind configuration (if needed)
Run the test suite with:
npm testThe application includes unit tests for:
- Components functionality
- Service methods
- Todo operations
Create a production build:
npm run buildThe build artifacts will be stored in the dist/ directory.
- Local Storage: Todos are automatically saved to browser local storage
- API Integration: Initial data is loaded from external API
- Automatic Sync: Changes are immediately persisted locally
- Modern UI: Clean, gradient-based design with rounded corners
- Responsive: Works well on desktop and mobile devices
- Smooth Animations: Hover effects and transitions for better UX
- Visual Feedback: Clear visual states for completed/active todos
- Accessibility: Proper ARIA labels and semantic HTML
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes
- Add tests for new functionality
- Commit your changes:
git commit -m 'Add feature' - Push to the branch:
git push origin feature-name - Submit a pull request
This project is open source and available under the MIT License.
- Angular team for the amazing framework
- Tailwind CSS for the utility-first CSS framework
- DummyJSON for providing the demo API