1.9 KiB
1.9 KiB
LLM Skill Marketplace
Go + Postgres marketplace where authenticated users can upload LLM skill files, sell them, and buyers can unlock and copy/download purchased skills.
Stack
- Backend: Go (
go run .) - Frontend: vanilla HTML/CSS/JS
- Database: Postgres
- Auth: Authentik forward auth (identity headers)
- Config: environment variables with
.envsupport
Run
- Copy
.env.exampleto.envand set values. - Start Postgres and create the target database.
- Install dependencies:
go mod tidy - Start server:
go run . - Open
http://localhost:8080.
Listener configuration
LISTEN_NETWORK:tcp(default) orunixLISTEN_ADDRESS:- for
tcp: address like:8080or127.0.0.1:8080 - for
unix: socket path like/tmp/skills2.sock
- for
UNIX_SOCKET_PERM: octal file mode for unix socket path (default0660)
Examples:
- TCP (default):
LISTEN_NETWORK=tcpLISTEN_ADDRESS=:8080
- Unix socket:
LISTEN_NETWORK=unixLISTEN_ADDRESS=/tmp/skills2.sockUNIX_SOCKET_PERM=0660
Local dev mode (no auth setup)
Set DEV_MODE=true in .env.
In this mode, protected routes always authenticate as:
sub:demo-user-001email:demo@example.comname:Demo User
Forward auth flow (production)
When DEV_MODE=false, deploy this app behind Authentik forward auth.
The proxy/auth layer must validate authentication and pass identity headers to the app.
The app reads:
X-Authentik-Uid(required; fallbackX-Forwarded-User)X-Authentik-EmailX-Authentik-Name(fallbackX-Forwarded-Preferred-Username)
Key routes
GET /dashboard: upload formGET /skills: browse listings and buyGET /my-skills: purchased skills and copy/download accessPOST /api/upload: upload and list a skillPOST /api/purchase: buy a skillGET /api/my-skills: owned purchased listGET /uploads/:id: download unlocked skill file