File size: 1,652 Bytes
7a3968d
 
 
 
 
 
 
 
 
 
0747e6e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
---
title: Db
emoji: πŸš€
colorFrom: yellow
colorTo: yellow
sdk: docker
pinned: false
---

Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference

# NT DB β€” Neon Tech Database

A lightweight JSON-backed database with a REST API and visual dashboard.

---

## Run Locally

```bash
npm install
npm start
# Open: http://localhost:7860
```

## API

### Create a table
```bash
curl -X POST http://localhost:7860/rest/v1/schema/tables \
  -H "Content-Type: application/json" \
  -d '{
    "table": "posts",
    "columns": {
      "title": { "type": "string" },
      "body":  { "type": "string" }
    }
  }'
```

### Insert a row
```bash
curl -X POST http://localhost:7860/rest/v1/posts \
  -H "Content-Type: application/json" \
  -d '{"title": "Hello", "body": "My first post"}'
```

### Query rows
```bash
curl http://localhost:7860/rest/v1/posts
curl "http://localhost:7860/rest/v1/posts?title=eq.Hello"
curl "http://localhost:7860/rest/v1/posts?order=created_at.desc&limit=10"
```

### Update a row
```bash
curl -X PATCH "http://localhost:7860/rest/v1/posts?id=eq.<uuid>" \
  -H "Content-Type: application/json" \
  -d '{"title": "Updated title"}'
```

### Delete a row
```bash
curl -X DELETE "http://localhost:7860/rest/v1/posts?id=eq.<uuid>"
```

---

## Deploy to Hugging Face Spaces

1. Create a new Space β†’ choose **Docker** SDK
2. Upload all files (or push via git)
3. In Space settings β†’ **Persistent Storage** β†’ attach a disk mounted at `/data`
4. Your NT DB will be live at `https://your-username-nt-db.hf.space`

---

## Dashboard

Open the root URL in your browser for the visual table editor.