Skip to content

Implement HTMX-based web application for collectables inventory management#1

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/implement-basic-go-web-app
Draft

Implement HTMX-based web application for collectables inventory management#1
Copilot wants to merge 3 commits into
mainfrom
copilot/implement-basic-go-web-app

Conversation

Copilot AI commented May 31, 2026

Copy link
Copy Markdown

Builds out the full web application for invdex — a stateless collectables inventory system with LLM-assisted cataloging, backed by PostgreSQL and configurable object storage.

Architecture

  • internal/config/ — Env-based configuration (DB, storage backend, LLM endpoint)
  • internal/database/ — PostgreSQL with auto-migrations, CRUD for items/tags, search with proper LIKE escaping
  • internal/storage/ — Abstraction over S3-compatible and GCS backends (via S3 interop), presigned URLs for serving
  • internal/llm/ — OpenAI-compatible chat completions client; generates item suggestions and powers conversational assistant
  • internal/handlers/ — HTTP handlers with embedded HTML templates, HTMX for partial page updates

UI

  • Item grid with tag-based filtering sidebar and live search (keyup debounced via HTMX)
  • Add/edit forms with image upload (multipart → object storage) and "✨ Suggest" button for LLM-generated metadata
  • Per-item AI chat panel for identification, valuation, and categorization assistance
  • Tag management CRUD

Key decisions

  • Standard library net/http with Go 1.22+ method routing — no external router dependency
  • Templates embedded via //go:embed for single-binary deployment
  • Storage key generated server-side (UUID-based path), HTML-escaped before rendering to prevent XSS
  • HTMX loaded with SRI integrity attribute
  • chatWithLLM delegates to the same OpenAI-compatible endpoint used for suggestions, providing agent-like conversational ability without additional infrastructure
// Storage is configurable via STORAGE_BACKEND env var
store, err := storage.New(ctx, cfg) // returns S3Storage or GCSStorage

Copilot AI added 3 commits May 31, 2026 22:31
- Add configuration management (env-based: DB, storage, LLM settings)
- Add PostgreSQL database layer with migrations and CRUD operations
- Add file storage abstraction supporting S3-compatible and GCS backends
- Add LLM integration (OpenAI-compatible API) for item suggestions and chat
- Add HTTP handlers with embedded HTMX templates
- Build complete UI: item list, create, view, edit, delete, search, tags
- Add AI assistant chat and suggestion features
- Add health check endpoint
- Implement graceful shutdown
- Update Dockerfile, README, and dependencies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants