├── src ├── app │ ├── favicon.ico │ ├── globals.css │ ├── layout.tsx │ └── page.tsx ├── styles │ └── fonts.css ├── components │ ├── TaskProgress.tsx │ ├── TodoForm.tsx │ ├── FilterButtons.tsx │ ├── TodoItem.tsx │ └── TodoList.tsx ├── hooks │ └── useLocalStorage.ts └── context │ └── TodoContext.tsx ├── next.config.mjs ├── public └── fonts │ └── Vazir-Bold-FD-WOL.woff2 ├── .github ├── ISSUE_TEMPLATE │ ├── custom.md │ ├── feature_request.md │ └── bug_report.md └── PULL_REQUEST_TEMPLATE.md ├── postcss.config.mjs ├── .eslintrc.json ├── github └── workflows │ └── lint.yml ├── tailwind.config.ts ├── tsconfig.json ├── SECURITY.md ├── package.json ├── .prettierrc.json ├── LICENSE ├── README.md ├── .gitignore ├── CODE_OF_CONDUCT.md └── CONTRIBUTING.md /src/app/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frau-azadeh/to-do-list/HEAD/src/app/favicon.ico -------------------------------------------------------------------------------- /next.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('next').NextConfig} */ 2 | const nextConfig = {}; 3 | 4 | export default nextConfig; 5 | -------------------------------------------------------------------------------- /public/fonts/Vazir-Bold-FD-WOL.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/frau-azadeh/to-do-list/HEAD/public/fonts/Vazir-Bold-FD-WOL.woff2 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: Describe this issue template's purpose here. 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | -------------------------------------------------------------------------------- /postcss.config.mjs: -------------------------------------------------------------------------------- 1 | /** @type {import('postcss-load-config').Config} */ 2 | const config = { 3 | plugins: { 4 | tailwindcss: {}, 5 | }, 6 | }; 7 | 8 | export default config; 9 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["next/core-web-vitals", "next/typescript"], 3 | "rules": { 4 | "react/jsx-key": "off", 5 | "react/no-array-index-key": "warn", 6 | "@typescript-eslint/no-unused-vars": "warn", 7 | "@next/next/no-html-link-for-pages": "off" 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/app/globals.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | :root { 6 | --background: #ffffff; 7 | --foreground: #171717; 8 | } 9 | 10 | @media (prefers-color-scheme: dark) { 11 | :root { 12 | --primary-color: #0000ff; 13 | --text-color: #666666; 14 | --background-color: #fed7aa; 15 | --success-color: #4caf50; 16 | --error-color: #f44336; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | on: 3 | push: 4 | branches: ["master"] 5 | pull_request: 6 | workflow_dispatch: 7 | 8 | jobs: 9 | lint: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - uses: actions/checkout@v4.2.1 13 | 14 | - uses: actions/setup-node@v4 15 | with: 16 | node-version: 20 17 | 18 | - name: Install Dependencies 19 | run: npm i 20 | 21 | - name: Prettier 22 | run: npm run prettier:check 23 | 24 | - name: Lint 25 | run: npm run lint 26 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ## Description 2 | 3 | Please provide a brief description of the changes you made. 4 | 5 | ## Related Issue 6 | 7 | If this pull request is related to an issue, please link it here. 8 | 9 | ## Checklist 10 | 11 | - [ ] My code follows the style guidelines of this project. 12 | - [ ] I have performed a self-review of my code. 13 | - [ ] I have commented my code, particularly in hard-to-understand areas. 14 | - [ ] I have made corresponding changes to the documentation. 15 | - [ ] My changes generate no new warnings. 16 | -------------------------------------------------------------------------------- /src/styles/fonts.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "Vazir"; 3 | src: url("../../public/fonts/Vazir-Bold-FD-WOL.woff2") format("woff2"); 4 | font-weight: 400; 5 | font-style: normal; 6 | } 7 | 8 | @font-face { 9 | font-family: "Vazir"; 10 | src: url("../../public/fonts/Vazir-Bold-FD-WOL.woff2") format("woff2"); 11 | font-weight: 700; 12 | font-style: normal; 13 | } 14 | 15 | @font-face { 16 | font-family: "Vazir"; 17 | src: url("../../public/fonts/Vazir-Bold-FD-WOL.woff2") format("woff2"); 18 | font-weight: 300; 19 | font-style: normal; 20 | } 21 | -------------------------------------------------------------------------------- /tailwind.config.ts: -------------------------------------------------------------------------------- 1 | import type { Config } from "tailwindcss"; 2 | 3 | const config: Config = { 4 | content: [ 5 | "./src/pages/**/*.{js,ts,jsx,tsx,mdx}", 6 | "./src/components/**/*.{js,ts,jsx,tsx,mdx}", 7 | "./src/app/**/*.{js,ts,jsx,tsx,mdx}", 8 | ], 9 | theme: { 10 | extend: { 11 | colors: { 12 | background: "var(--background)", 13 | foreground: "var(--foreground)", 14 | }, 15 | fontFamily: { 16 | vazir: ["Vazir"], 17 | }, 18 | }, 19 | }, 20 | plugins: [], 21 | }; 22 | export default config; 23 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "lib": ["dom", "dom.iterable", "esnext"], 4 | "allowJs": true, 5 | "skipLibCheck": true, 6 | "strict": true, 7 | "noEmit": true, 8 | "esModuleInterop": true, 9 | "module": "esnext", 10 | "moduleResolution": "bundler", 11 | "resolveJsonModule": true, 12 | "isolatedModules": true, 13 | "jsx": "preserve", 14 | "incremental": true, 15 | "plugins": [ 16 | { 17 | "name": "next" 18 | } 19 | ], 20 | "paths": { 21 | "@/*": ["./src/*"] 22 | } 23 | }, 24 | "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], 25 | "exclude": ["node_modules"] 26 | } 27 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Is your feature request related to a problem? Please describe.** 10 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 11 | 12 | **Describe the solution you'd like** 13 | A clear and concise description of what you want to happen. 14 | 15 | **Describe alternatives you've considered** 16 | A clear and concise description of any alternative solutions or features you've considered. 17 | 18 | **Additional context** 19 | Add any other context or screenshots about the feature request here. 20 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Supported Versions 4 | 5 | Use this section to tell people about which versions of your project are 6 | currently being supported with security updates. 7 | 8 | | Version | Supported | 9 | | ------- | ------------------ | 10 | | 5.1.x | :white_check_mark: | 11 | | 5.0.x | :x: | 12 | | 4.0.x | :white_check_mark: | 13 | | < 4.0 | :x: | 14 | 15 | ## Reporting a Vulnerability 16 | 17 | Use this section to tell people how to report a vulnerability. 18 | 19 | Tell them where to go, how often they can expect to get an update on a 20 | reported vulnerability, what to expect if the vulnerability is accepted or 21 | declined, etc. 22 | -------------------------------------------------------------------------------- /src/components/TaskProgress.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React from "react"; 4 | 5 | import { Progress } from "antd"; 6 | 7 | import { useTodos } from "@/context/TodoContext"; 8 | 9 | const TaskProgress: React.FC = () => { 10 | const { state } = useTodos(); 11 | 12 | const totalTasks = state.todos.length; 13 | const completedTasks = state.todos.filter((todo) => todo.completed).length; 14 | const progress = totalTasks > 0 ? (completedTasks / totalTasks) * 100 : 0; 15 | 16 | return ( 17 |
18 |

