| name | lvt-production-ready |
| description | Transform app to production-ready - adds authentication, deployment config, environment setup, and best practices |
| category | workflows |
| version | 1.0.0 |
| keywords | ["lvt","livetemplate","lt"] |
lvt:production-ready
Transform a development app into a production-ready application with authentication, deployment configuration, environment variables, and production best practices.
🎯 ACTIVATION RULES
Context Detection
This skill typically runs in existing LiveTemplate projects (.lvtrc exists).
✅ Context Established By:
- Project context -
.lvtrc exists (most common scenario)
- Agent context - User is working with
lvt-assistant agent
- Keyword context - User mentions "lvt", "livetemplate", or "lt"
Keyword matching (case-insensitive): lvt, livetemplate, lt
Trigger Patterns
With Context:
✅ Generic prompts related to this skill's purpose
Without Context (needs keywords):
✅ Must mention "lvt", "livetemplate", or "lt"
❌ Generic requests without keywords
User Prompts
When to use:
- "Make my app production ready"
- "Add authentication and deployment"
- "Prepare my app for production"
- "I need to deploy this app"
- "Make this ready for real users"
Examples:
- "Make my blog production ready"
- "Add auth and prepare for deployment"
- "I want to deploy this to production"
- "Make this app ready for real users"
Workflow Steps
This skill chains together:
- lvt:gen-auth - Add authentication system
- lvt:deploy - Add deployment configuration
- Environment setup guidance
- Production best practices checklist
Step 1: Add Authentication
Use lvt:gen-auth skill:
Ask user about auth requirements:
- Need password auth? (default: yes)
- Need magic link auth? (default: yes)
- Need email confirmation? (default: yes)
- Need password reset? (default: yes)
- Need sessions UI? (default: yes)
Generate auth:
lvt gen auth
lvt gen auth --no-magic-link
lvt gen auth --no-password
Apply migrations:
lvt migration up
cd database && sqlc generate && cd ../..
go mod tidy
Wire auth routes in main.go:
import (
"myapp/app/auth"
"myapp/shared/email"
)
emailSender := email.NewSMTPSender(email.SMTPConfig{
Host: os.Getenv("SMTP_HOST"),
Port: 587,
Username: os.Getenv("SMTP_USER"),
Password: os.Getenv("SMTP_PASS"),
From: os.Getenv("EMAIL_FROM"),
})
authHandler := auth.New(queries, emailSender)
http.Handle("/auth/register", authHandler.HandleRegister())
http.Handle("/auth/login", authHandler.HandleLogin())
http.Handle("/auth/logout", authHandler.HandleLogout())
http.Handle("/posts", auth.RequireAuth(queries, posts.Handler(queries)))
http.Handle("/dashboard", auth.RequireAuth(queries, dashboard.Handler()))
Step 2: Add Deployment Configuration
Use lvt:deploy skill:
Ask user about deployment target:
- Docker (for any platform)
- Fly.io (optimized for SQLite)
- Kubernetes (for scale)
- Traditional VPS
Generate deployment files:
lvt gen stack docker
lvt gen stack fly
lvt gen stack k8s
Verify deployment config created:
- Dockerfile
- docker-compose.yml (if Docker)
- fly.toml (if Fly.io)
- k8s manifests (if Kubernetes)
- .env.example
- README.md with deployment instructions
Step 3: Environment Variables Setup
Create .env file (never commit this):
DATABASE_PATH=/data/app.db
PORT=8080
HOST=0.0.0.0
SMTP_HOST=smtp.gmail.com
SMTP_USER=your-email@gmail.com
SMTP_PASS=your-app-password
EMAIL_FROM=noreply@yourapp.com
APP_ENV=production
APP_URL=https://yourapp.com
SESSION_SECRET=<generate-random-32-bytes>
CSRF_SECRET=<generate-random-32-bytes>
Generate secrets:
openssl rand -hex 32
openssl rand -hex 32
Step 4: Production Best Practices Checklist
Security ✅
Database ✅
Monitoring ✅
Performance ✅
Deployment ✅
Step 5: Health Check Endpoints
Generated apps already include K8s-compatible health endpoints:
http.HandleFunc("/health/live", healthLiveHandler)
http.HandleFunc("/health/ready", healthReadyHandler)
Step 6: Update README
Add production deployment section:
## Production Deployment
### Prerequisites
- Docker installed (for Docker deployment)
- Environment variables configured (see .env.example)
- SMTP credentials for email
### Deploy to [Platform]
1. Copy .env.example to .env and fill in values
2. Generate secrets: `openssl rand -hex 32`
3. Build: `docker build -t myapp .`
4. Deploy: [platform-specific commands]
### Environment Variables
See .env.example for all required variables.
### Database
Run migrations before first deploy:
```bash
lvt migration up
Email Configuration
Configure SMTP settings in .env for production email delivery.
## Quick Reference
### Full Production Setup (Docker + Auth)
```bash
# 1. Add authentication
lvt gen auth
lvt migration up
cd database && sqlc generate && cd ../..
go mod tidy
# 2. Add deployment config
lvt gen stack docker
# 3. Create environment file
cp .env.example .env
# Edit .env with production values
# 4. Generate secrets
echo "SESSION_SECRET=$(openssl rand -hex 32)" >> .env
echo "CSRF_SECRET=$(openssl rand -hex 32)" >> .env
# 5. Build and test locally
docker-compose up --build
# 6. Deploy
docker-compose up -d
Fly.io Deployment
lvt gen auth
lvt migration up
cd database && sqlc generate && cd ../..
lvt gen stack fly
fly launch
fly deploy
Checklist
Platform-Specific Guides
Docker
Best for: Any cloud provider, VPS, local hosting
Pros: Universal, portable, reproducible
Setup: Dockerfile + docker-compose.yml
Deploy:
docker-compose up -d
Fly.io
Best for: SQLite apps, global edge deployment
Pros: Optimized for SQLite, automatic HTTPS, global CDN
Setup: fly.toml + litestream.yml
Deploy:
fly deploy
Kubernetes
Best for: Large scale, enterprise deployments
Pros: Highly scalable, self-healing, enterprise-grade
Setup: Deployment, Service, Ingress manifests
Deploy:
kubectl apply -f k8s/
VPS (Traditional)
Best for: Simple deployments, single server
Pros: Simple, cost-effective
Setup: systemd service + nginx
Deploy:
GOWORK=off CGO_ENABLED=1 go build -o myapp ./cmd/myapp
./myapp
Success Criteria
Production-ready setup is successful when:
- ✅ Authentication system working
- ✅ All auth routes wired and tested
- ✅ Protected routes require authentication
- ✅ Deployment config generated
- ✅ Environment variables documented
- ✅ Health check endpoint responding
- ✅ App builds in production mode
- ✅ Deployment tested locally
- ✅ README has deployment instructions
Common Post-Production Tasks
Add Custom Domain
Fly.io:
fly certs add yourdomain.com
Docker/VPS:
Configure nginx or Caddy reverse proxy
Set Up SSL/TLS
Fly.io: Automatic
Docker: Use Let's Encrypt + Caddy/nginx
K8s: Use cert-manager
Configure Monitoring
- Add logging service (Sentry, LogRocket)
- Set up uptime monitoring (UptimeRobot)
- Configure alerts
Database Backups
SQLite + Litestream:
PostgreSQL:
Set up pg_dump cron job
Notes
- This is a meta-skill that chains multiple skills
- Always test locally before production deploy
- Keep secrets out of version control
- Document all environment variables
- Provide rollback instructions
- Test auth flows before deploying
- Verify email delivery in production
- Monitor error rates after deployment