Commit0bacdfa1Recorded31 Mar 2026Repositorysigil-web-demo

Convert to standalone package

Message

Convert from-workspace deps to from-git pointing at standalone repos (sigil-web, sigil-sxml, sigil-css) or the sigil monorepo. Add configs, build task, dev-redirects, .gitignore, and README.

Changed
 .gitignore        |  1 +
 README.md         | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 dev-redirects.sgl | 15 +++++++++++++++
 package.sgl       | 38 ++++++++++++++++++++++++++++++--------
 run.sgl           |  2 +-
 5 files changed, 116 insertions(+), 9 deletions(-)
Diff
.gitignoreadded
@@ -0,0 +1 @@
+1
build/
README.mdadded
@@ -0,0 +1,69 @@
+1
# sigil-web-demo
+2
+3
Demo web application showcasing [sigil-web](https://codeberg.org/sigil/sigil-web) features. Implements "Vinyl Vault", a vinyl record collection CRUD app demonstrating routing, forms, data tables, pagination, flash messages, modals, SSE streaming, and server-driven UI.
+4
+5
## Features
+6
+7
- **CRUD operations** on a SQLite-backed vinyl record database
+8
- **Search and pagination** with server-driven partial updates
+9
- **Flash messages** for user feedback on create/update/delete
+10
- **Modal dialogs** for delete confirmation
+11
- **SSE streaming** for live stats updates on the home page
+12
- **Live-coding support** via nREPL and SSE reload
+13
- **CSS-in-Sigil** styles using [sigil-css](https://codeberg.org/sigil/sigil-css)
+14
+15
## Dependencies
+16
+17
- [sigil-stdlib](https://codeberg.org/sigil/sigil) (core library)
+18
- [sigil-http](https://codeberg.org/sigil/sigil) (HTTP server)
+19
- [sigil-web](https://codeberg.org/sigil/sigil-web) (web framework, routing, middleware, UI components)
+20
- [sigil-nrepl](https://codeberg.org/sigil/sigil) (network REPL for live-coding)
+21
- [sigil-sqlite](https://codeberg.org/sigil/sigil) (SQLite bindings)
+22
- [sigil-sxml](https://codeberg.org/sigil/sigil-sxml) (SXML processing for HTML generation)
+23
- [sigil-css](https://codeberg.org/sigil/sigil-css) (CSS-in-Sigil DSL)
+24
+25
## Usage
+26
+27
Add as a dependency in your `package.sgl`:
+28
+29
```scheme
+30
(from-git url: "codeberg:sigil/sigil-web-demo")
+31
```
+32
+33
Or clone and run directly:
+34
+35
```bash
+36
sigil build --redirects dev-redirects.sgl
+37
sigil run run.sgl
+38
```
+39
+40
The app starts a web server (default port 3000) and opens Vinyl Vault in your browser.
+41
+42
## Modules
+43
+44
### `(sigil web demo)`
+45
+46
Main entry point. Call `(start-demo)` to launch the web server with all routes configured.
+47
+48
### `(sigil web demo db)`
+49
+50
SQLite database layer with schema initialization, seed data, and CRUD operations:
+51
+52
- `init-db` - Create table and seed sample records
+53
- `list-records` - Paginated listing with optional search
+54
- `count-records` - Count with optional search filter
+55
- `get-record` / `create-record` / `update-record` / `delete-record`
+56
+57
### `(sigil web demo views)`
+58
+59
SXML view functions for all pages and partials:
+60
+61
- `page-layout` - Full HTML page shell with navigation
+62
- `home-page` - Welcome page with collection stats
+63
- `records-list-page` - Searchable, paginated record table
+64
- `record-detail-page` - Single record view with edit/delete actions
+65
- `record-form-page` - New/edit form with validation
+66
+67
## License
+68
+69
BSD-3-Clause
dev-redirects.sgladded
@@ -0,0 +1,15 @@
+1
;; Development redirects — point dependencies at local checkouts
+2
(redirects
+3
repos: (list
+4
(for-repo
+5
url: "codeberg:sigil/sigil"
+6
use: (from-path dir: "../sigil"))
+7
(for-repo
+8
url: "codeberg:sigil/sigil-web"
+9
use: (from-path dir: "../sigil-web"))
+10
(for-repo
+11
url: "codeberg:sigil/sigil-sxml"
+12
use: (from-path dir: "../sigil-sxml"))
+13
(for-repo
+14
url: "codeberg:sigil/sigil-css"
+15
use: (from-path dir: "../sigil-css"))))
package.sglmodified
@@ -4,19 +4,41 @@
4
;;; routing, forms, data tables, pagination, flash messages, modals,
5
;;; SSE streaming, and server-driven UI.
6
+7
(define sigil-repo "codeberg:sigil/sigil#v0.8.0")
+8
9
(package
10
name: "sigil-web-demo"
11
version: "0.7.0"
12
description: "Demo web application for sigil-web"
11
url: "https://codeberg.org/sigil/sigil"
+13
url: "https://codeberg.org/sigil/sigil-web-demo"
14
license: "BSD-3-Clause"
15
authors: (list "David Wilson <[email protected]>")
16
+17
configs: (list
+18
(config
+19
name: 'dev
+20
output-dir: "build/dev"
+21
debug?: #t
+22
optimize: 0)
+23
(config
+24
name: 'release
+25
output-dir: "build/release"
+26
debug?: #f
+27
optimize: 2))
+28
29
dependencies: (list
16
(from-workspace name: "sigil-stdlib")
17
(from-workspace name: "sigil-http")
18
(from-workspace name: "sigil-web")
19
(from-workspace name: "sigil-nrepl")
20
(from-workspace name: "sigil-sqlite")
21
(from-workspace name: "sigil-sxml")
22
(from-git url: "codeberg:sigil/sigil-css#v0.8.0" package: "sigil-css")))
+30
(from-git url: sigil-repo package: "sigil-stdlib")
+31
(from-git url: sigil-repo package: "sigil-http")
+32
(from-git url: "codeberg:sigil/sigil-web")
+33
(from-git url: sigil-repo package: "sigil-nrepl")
+34
(from-git url: sigil-repo package: "sigil-sqlite")
+35
(from-git url: "codeberg:sigil/sigil-sxml")
+36
(from-git url: "codeberg:sigil/sigil-css#v0.8.0"))
+37
+38
tasks: (list
+39
(task
+40
name: 'build
+41
description: "Compile sigil-web-demo modules"
+42
steps: (list
+43
(compile-sigil-modules sources: "src/**/*.sgl"
+44
output-dir: (config-output-subdir "lib"))))))
run.sglmodified
@@ -1,4 +1,4 @@
1
;; Vinyl Vault - sigil-web demo application
2
;; Usage: ./build/dev/bin/sigil run packages/sigil-web-demo/run.sgl
+2
;; Usage: sigil run run.sgl
3
(import (sigil web demo))
4
(start-demo)