Skip to content

Commit 95d0bf4

Browse files
committed
chore: Add README file
1 parent df84ba2 commit 95d0bf4

File tree

2 files changed

+206
-1
lines changed

2 files changed

+206
-1
lines changed

README.md

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
# 🚀 TypeScript Task Manager CLI
2+
3+
A fully-featured command-line task management tool built with TypeScript. This is my TypeScript learning project showcasing modern TypeScript development best practices.
4+
5+
![TypeScript](https://img.shields.io/badge/typescript-%23007ACC.svg?style=for-the-badge&logo=typescript&logoColor=white)
6+
![Node.js](https://img.shields.io/badge/node.js-6DA55F?style=for-the-badge&logo=node.js&logoColor=white)
7+
![CLI](https://img.shields.io/badge/CLI-4D4D4D?style=for-the-badge&logo=windows-terminal&logoColor=white)
8+
9+
## ✨ Features
10+
11+
- 📝 **Task Management**: Create, edit, and delete tasks
12+
- 🏷️ **Status Tracking**: Todo, In Progress, Completed
13+
-**Due Dates**: Set and track task deadlines
14+
- 🎨 **Interactive CLI**: Beautiful command-line interface
15+
- 📊 **Statistics**: Task completion rates and overdue alerts
16+
- 💾 **Data Persistence**: JSON file storage
17+
18+
## 🛠️ Tech Stack
19+
20+
- **Language**: `TypeScript 5.2+`
21+
- **Runtime**: `Node.js 16+`
22+
- **CLI Framework**: `Commander.js`
23+
- **Interactive Interface**: `Inquirer.js`
24+
- **Styling**: `Chalk` (terminal colors)
25+
- **Tools**: `ts-node`, `nodemon`
26+
27+
## 🚀 Quick Start
28+
29+
### Install Dependencies
30+
31+
```bash
32+
npm install
33+
```
34+
35+
### Build Project
36+
37+
```bash
38+
npm run build
39+
```
40+
41+
### Run Application
42+
43+
```bash
44+
# Show help
45+
npm start -- --help
46+
47+
# Add a task
48+
npm start -- add -t "My first task" -d "This is a task description"
49+
50+
# List all tasks
51+
npm start -- list
52+
53+
# Enter interactive mode
54+
npm start -- interactive
55+
56+
# Show statistics
57+
npm start -- stats
58+
```
59+
60+
### Global Installation (Optional)
61+
62+
```bash
63+
npm run link
64+
task-manager --help
65+
```
66+
67+
## 📖 Usage Guide
68+
69+
### Basic Commands
70+
71+
| Command | Description | Example |
72+
| ------------- | ---------------- | --------------------------- |
73+
| `add` | Add a new task | `add -t "Learn TypeScript"` |
74+
| `list` | List tasks | `list --status todo` |
75+
| `update` | Update a task | `update <id> -s completed` |
76+
| `delete` | Delete a task | `delete <id>` |
77+
| `stats` | Show statistics | `stats` |
78+
| `interactive` | Interactive mode | `interactive` |
79+
80+
### Task Status
81+
82+
- `todo` - To Do ⏳
83+
- `in_progress` - In Progress 🔄
84+
- `completed` - Completed ✅
85+
86+
### Example Operations
87+
88+
```bash
89+
# Add task with due date
90+
npm start -- add -t "Complete project report" --due-date "2024-12-31"
91+
92+
# Filter tasks by status
93+
npm start -- list -s completed
94+
95+
# Update task status
96+
npm start -- update task_xyz123 -s in_progress
97+
98+
# Interactive task update
99+
npm start -- update task_xyz123
100+
```
101+
102+
## 🏗️ Project Structure
103+
104+
```
105+
src/
106+
├── index.ts # Application entry point
107+
├── types/
108+
│ └── Task.ts # Type definitions
109+
├── services/
110+
│ └── TaskService.ts # Core business logic
111+
├── utils/
112+
│ └── fileUtils.ts # File operation utilities
113+
└── cli/
114+
└── commands.ts # CLI command handlers
115+
116+
data/
117+
└── tasks.json # Task data file
118+
119+
dist/ # Compiled JavaScript files
120+
```
121+
122+
## 🎓 TypeScript Features Demonstrated
123+
124+
This project showcases the following TypeScript core concepts:
125+
126+
### Type System
127+
```typescript
128+
// Interface definition
129+
interface Task {
130+
id: string;
131+
title: string;
132+
status: TaskStatus;
133+
dueDate?: Date;
134+
}
135+
136+
// Enums
137+
enum TaskStatus {
138+
TODO = 'todo',
139+
IN_PROGRESS = 'in_progress',
140+
COMPLETED = 'completed'
141+
}
142+
```
143+
144+
### Generics
145+
```typescript
146+
interface ApiResponse<T> {
147+
success: boolean;
148+
data?: T;
149+
}
150+
```
151+
152+
### Classes and Access Modifiers
153+
```typescript
154+
class TaskService {
155+
private tasks: Task[] = [];
156+
157+
async createTask(input: CreateTaskInput): Promise<ApiResponse<Task>> {
158+
// Implementation logic
159+
}
160+
}
161+
```
162+
163+
### Advanced Features
164+
- **Optional chaining**: `task.description?.trim()`
165+
- **Nullish coalescing**: `title ?? currentTask.title`
166+
- **Spread operator**: `{...currentTask, ...updateData}`
167+
- **Type guards**: `status is TaskStatus`
168+
- **Async/await**: Modern asynchronous programming
169+
170+
## 🧪 Development Scripts
171+
172+
```bash
173+
npm run build # Compile TypeScript
174+
npm run dev # Development mode
175+
npm run watch # Watch mode
176+
npm run clean # Clean compiled files
177+
npm run rebuild # Clean and rebuild
178+
```

data/tasks.json

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,28 @@
1-
[]
1+
[
2+
{
3+
"id": "task_mfw8nemv_ljp",
4+
"title": "Learn TypeScript",
5+
"description": "Finish the task management tool project",
6+
"status": "in_progress",
7+
"createdAt": "2025-09-23T07:33:11.767Z",
8+
"updatedAt": "2025-09-24T09:05:16.701Z"
9+
},
10+
{
11+
"id": "task_mfw8pvv1_kgn",
12+
"title": "Read TypeScript document",
13+
"description": "Take a deep dive into advanced features",
14+
"status": "todo",
15+
"createdAt": "2025-09-23T07:35:07.405Z",
16+
"updatedAt": "2025-09-23T07:35:07.405Z",
17+
"dueDate": "2024-09-30T00:00:00.000Z"
18+
},
19+
{
20+
"id": "task_mfxrc8nw_ivc",
21+
"title": "Read TypeScript Documents",
22+
"description": "Take a deep dive into advanced features",
23+
"status": "todo",
24+
"createdAt": "2025-09-24T09:04:09.692Z",
25+
"updatedAt": "2025-09-24T09:04:09.692Z",
26+
"dueDate": "2025-09-30T00:00:00.000Z"
27+
}
28+
]

0 commit comments

Comments
 (0)