Skip to content

Commit 367cb92

Browse files
committed
update README to reflect new endpoints
1 parent ce89fa5 commit 367cb92

1 file changed

Lines changed: 36 additions & 72 deletions

File tree

README.md

Lines changed: 36 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,114 +1,83 @@
11
# Task Manager API
22

3-
A RESTful API for managing tasks built with Spring Boot. Uses an H2 in-memory database to keep things simple while the core functionality is being developed.
3+
A RESTful API for managing tasks built with Java 21 and Spring Boot.
44

55
---
66

77
## Tech Stack
88

9-
| Layer | Technology |
10-
|-------------|------------------------|
11-
| Language | Java 21 |
12-
| Framework | Spring Boot 4.1.0-M2 |
13-
| Persistence | In-memory HashMap |
14-
| Validation | Spring Boot Validation |
15-
| Build Tool | Maven |
16-
| CI/CD | GitHub Actions |
9+
| Layer | Technology |
10+
|---|---|
11+
| Language | Java 21 |
12+
| Framework | Spring Boot 4.1.0-M2 |
13+
| Persistence | In-memory HashMap |
14+
| Validation | Spring Boot Validation |
15+
| Build Tool | Maven |
16+
| CI/CD | GitHub Actions |
17+
18+
---
1719

1820
## Getting Started
1921

20-
**Prerequisites:** Java 21+ (the Maven wrapper is included, no local Maven install needed)
22+
**Prerequisites:** Java 21+ (Maven wrapper included)
2123

2224
```bash
2325
git clone https://github.com/ColtonRandall/task-manager-api.git
2426
cd task-manager-api
2527
./mvnw spring-boot:run
2628
```
2729

28-
The API will start on `http://localhost:8080`. To build a JAR instead:
30+
The API starts on `http://localhost:8080`. To build a JAR:
2931

3032
```bash
3133
./mvnw -B package
3234
java -jar target/task-manager-api-0.0.1-SNAPSHOT.jar
3335
```
3436

35-
## Manual Testing
36-
37-
The following `curl` commands can be used to verify the controller works. Start the app first with `./mvnw spring-boot:run`.
37+
---
3838

39-
> **Note:** The task store HashMap is in-memory and does not persist between restarts.
39+
## Endpoints
4040

41-
---
41+
| Method | Path | Description |
42+
|---|---|-------------------------|
43+
| POST | /tasks | Create a task |
44+
| GET | /tasks | Fetch all tasks |
45+
| GET | /tasks/{id} | Fetch a task by ID |
46+
| GET | /tasks/search/{name} | Fetch a task by name |
47+
| PATCH | /tasks/{id}/complete | Mark a task as complete |
48+
| DELETE | /tasks/{id} | Soft delete a task |
49+
| PATCH | /tasks/{id} | Undo a delete |
4250

43-
### POST /tasks — Create a task
51+
### Examples
4452

53+
**Create a task**
4554
```bash
4655
curl -s -X POST http://localhost:8080/tasks \
4756
-H "Content-Type: application/json" \
4857
-d '{"name":"Buy groceries","description":"Milk, eggs, bread"}'
4958
```
5059

51-
**Expected:** `200 OK` with the new task body including a generated `id` and `createdAt` timestamp.
52-
53-
```json
54-
{
55-
"id": "e3b0c442-...",
56-
"name": "Buy groceries",
57-
"description": "Milk, eggs, bread",
58-
"createdAt": "2026-03-04T10:00:00",
59-
"status": "CREATED"
60-
}
61-
```
62-
63-
---
64-
65-
### GET /tasks — Fetch all tasks
66-
60+
**Get all tasks**
6761
```bash
6862
curl -s http://localhost:8080/tasks
6963
```
7064

71-
**Expected:** `200 OK` with an array of all tasks.
72-
73-
---
74-
75-
### GET /tasks/{id} — Fetch a task by ID
76-
65+
**Complete a task**
7766
```bash
78-
curl -s http://localhost:8080/tasks/{id}
79-
```
80-
81-
**Expected:** `200 OK` with the matching task, or `404` if not found.
82-
83-
---
84-
85-
### GET /tasks/search/{name} — Fetch a task by name
86-
87-
```bash
88-
curl -s http://localhost:8080/tasks/search/{name}
67+
curl -s -X PATCH http://localhost:8080/tasks/{id}/complete
8968
```
9069

91-
**Expected:** `200 OK` with the matching task, or `404` if not found.
92-
93-
---
94-
95-
### PATCH /tasks/{id}/complete — Mark a task as completed
96-
70+
**Delete a task (Soft delete)**
9771
```bash
98-
curl -s -X PATCH http://localhost:8080/tasks/{id}/complete
72+
curl -s -X DELETE http://localhost:8080/tasks/{id}
9973
```
10074

101-
**Expected:** `200 OK` with the updated task body (status changed to "DONE"), or `404` if not found.
102-
103-
---
104-
105-
### DELETE /tasks/{id} — Delete a task
106-
75+
**Undo a deleted task**
10776
```bash
108-
curl -s -X DELETE http://localhost:8080/tasks/{id}
77+
curl -s -X PATCH http://localhost:8080/tasks/{id}
10978
```
11079

111-
**Expected:** `200 OK` with the task body (status changed to "DELETED" for soft delete), or `404` if not found.
80+
> Note: The task store is in-memory and does not persist between restarts.
11281
11382
---
11483

@@ -118,12 +87,7 @@ curl -s -X DELETE http://localhost:8080/tasks/{id}
11887
./mvnw test
11988
```
12089

121-
## CI/CD
122-
123-
GitHub Actions runs a build and test on every push and pull request to `main`, and submits the dependency graph to GitHub for Dependabot alerts.
124-
125-
See [`.github/workflows/maven.yml`](.github/workflows/maven.yml).
126-
90+
---
12791

12892
## Project Structure
12993

@@ -147,4 +111,4 @@ src/
147111
└── java/com/taskmanagerapi/
148112
├── TaskManagerApiApplicationTests.java
149113
└── TaskServiceTests.java
150-
```
114+
```

0 commit comments

Comments
 (0)