درصد پیشرفت وظایف

19 | 20 |
21 | ); 22 | }; 23 | 24 | export default TaskProgress; 25 | -------------------------------------------------------------------------------- /src/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import { ConfigProvider } from "antd"; 2 | import type { Metadata } from "next"; 3 | 4 | import { TodoProvider } from "@/context/TodoContext"; 5 | 6 | import "../styles/fonts.css"; 7 | // برای مدیریت تم 8 | import "./globals.css"; 9 | 10 | export const metadata: Metadata = { 11 | title: "To Do List", 12 | description: "This is my app, add delete update my task with this app", 13 | }; 14 | 15 | export default function RootLayout({ 16 | children, 17 | }: Readonly<{ 18 | children: React.ReactNode; 19 | }>) { 20 | return ( 21 | 22 | 23 | 33 | {children} 34 | 35 | 36 | 37 | ); 38 | } 39 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: "" 5 | labels: "" 6 | assignees: "" 7 | --- 8 | 9 | **Describe the bug** 10 | A clear and concise description of what the bug is. 11 | 12 | **To Reproduce** 13 | Steps to reproduce the behavior: 14 | 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | 28 | - OS: [e.g. iOS] 29 | - Browser [e.g. chrome, safari] 30 | - Version [e.g. 22] 31 | 32 | **Smartphone (please complete the following information):** 33 | 34 | - Device: [e.g. iPhone6] 35 | - OS: [e.g. iOS8.1] 36 | - Browser [e.g. stock browser, safari] 37 | - Version [e.g. 22] 38 | 39 | **Additional context** 40 | Add any other context about the problem here. 41 | -------------------------------------------------------------------------------- /src/hooks/useLocalStorage.ts: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { useState } from "react"; 4 | 5 | function useLocalStorage(key: string, initialValue: T) { 6 | const [storedValue, setStoredValue] = useState(() => { 7 | if (typeof window === "undefined") return initialValue; 8 | try { 9 | const item = window.localStorage.getItem(key); 10 | return item ? JSON.parse(item) : initialValue; 11 | } catch (error) { 12 | console.error(error); 13 | return initialValue; 14 | } 15 | }); 16 | 17 | const setValue = (value: T | ((val: T) => T)) => { 18 | try { 19 | const valueToStore = 20 | value instanceof Function ? value(storedValue) : value; 21 | setStoredValue(valueToStore); 22 | if (typeof window !== "undefined") { 23 | window.localStorage.setItem(key, JSON.stringify(valueToStore)); 24 | } 25 | } catch (error) { 26 | console.error(error); 27 | } 28 | }; 29 | 30 | return [storedValue, setValue] as const; 31 | } 32 | 33 | export default useLocalStorage; 34 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "kadec", 3 | "version": "0.1.0", 4 | "private": true, 5 | "scripts": { 6 | "dev": "next dev", 7 | "build": "next build", 8 | "start": "next start", 9 | "lint": "next lint", 10 | "prettier:check": "prettier --check .", 11 | "prettier:fix": "prettier --write ." 12 | }, 13 | "dependencies": { 14 | "@ant-design/icons": "^5.5.2", 15 | "@trivago/prettier-plugin-sort-imports": "^5.2.2", 16 | "antd": "^5.22.7", 17 | "dayjs": "^1.11.13", 18 | "dayjs-jalali": "^0.0.2", 19 | "jalali-moment": "^3.3.11", 20 | "jalali-react-datepicker": "^1.2.3", 21 | "next": "14.2.20", 22 | "prettier": "^3.4.2", 23 | "react": "^18", 24 | "react-dom": "^18", 25 | "recharts": "^2.15.0" 26 | }, 27 | "devDependencies": { 28 | "@types/node": "^20", 29 | "@types/react": "^18", 30 | "@types/react-dom": "^18", 31 | "eslint": "^8", 32 | "eslint-config-next": "14.2.20", 33 | "postcss": "^8", 34 | "tailwindcss": "^3.4.1", 35 | "typescript": "^5" 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /.prettierrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": ["@trivago/prettier-plugin-sort-imports"], 3 | "importOrder": [ 4 | "^(vite|@vitejs)(/(.*))?$", 5 | "^(react|react-dom)(/(.*))?$", 6 | "^react-router(/(.*))?$", 7 | "^react-error-boundary(/(.*))?$", 8 | "^(immer|use-immer)(/(.*))?$", 9 | "^@tanstack(/(.*))?$", 10 | "^@dnd-kit(/(.*))?$", 11 | "^react-toastify(/(.*))?$", 12 | "^(react-hook-form|@hookform/resolvers|zod)(/(.*))?$", 13 | "^clsx(/(.*))?$", 14 | "", 15 | "^@/api", 16 | "^@/components", 17 | "^@/context", 18 | "^@/data", 19 | "^@/dto", 20 | "^@/hooks", 21 | "^@/icons", 22 | "^@/layouts", 23 | "^@/modals", 24 | "^@/pages", 25 | "^@/providers", 26 | "^@/reducers", 27 | "^@/schemas", 28 | "^@/stores", 29 | "^@/types", 30 | "^@/utils", 31 | "^@/styles", 32 | "^(\\.|\\.\\.)/(.(?!.css))*$", 33 | "\\.css$" 34 | ], 35 | "importOrderSeparation": true, 36 | "importOrderSortSpecifiers": true, 37 | "importOrderGroupNamespaceSpecifiers": true 38 | } 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 Azadeh Sharifi Soltani 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # To-Do List App 2 | 3 | A modern and user-friendly To-Do List application built with **Next.js**, **TypeScript**, and **Ant Design**. This project allows users to manage their tasks effectively by adding, editing, deleting, and filtering tasks. 4 | 5 | --- 6 | 7 | ## 🌟 Features 8 | 9 | - ✅ **Add Tasks**: Quickly add new tasks with a simple form. 10 | - 📝 **Edit Tasks**: Modify existing tasks effortlessly. 11 | - ❌ **Delete Tasks**: Remove tasks with a single click. 12 | - 📋 **Mark as Completed**: Change the status of tasks by clicking the checkbox. 13 | - 🔍 **Filter Tasks**: View all tasks, completed tasks, or incomplete tasks. 14 | - 💾 **Local Storage Support**: Tasks persist even after refreshing the page. 15 | - 📱 **Responsive Design**: Fully optimized for desktop and mobile devices. 16 | 17 | --- 18 | 19 | ## 🚀 Demo 20 | 21 | Check out the live demo: 22 | 23 | [To-Do List App Live Demo](<(https://to-do-list-six-lilac.vercel.app/)>) 24 | 25 | --- 26 | 27 | ## 🛠️ Tech Stack 28 | 29 | - ⚡ **Framework**: [Next.js](https://nextjs.org/) 30 | - 🛡️ **Language**: TypeScript 31 | - 🎨 **UI Library**: [Ant Design](https://ant.design/) 32 | - 🌐 **State Management**: Context API 33 | - 🔧 **Icons**: [React Icons](https://react-icons.github.io/react-icons/) 34 | - ☁️ **Deployment**: [Vercel](https://vercel.com/) 35 | 36 | --- 37 | 38 | ## 📝 Installation 39 | 40 | To run this project locally, follow these steps: 41 | 42 | ### Clone the repository 43 | 44 | git clone https://github.com/frau-azadeh/to-do-list.git 45 | cd kadec 46 | 47 | ### Install dependencies 48 | 49 | npm install 50 | 51 | ### Run the development server 52 | 53 | npm run dev 54 | 55 | Visit [http://localhost:3000](http://localhost:3000) to see the app in action. 56 | 57 | --- 58 | 59 | ## 👨‍💻 Author 60 | 61 | - **Azadeh Sharifi** 62 | - [GitHub Profile](https://github.com/frau-azadeh) 63 | - [LinkedIn Profile](https://linkedin.com/in/azadeh-sharifi) 64 | -------------------------------------------------------------------------------- /src/components/TodoForm.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React from "react"; 4 | 5 | import { Button, Col, Form, Input, Row, Select } from "antd"; 6 | 7 | import { useTodos } from "@/context/TodoContext"; 8 | 9 | const { Option } = Select; 10 | 11 | const TodoForm: React.FC = () => { 12 | const [form] = Form.useForm(); 13 | const { dispatch } = useTodos(); 14 | 15 | const onFinish = (values: { 16 | task: string; 17 | priority: "low" | "medium" | "high"; 18 | }) => { 19 | dispatch({ 20 | type: "ADD_TODO", 21 | payload: { text: values.task, priority: values.priority }, 22 | }); 23 | form.resetFields(); 24 | }; 25 | 26 | return ( 27 |
33 | 34 | 35 | 39 | 40 | 41 | 42 | 43 | 44 | 50 | 55 | 56 | 57 | 58 | 59 | 60 | 68 | 69 | 70 | 71 |
72 | ); 73 | }; 74 | 75 | export default TodoForm; 76 | -------------------------------------------------------------------------------- /src/app/page.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { useState } from "react"; 4 | 5 | import { Layout } from "antd"; 6 | 7 | import FilterButtons from "@/components/FilterButtons"; 8 | import TaskProgress from "@/components/TaskProgress"; 9 | import TodoForm from "@/components/TodoForm"; 10 | import TodoList from "@/components/TodoList"; 11 | 12 | import { useTodos } from "../context/TodoContext"; 13 | 14 | const { Header, Content, Footer } = Layout; 15 | 16 | const Dashboard: React.FC = () => { 17 | const { state } = useTodos(); 18 | const [filter, setFilter] = useState<"all" | "completed" | "pending">("all"); 19 | 20 | const remainingTasks = state.todos.filter((todo) => !todo.completed).length; 21 | 22 | return ( 23 | 24 |
34 |

35 | مدیریت وظایف 36 |

37 |
38 | 47 |
57 | 58 | 59 | 64 | 65 |
66 |
67 |
74 | To-Do App © Created by Azadeh Sharifi Soltani 75 |
76 |
77 | ); 78 | }; 79 | 80 | export default Dashboard; 81 | -------------------------------------------------------------------------------- /src/components/FilterButtons.tsx: -------------------------------------------------------------------------------- 1 | import React from "react"; 2 | 3 | import { Button, Col, Row, Typography } from "antd"; 4 | 5 | interface FilterButtonsProps { 6 | setFilter: React.Dispatch< 7 | React.SetStateAction<"all" | "completed" | "pending"> 8 | >; 9 | filter: "all" | "completed" | "pending"; 10 | remainingTasks: number; 11 | } 12 | 13 | const FilterButtons: React.FC = ({ 14 | setFilter, 15 | filter, 16 | remainingTasks, 17 | }) => { 18 | const { Text } = Typography; 19 | 20 | return ( 21 |
22 | 26 | تعداد وظایف باقی‌مانده: {remainingTasks} 27 | 28 | 29 | 30 | 42 | 43 | 44 | 57 | 58 | 59 | 71 | 72 | 73 |
74 | ); 75 | }; 76 | 77 | export default FilterButtons; 78 | -------------------------------------------------------------------------------- /src/components/TodoItem.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import React, { useState } from "react"; 4 | 5 | import { DeleteOutlined, EditOutlined, SaveOutlined } from "@ant-design/icons"; 6 | import { Button, Checkbox, Col, Input, List, Row, Space } from "antd"; 7 | 8 | import { useTodos } from "@/context/TodoContext"; 9 | 10 | interface TodoItemProps { 11 | id: string; 12 | text: string; 13 | completed: boolean; 14 | } 15 | 16 | const TodoItem: React.FC = ({ id, text, completed }) => { 17 | const { dispatch } = useTodos(); 18 | const [isEditing, setIsEditing] = useState(false); 19 | const [editedText, setEditedText] = useState(text); 20 | 21 | const toggleTodo = () => { 22 | dispatch({ type: "TOGGLE_TODO", payload: { id } }); 23 | }; 24 | 25 | const deleteTodo = () => { 26 | dispatch({ type: "DELETE_TODO", payload: { id } }); 27 | }; 28 | 29 | const saveEditedTodo = () => { 30 | if (editedText.trim() === "") { 31 | alert("متن وظیفه نمی‌تواند خالی باشد."); 32 | return; 33 | } 34 | dispatch({ type: "EDIT_TODO", payload: { id, text: editedText } }); 35 | setIsEditing(false); 36 | }; 37 | 38 | return ( 39 | 40 | 52 | 58 | 63 | {isEditing ? ( 64 | setEditedText(e.target.value)} 67 | style={{ width: "100%" }} 68 | /> 69 | ) : ( 70 | 77 | {text} 78 | 79 | )} 80 | 81 | 82 | 83 | 84 | {isEditing ? ( 85 |