remove preact and create setup wizard

This commit is contained in:
2026-06-01 10:10:36 -04:00
parent b3364447a1
commit ebe0920f89
53 changed files with 818 additions and 4226 deletions

View File

@@ -10,7 +10,7 @@ This repository now contains the Milestone 1 foundation scaffold:
- SQLite/libsql-oriented data layer with startup migrations
- Markdown rendering pipeline with wiki-link rewriting, tag extraction, and SSR templates
- Content-addressed attachment storage with secure serving
- Preact + Vite frontend scaffold for later hydration-focused UI work
- Go-served HTML templates with embedded CSS and browser scripts
- Docker, Compose, CI, OpenAPI, and local development targets
## Quick Start
@@ -30,39 +30,41 @@ mise install
### Development Mode (with live reload)
Run both the Go server and Vite dev server with live reload:
Run the Go server with live reload:
```bash
mise run dev
```
This starts:
- Go server with `air` live reload on http://localhost:8080
- Vite dev server with HMR on http://localhost:5173
- The Go server proxies `/app/*` requests to Vite, so access the app at http://localhost:8080/app/
You can also run them separately in two terminals:
```bash
# Terminal 1 - Go server with live reload
mise run dev-server
# Terminal 2 - Vite dev server
mise run dev-web
```
This starts the Go server with `air` live reload on `http://localhost:8080`.
### Production Mode
Build the web app and run the Go server without Vite proxy:
Run the Go server:
```bash
mise run web-install
mise run web-build
mise run server-run
```
The server listens on `http://localhost:8080` by default.
### Fresh Server Deployment
The Compose deployment keeps its database and attachment store in `./data` and
its editable Markdown source in `./content`.
```bash
cp .env.example .env
# Edit CAIRNQUIRE_PUBLIC_ORIGIN in .env to match your HTTPS URL.
docker compose up -d --build
curl http://127.0.0.1:8080/health
```
Open `${CAIRNQUIRE_PUBLIC_ORIGIN}/setup` in a browser. The first-run wizard
creates the admin account and asks whether visitors may create accounts. The
setup endpoint closes after the first admin is created. An admin can change the
signup setting later from the account page.
### Common commands
```bash
@@ -82,18 +84,20 @@ Configuration can come from:
Supported variables:
- `CAIRNQUIRE_SERVER_ADDR`
- `CAIRNQUIRE_DATABASE_PATH`
- `CAIRNQUIRE_DATABASE_PRIMARY_URL`
- `CAIRNQUIRE_DATABASE_AUTH_TOKEN`
- `CAIRNQUIRE_CONTENT_SOURCE_DIR`
- `CAIRNQUIRE_CONTENT_STORE_DIR`
- `CAIRNQUIRE_WEB_DIST_DIR`
- `CAIRNQUIRE_DEV_VITE_URL` - Set to proxy `/app/*` to Vite dev server (e.g. `http://localhost:5173`)
- `CAIRNQUIRE_LOG_LEVEL`
- `CAIRNQUIRE_PUBLIC_ORIGIN` - Required for deployment. Exact public HTTPS origin used for passkeys and device-flow URLs, for example `https://cairnquire.example.com`.
- `CAIRNQUIRE_SERVER_ADDR` - Listen address. Defaults to `:8080`.
- `CAIRNQUIRE_DATABASE_PATH` - Local SQLite/libsql path. Defaults to `../../data/db.sqlite` when running from `apps/server`.
- `CAIRNQUIRE_DATABASE_PRIMARY_URL` - Optional remote libsql primary URL for an embedded replica.
- `CAIRNQUIRE_DATABASE_AUTH_TOKEN` - Optional auth token for the remote libsql primary.
- `CAIRNQUIRE_CONTENT_SOURCE_DIR` - Editable Markdown source directory.
- `CAIRNQUIRE_CONTENT_STORE_DIR` - Content-addressed attachment store.
- `CAIRNQUIRE_EMAIL_SMTP_HOST` - SMTP host. Set to an empty string in JSON config to disable delivery.
- `CAIRNQUIRE_EMAIL_SMTP_PORT` - SMTP port. Defaults to `1025`.
- `CAIRNQUIRE_EMAIL_FROM` - Notification sender address.
- `CAIRNQUIRE_LOG_LEVEL` - Defaults to `INFO`.
- `CAIRNQUIRE_DEV_MODE` - Optional local-only auth shortcut. Do not enable on a deployed server.
## Noted Gaps
- The docs describe both a single-binary system and a separate Vite/Preact app. This implementation keeps the Go server as the primary runtime and treats the web app as compiled static assets.
- The docs call for `golang-migrate`, but the current foundation uses an internal migration runner while `go-libsql` integration details are validated.
- The sync docs describe JSON messages while the Milestone 1 layout mentions a protobuf package; both are preserved in `packages/protocol/` pending a later protocol lock.