- TypeScript 38.2%
- Go 38.1%
- Vue 19.9%
- Nix 3.4%
- HTML 0.4%
|
|
||
|---|---|---|
| .forgejo/workflows | ||
| doc | ||
| internal | ||
| src | ||
| .gitignore | ||
| flake.lock | ||
| flake.nix | ||
| go.mod | ||
| go.sum | ||
| index.html | ||
| main.go | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
| vite.config.ts | ||
Daemono
A web frontend for pi-like agents. It has sparkles. And unicorns.
API
See doc/api.md for the backend API design.
Prerequisites
- Node.js (v18 or later recommended)
- npm (comes with Node.js)
Setup
npm install
Development
Start both the Go backend and the Vite dev server. Vite proxies /api
requests to the backend so you get hot-reload for the frontend and live
API responses:
# Terminal 1 — Go backend
go run main.go # listens on :8081
# Terminal 2 — Vite dev server (proxies /api → :8081)
npm run dev # listens on :5173
Production Build
Compile into a static bundle ready for a web server:
npm run build
This runs TypeScript type-checking (vue-tsc) followed by vite build. The output lands in the dist/ directory:
dist/
├── index.html
├── assets/
│ ├── index-<hash>.js
│ └── index-<hash>.css
Serving the Bundle
Point any static web server at the dist/ directory.
Quick local test
npm run preview # Vite's built-in preview server
Python
python3 -m http.server 8081 -d dist
nginx
server {
listen 80;
server_name example.com;
root /path/to/daemono/dist;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
}
Caddy
example.com {
root * /path/to/daemono/dist
file_server
}
Apache
<VirtualHost *:80>
ServerName example.com
DocumentRoot /path/to/daemono/dist
<Directory /path/to/daemono/dist>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.html [L]
</Directory>
</VirtualHost>
The try_files / rewrite rules above ensure client-side routing works by falling back to index.html for any unmatched paths.
Nix Build
A flake.nix is provided that packages the bundle as a Nix derivation.
First build — lock the dependency hash
The placeholder hash in flake.nix needs to be replaced with the real one:
nix build 2>&1 | grep 'got:' | awk '{print $2}'
Take the sha256-... value that Nix reports and replace npmDepsHash in flake.nix with it. Then nix build will succeed.
Subsequent builds
nix build # outputs ./result -> /nix/store/...-daemono-0.1.0/
ls result/ # index.html assets/
The bundle is the derivation output — ready to be served by any web server.
Development shell
nix develop # drops into a shell with Node.js 22
npm run dev
CI (Forgejo Actions)
The workflow at .forgejo/workflows/bundle.yaml runs on every push and pull request to main:
- Checks out the repository
- Installs Nix via
cachix/install-nix-action - Runs
nix build - Uploads the
result/directory as a job artifact (daemono-bundle)