254 lines
2.4 KiB
Markdown
254 lines
2.4 KiB
Markdown
Bootstrap Specification
|
|
|
|
Purpose
|
|
|
|
The goal of bootstrap phase is to establish a stable foundation for future development.
|
|
|
|
No business features should be implemented during bootstrap.
|
|
|
|
Only infrastructure and application foundation.
|
|
|
|
---
|
|
|
|
Bootstrap Deliverables
|
|
|
|
The application must provide:
|
|
|
|
- Fiber Application
|
|
- Environment Configuration
|
|
- MariaDB Connection
|
|
- Redis Connection
|
|
- Session Management
|
|
- Template Rendering
|
|
- HTMX Support
|
|
- TinyMCE Integration Ready
|
|
- Health Check Endpoint
|
|
- Docker Support
|
|
- Structured Logging
|
|
|
|
---
|
|
|
|
Dependencies
|
|
|
|
Required packages:
|
|
|
|
Fiber
|
|
|
|
Fiber Middleware
|
|
|
|
GORM
|
|
|
|
MariaDB Driver
|
|
|
|
Redis Client
|
|
|
|
Session Middleware
|
|
|
|
Environment Loader
|
|
|
|
Structured Logger
|
|
|
|
---
|
|
|
|
Environment Variables
|
|
|
|
The application must support:
|
|
|
|
APP_NAME
|
|
|
|
APP_ENV
|
|
|
|
APP_PORT
|
|
|
|
DB_HOST
|
|
|
|
DB_PORT
|
|
|
|
DB_NAME
|
|
|
|
DB_USER
|
|
|
|
DB_PASSWORD
|
|
|
|
REDIS_HOST
|
|
|
|
REDIS_PORT
|
|
|
|
REDIS_PASSWORD
|
|
|
|
SESSION_SECRET
|
|
|
|
UPLOAD_PATH
|
|
|
|
---
|
|
|
|
Database
|
|
|
|
Requirements:
|
|
|
|
- GORM
|
|
- Auto Migration disabled
|
|
- Migration-based schema management
|
|
- Connection pooling configured
|
|
|
|
---
|
|
|
|
Redis
|
|
|
|
Requirements:
|
|
|
|
- Connection test during startup
|
|
- Used for session storage
|
|
|
|
---
|
|
|
|
Session
|
|
|
|
Requirements:
|
|
|
|
- Redis-backed session storage
|
|
- Secure cookies
|
|
- HTTP Only cookies
|
|
- SameSite cookies
|
|
|
|
---
|
|
|
|
Templates
|
|
|
|
Requirements:
|
|
|
|
- Go HTML Templates
|
|
- Layout support
|
|
- Partial support
|
|
|
|
Template structure:
|
|
|
|
layouts
|
|
|
|
partials
|
|
|
|
public
|
|
|
|
admin
|
|
|
|
---
|
|
|
|
Static Assets
|
|
|
|
Serve:
|
|
|
|
/css
|
|
|
|
/js
|
|
|
|
/images
|
|
|
|
---
|
|
|
|
Upload Strategy
|
|
|
|
Development:
|
|
|
|
web/uploads
|
|
|
|
Production:
|
|
|
|
/opt/data/uploads
|
|
|
|
Must be configurable via environment variable.
|
|
|
|
---
|
|
|
|
Health Check
|
|
|
|
Endpoint:
|
|
|
|
GET /health
|
|
|
|
Response:
|
|
|
|
{
|
|
"status": "ok"
|
|
}
|
|
|
|
Checks:
|
|
|
|
- Application running
|
|
- Database reachable
|
|
- Redis reachable
|
|
|
|
---
|
|
|
|
Base Routes
|
|
|
|
Public:
|
|
|
|
GET /
|
|
|
|
GET /health
|
|
|
|
Admin:
|
|
|
|
GET /admin/login
|
|
|
|
---
|
|
|
|
Home Page
|
|
|
|
Temporary placeholder page.
|
|
|
|
Display:
|
|
|
|
Application Name
|
|
|
|
Environment
|
|
|
|
Version
|
|
|
|
---
|
|
|
|
Logging
|
|
|
|
Use structured logging.
|
|
|
|
Log:
|
|
|
|
- Startup
|
|
- Shutdown
|
|
- Database Connection
|
|
- Redis Connection
|
|
- Errors
|
|
|
|
---
|
|
|
|
Docker
|
|
|
|
Provide:
|
|
|
|
Dockerfile
|
|
|
|
docker-compose.yml
|
|
|
|
Environment support
|
|
|
|
---
|
|
|
|
Success Criteria
|
|
|
|
Bootstrap phase is complete when:
|
|
|
|
- Application starts successfully
|
|
- Database connection succeeds
|
|
- Redis connection succeeds
|
|
- Session middleware works
|
|
- Templates render correctly
|
|
- Home page loads
|
|
- Health endpoint works
|
|
- Docker container starts successfully
|
|
|
|
No blog functionality required.
|
|
|
|
No admin functionality required.
|
|
|
|
No CRUD functionality required.
|