A simple and handy Todo application with the ability to add, edit, toggle completion, and delete tasks. Includes filters (All / Active / Completed), an active items counter, bulk actions (toggle all, clear completed), loading indicators, and error notifications.
Built with React 18 + TypeScript, powered by Vite. Styles are written in SCSS with Bulma.
- Features
- Tech stack
- Requirements
- Quick start
- Available scripts
- API
- User configuration
- Project structure
- Deploy to GitHub Pages
- License
- Add todo: input with autofocus, empty-title validation
- Edit todo: double-click the title; blur/Enter to save; Esc to cancel
- Toggle completion: individually or use "Toggle all"
- Delete: single item or bulk clear of all completed
- Filters:
All,Active,Completed - Counter: number of active (not completed) items
- Loading states: per-todo overlay loaders and global states
- Error notifications: friendly messages on load/add/update/delete failures
- React 18, TypeScript
- Vite for the dev server and build
- SCSS + Bulma for base styling
- classnames for conditional classes
- Node.js 20 LTS (same as the Mate Academy environment)
- npm 9+ (or a matching version for Node 20)
The app uses the Mate Academy Students API:
- Base URL:
https://mate.academy/students-api - HTTP client is implemented in
src/utils/fetchClient.ts - Todo endpoints in
src/api/todos.ts:getTodos()—GET /todos?userId=<USER_ID>addTodos(todo)—POST /todosupdateTodos(id, patch)—PATCH /todos/:iddeleteTodos(id)—DELETE /todos/:id
On non-OK responses the fetchClient throws an error, which is shown in the UI as a notification.
index.html— page templatevite.config.ts— Vite configuration (React plugin)public/— static assets (e.g.,favicon.ico)src/index.tsx— React entry pointApp.tsx— main component with CRUD, filters, and bulk actionsUserWarning.tsx— notification whenUSER_IDis not setapi/todos.ts— todo API calls via the HTTP clientutils/fetchClient.ts— generic HTTP client built onfetchtypes/Todo.ts—Todotypetypes/enums.ts—FilterandErrorsenumsstyles/*.scss— application styles