Db / README.md
Neon-AI's picture
Update README.md
0747e6e verified
---
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.