aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: a71a9fe339bc5cd235a6a300aad5328994ea35af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
![img_crud_logo](https://200l.xyz/img/vcs/crud/img_crud_logo.png)

A minimal task management API with user authentication, built with express and better-sqlite3.

![img_screenshot](https://200l.xyz/img/vcs/crud/img_screenshot.png)



~download

You can get a copy using git with the following command:

```bash
git clone https://git.200l.xyz/crud
```



~features

- Create, read, update, and delete tasks.
- User authentication with sessions.
- Per-user task isolation.
- Lightweight sqlite database, no external db server needed.



~dependencies

- node.js
- express
- better-sqlite3



~development

Install dependencies and start the server:

```bash
npm install
node server.js
```



~usage

Register a user, log in, and manage tasks via the rest api:

| Method   | Endpoint       | Description          | Body                              |
|----------|----------------|----------------------|-----------------------------------|
| `POST`   | `/tasks`       | Create a new task    | `{ "title": "...", "description": "..." }` |
| `GET`    | `/tasks`       | Get all tasks        | —                                 |
| `GET`    | `/tasks/:id`   | Get a single task    | —                                 |
| `PUT`    | `/tasks/:id`   | Update a task        | `{ "title": "...", "description": "...", "done": 0 }` |
| `DELETE` | `/tasks/:id`   | Delete a task        | —                                 |

~license

Trinity