This commit is contained in:
Nicholas Keller
2026-06-09 23:48:27 -04:00
commit 6cf48a9a9e
12 changed files with 1256 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
# ✨ Spark Slop
A small, fast web app for capturing **project ideas** and growing them with
**timestamped notes** — like a comment thread for each idea.
Built with **Bun**, **TypeScript**, and **SQLite** (`bun:sqlite`). No external
runtime dependencies — the whole backend is the Bun standard library.
## Stack
- **Bun.serve** — HTTP server + static file serving
- **bun:sqlite** — embedded database (single `spark_slop.db` file, WAL mode)
- **Vanilla TS/JS frontend** — no build step, no framework
- A landing page (`/`) and the app (`/app`)
## Run it
```bash
bun run dev # auto-reload on file changes
# or
bun run start # plain run
```
Then open **http://localhost:3000**. Set `PORT` to change the port:
```bash
PORT=8080 bun run start
```
The SQLite database file (`spark_slop.db`) is created automatically on first run.
## Project layout
```
src/
db.ts # SQLite schema + typed query functions
server.ts # Bun.serve: JSON API + static files
public/
index.html # landing page
app.html # the app (idea list + notes)
app.js # frontend logic (API client, rendering)
styles.css # modern dark UI
```
## API
| Method | Path | Description |
| ------ | ------------------------- | -------------------------- |
| GET | `/api/ideas` | List ideas (with note counts) |
| POST | `/api/ideas` | Create an idea `{title, description}` |
| GET | `/api/ideas/:id` | Get one idea |
| PUT | `/api/ideas/:id` | Update an idea |
| DELETE | `/api/ideas/:id` | Delete an idea (cascades notes) |
| GET | `/api/ideas/:id/notes` | List notes for an idea |
| POST | `/api/ideas/:id/notes` | Add a note `{body}` |
| DELETE | `/api/notes/:id` | Delete a note |