docs: update all documentation for unified binary architecture

📚 **Complete Documentation Overhaul**

**Updated Files:**
 **README.md** - Updated commands, configuration, and workflow
 **COMMANDS.md** - New comprehensive command reference
 **INTEGRATION-SUMMARY.md** - Updated architecture overview
 **insertr-server/README.md** - Redirect to unified binary docs

**Key Documentation Changes:**

🔧 **Unified Binary Commands:**
- Updated all examples to use `./insertr enhance` and `./insertr serve`
- Removed references to separate CLI/server binaries
- Added comprehensive configuration documentation

⚙️ **Configuration Section:**
- Added YAML configuration examples (`insertr.yaml`)
- Documented environment variables (`INSERTR_*`)
- Explained configuration precedence (CLI → env → YAML → defaults)

📖 **Command Reference (COMMANDS.md):**
- Complete reference for all commands and flags
- Usage patterns for development and production
- API endpoint documentation
- Error handling and debugging guides
- CI/CD integration examples

🏗️ **Architecture Updates:**
- Updated development workflow instructions
- Fixed CLI → Binary terminology
- Updated hot reload and build process documentation

**Migration Notes:**
- All functionality preserved in unified binary
- Simplified development workflow with `just dev`
- Single executable for all operations
This commit is contained in:
2025-09-10 18:12:31 +02:00
parent e28000fd33
commit ae9ae7e442
4 changed files with 593 additions and 117 deletions

View File

@@ -1,8 +1,23 @@
# Insertr Content Server
# ⚠️ Deprecated: Insertr Content Server
REST API server for the Insertr CMS system. Provides content management with version control and user attribution.
> **This standalone server has been replaced by the unified `insertr` binary.**
> **Please see the [main README](../README.md) for updated instructions.**
## Features
## 🔄 Migration to Unified Binary
The Insertr Content Server functionality has been integrated into the unified `insertr` binary. Instead of running a separate server binary, use:
```bash
# Old approach (deprecated)
./insertr-server --port 8080
# New unified approach
./insertr serve --port 8080 --dev-mode
```
## ✅ All Features Preserved
The unified binary includes all server functionality:
- **Content Management**: Full CRUD operations for content items
- **Version Control**: Complete edit history with rollback functionality
@@ -10,9 +25,9 @@ REST API server for the Insertr CMS system. Provides content management with ver
- **Type-Safe Database**: Uses sqlc for generated Go code from SQL
- **SQLite & PostgreSQL**: Database flexibility for development to production
## API Endpoints
## 🚀 Updated API Endpoints
### Content Operations
### Content Operations (Unchanged)
- `GET /api/content?site_id={site}` - Get all content for a site
- `GET /api/content/{id}?site_id={site}` - Get single content item
- `GET /api/content/bulk?site_id={site}&ids[]={id1}&ids[]={id2}` - Get multiple content items
@@ -20,16 +35,32 @@ REST API server for the Insertr CMS system. Provides content management with ver
- `PUT /api/content/{id}?site_id={site}` - Update existing content
- `DELETE /api/content/{id}?site_id={site}` - Delete content
### Version Control
### Version Control (Unchanged)
- `GET /api/content/{id}/versions?site_id={site}` - Get version history
- `POST /api/content/{id}/rollback?site_id={site}` - Rollback to specific version
### Health & Status
### Health & Status (Unchanged)
- `GET /health` - Server health check
## User Attribution
## 🚀 New Quick Start (Unified Binary)
All content operations support user attribution via the `X-User-ID` header:
```bash
# Build unified binary (from project root)
go build -o insertr .
# Start server with development mode
./insertr serve --dev-mode --port 8080
# Start production server
./insertr serve --port 8080 --db "postgresql://user:pass@host/db"
# Check health (same endpoint)
curl http://localhost:8080/health
```
## User Attribution (Unchanged)
All content operations still support user attribution via the `X-User-ID` header:
```bash
curl -X PUT "http://localhost:8080/api/content/hero-title?site_id=demo" \
@@ -38,39 +69,30 @@ curl -X PUT "http://localhost:8080/api/content/hero-title?site_id=demo" \
-d '{"value": "Updated content"}'
```
## Quick Start
## 🛠️ Development (Updated for Unified Binary)
```bash
# Build server
go build -o insertr-server ./cmd/server
# Start server
./insertr-server --port 8080
# Check health
curl http://localhost:8080/health
```
## Development
### Using sqlc
### Using sqlc (From Project Root)
```bash
# Install sqlc
go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
# Generate Go code from SQL
# Generate Go code from SQL (from project root)
sqlc generate
# Build with generated code
go build ./cmd/server
# Build unified binary
go build -o insertr .
# Development with hot reload
just dev # Full-stack development
air # Hot reload unified binary only
```
### Database Schema
### Database Schema (Location Updated)
See `db/schema/schema.sql` for the complete schema. Key tables:
See `db/sqlite/schema.sql` and `db/postgresql/schema.sql` for database-specific schemas. Key tables:
- `content` - Current content versions
- `content` - Current content versions
- `content_versions` - Complete version history
### Example Version Control Workflow
@@ -103,21 +125,20 @@ curl -X POST "http://localhost:8080/api/content/hero-title/rollback?site_id=demo
-d '{"version_id": 1}'
```
## Configuration
---
### Environment Variables
- `PORT` - Server port (default: 8080)
- `DB_PATH` - SQLite database file path (default: ./insertr.db)
## 📖 For Complete Documentation
### Command Line Flags
```bash
./insertr-server --help
```
**➡️ See the [main README](../README.md) for:**
- Unified binary installation and usage
- Complete configuration options (YAML, environment variables, CLI flags)
- Development workflow with `just dev`
- Production deployment guidance
- Full architecture documentation
## Production Deployment
**➡️ See [INTEGRATION-SUMMARY.md](../INTEGRATION-SUMMARY.md) for:**
- Technical architecture details
- Database schema information
- API integration examples
1. **Database**: Consider PostgreSQL for production scale
2. **Authentication**: Integrate with your auth system via middleware
3. **CORS**: Configure appropriate CORS policies
4. **SSL**: Serve over HTTPS
5. **Monitoring**: Add logging and metrics collection
The unified `insertr` binary provides all server functionality with improved developer experience and simplified deployment.