Replace Cobra CLI + raw net/http with core/go-api Engine. DemoProvider implements RouteGroup for plug-and-play registration. Lit element updated to fetch from Go API. Add .core/build.yaml and CLAUDE.md. Co-Authored-By: Virgil <virgil@lethean.io>
1.1 KiB
1.1 KiB
CLAUDE.md
This file provides guidance to Claude Code when working with this repository.
Project Overview
Starter template for building custom HTML elements backed by a Go API using the Core ecosystem. Clone this to create a new service provider that can plug into core/ide.
Build & Development
# Build UI (Lit custom element)
cd ui && npm install && npm run build
# Run development server
go run . --port 8080
# Build binary
core build
# Quality assurance
core go qa
Architecture
main.go— Createsapi.Engine, registers providers, serves embedded UIprovider.go— ExampleDemoProviderimplementingapi.RouteGroupstatic.go— Static file serving helperui/— Lit custom element that talks to the Go API via fetch
Creating Your Own Provider
- Rename
DemoProviderinprovider.go - Update
Name(),BasePath(), and routes inRegisterRoutes() - Update the Lit element in
ui/src/index.tsto match your API - Update the custom element tag in
ui/index.html
Conventions
- UK English in all user-facing strings
- EUPL-1.2 licence
- Conventional commits