Skip to content

Commit 01cb6bd

Browse files
committed
feat: docgen
1 parent b837f82 commit 01cb6bd

File tree

20 files changed

+2256
-14
lines changed

20 files changed

+2256
-14
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ noteleaf note add "My first note"
6161
6262
# Add a book to your reading list
6363
noteleaf media book add "The Name of the Wind"
64+
65+
# Generate docs
66+
noteleaf docgen --format docusaurus --out ./website/docs/manual
6467
```
6568

6669
## Status

ROADMAP.md

Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,120 @@ Features that demonstrate Go proficiency and broaden Noteleaf’s scope.
228228
- [ ] Encryption support
229229
- [ ] Advanced classification
230230

231+
### Local API Server
232+
233+
A local HTTP server daemon that exposes Noteleaf data for web UIs and extensions. Runs on the user's machine and provides programmatic access to tasks, notes, and media.
234+
235+
#### Architecture
236+
237+
- [ ] Daemon mode via `noteleaf server start/stop/status`
238+
- [ ] Binds to localhost by default (configurable port)
239+
- [ ] HTTP/REST API using existing repository layer
240+
- [ ] Shares same SQLite database as CLI
241+
- [ ] Middleware: logging, CORS (for localhost web UIs), compression
242+
- [ ] Health and status endpoints
243+
244+
#### Daemon Management
245+
246+
- [ ] Commands: `start`, `stop`, `restart`, `status`
247+
- [ ] PID file tracking for process management
248+
- [ ] Systemd service file for Linux
249+
- [ ] launchd plist for macOS
250+
- [ ] Graceful shutdown with active request draining
251+
- [ ] Auto-restart on crash option
252+
- [ ] Configurable bind address and port
253+
- [ ] Log file rotation
254+
255+
#### API Endpoints
256+
257+
RESTful design matching CLI command structure:
258+
259+
- [ ] `GET /api/v1/tasks` - List tasks with filters
260+
- [ ] `POST /api/v1/tasks` - Create task
261+
- [ ] `GET /api/v1/tasks/:id` - Get task details
262+
- [ ] `PUT /api/v1/tasks/:id` - Update task
263+
- [ ] `DELETE /api/v1/tasks/:id` - Delete task
264+
- [ ] `POST /api/v1/tasks/:id/start` - Start time tracking
265+
- [ ] `POST /api/v1/tasks/:id/stop` - Stop time tracking
266+
- [ ] `GET /api/v1/tasks/:id/time-entries` - Get time entries
267+
- [ ] Similar CRUD endpoints for notes, books, movies, TV shows, articles
268+
- [ ] `GET /api/v1/projects` - List all projects
269+
- [ ] `GET /api/v1/tags` - List all tags
270+
- [ ] `GET /api/v1/contexts` - List all contexts
271+
- [ ] `GET /api/v1/stats` - Dashboard statistics
272+
273+
#### Real-time Updates
274+
275+
- [ ] WebSocket endpoint for live data updates
276+
- [ ] Server-Sent Events (SSE) as fallback
277+
- [ ] Event types: task created/updated/deleted, note modified, etc.
278+
- [ ] Subscribe to specific domains or IDs
279+
- [ ] Change notification for web UI reactivity
280+
281+
#### Authentication & Security
282+
283+
- [ ] Optional API token authentication (disabled by default for localhost)
284+
- [ ] Token stored in config file
285+
- [ ] Token rotation command
286+
- [ ] CORS configuration for allowed origins
287+
- [ ] Localhost-only binding by default (security through network isolation)
288+
- [ ] Optional TLS for local network access
289+
290+
#### Extension System
291+
292+
- [ ] Webhook endpoints for extension registration
293+
- [ ] Event hooks for task/note lifecycle:
294+
- [ ] Before/after create, update, delete
295+
- [ ] Task completion, start, stop
296+
- [ ] Note archive/unarchive
297+
- [ ] Webhook delivery with retries
298+
- [ ] Extension manifest for discovery
299+
- [ ] JavaScript plugin API (embedded V8/goja runtime)
300+
- [ ] Plugin sandbox for security
301+
302+
#### Web UI
303+
304+
- [ ] Reference web UI implementation
305+
- [ ] Static file serving from embedded assets
306+
- [ ] Single-page application architecture
307+
- [ ] Responsive design (desktop, tablet, mobile)
308+
- [ ] Features:
309+
- [ ] Task board view (Kanban)
310+
- [ ] Calendar view for tasks
311+
- [ ] Note editor with Markdown preview
312+
- [ ] Media queue management
313+
- [ ] Search and filtering
314+
- [ ] Keyboard shortcuts matching CLI
315+
316+
#### Configuration
317+
318+
- [ ] Server config section in noteleaf.toml:
319+
- [ ] bind_address (default: 127.0.0.1)
320+
- [ ] port (default: 8080)
321+
- [ ] enable_auth (default: false)
322+
- [ ] api_token (optional)
323+
- [ ] enable_websocket (default: true)
324+
- [ ] log_level (default: info)
325+
- [ ] Environment variable overrides
326+
- [ ] CLI flag overrides for daemon commands
327+
328+
#### Monitoring & Diagnostics
329+
330+
- [ ] `GET /health` - Health check endpoint
331+
- [ ] `GET /metrics` - Prometheus-compatible metrics
332+
- [ ] Request logging (access log)
333+
- [ ] Error logging with stack traces
334+
- [ ] Performance metrics (request duration, DB query time)
335+
- [ ] Active connections and goroutine count
336+
- [ ] Memory and CPU usage stats
337+
338+
#### Client Libraries
339+
340+
- [ ] Go client library for extensions
341+
- [ ] JavaScript/TypeScript client for web UIs
342+
- [ ] OpenAPI/Swagger specification
343+
- [ ] Auto-generated API documentation
344+
231345
## Technical Infrastructure
232346

233347
### Completed

0 commit comments

Comments
 (0)