🎯 Major Achievement: Insertr is now a complete, production-ready CMS ## 🚀 Full-Stack Integration Complete - ✅ HTTP API Server: Complete REST API with SQLite database - ✅ Smart Client Integration: Environment-aware API client - ✅ Unified Development Workflow: Single command full-stack development - ✅ Professional Tooling: Enhanced build, status, and health checking ## 🔧 Development Experience - Primary: `just dev` - Full-stack development (demo + API server) - Alternative: `just demo-only` - Demo site only (special cases) - Build: `just build` - Complete stack (library + CLI + server) - Status: `just status` - Comprehensive project overview ## 📦 What's Included - **insertr-server/**: Complete HTTP API server with SQLite database - **Smart API Client**: Environment detection, helpful error messages - **Enhanced Build Pipeline**: Builds library + CLI + server in one command - **Integrated Tooling**: Status checking, health monitoring, clean workflows ## 🧹 Cleanup - Removed legacy insertr-old code (no longer needed) - Simplified workflow (full-stack by default) - Updated all documentation to reflect complete CMS ## 🎉 Result Insertr is now a complete, professional CMS with: - Real content persistence via database - Professional editing interface - Build-time content injection - Zero-configuration deployment - Production-ready architecture Ready for real-world use! 🚀
35 lines
1.1 KiB
Go
35 lines
1.1 KiB
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
)
|
|
|
|
// ContentItem represents a piece of content in the database
|
|
// This matches the structure used by the CLI client and JavaScript client
|
|
type ContentItem struct {
|
|
ID string `json:"id" db:"id"`
|
|
SiteID string `json:"site_id" db:"site_id"`
|
|
Value string `json:"value" db:"value"`
|
|
Type string `json:"type" db:"type"`
|
|
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at" db:"updated_at"`
|
|
}
|
|
|
|
// ContentResponse represents the API response structure for multiple items
|
|
type ContentResponse struct {
|
|
Content []ContentItem `json:"content"`
|
|
Error string `json:"error,omitempty"`
|
|
}
|
|
|
|
// CreateContentRequest represents the request structure for creating content
|
|
type CreateContentRequest struct {
|
|
ID string `json:"id" validate:"required"`
|
|
Value string `json:"value" validate:"required"`
|
|
Type string `json:"type" validate:"required,oneof=text markdown link"`
|
|
}
|
|
|
|
// UpdateContentRequest represents the request structure for updating content
|
|
type UpdateContentRequest struct {
|
|
Value string `json:"value" validate:"required"`
|
|
}
|