Deploying CookCLI
Introduction
CookCLI is a powerful command-line toolkit designed for kitchen professionals, restaurant operators, and cooking enthusiasts who want to streamline their recipe management, meal planning, and kitchen operations. It combines the efficiency of command-line interfaces with the depth of professional kitchen management tools.
CookCLI transforms how kitchens handle the complexity of recipe management at scale. Instead of juggling spreadsheets and handwritten notes, CookCLI provides a unified system for organizing recipes, tracking ingredients, planning menus, managing inventory, and coordinating kitchen operations through an intuitive command-line interface.
Key Capabilities of CookCLI:
Recipe Management: Organize recipes with detailed instructions, ingredient lists, cooking times, and nutritional information. Search and filter recipes by cuisine, ingredient, preparation time, or dietary requirements.
Ingredient Tracking: Maintain ingredient databases with costs, suppliers, shelf life, and storage requirements. Track inventory levels and get alerts when items run low.
Meal Planning: Plan menus for days, weeks, or seasons. Automatically generate shopping lists based on planned meals. Identify ingredient overlaps to minimize waste.
Nutritional Analysis: Automatically calculate nutritional information for dishes. Track dietary requirements and allergens. Generate nutritional reports for menu items.
Cost Analysis: Calculate recipe costs down to the ingredient level. Track food cost percentages. Analyze profitability by dish or menu category.
Kitchen Operations: Manage prep schedules, station assignments, and cooking workflows. Track which dishes use which ingredients for better coordination.
Batch Operations: Scale recipes up or down easily. Generate bulk ingredient lists from multiple recipes. Export reports in multiple formats.
Integration Ready: Export data to other systems via CSV, JSON, or API. Integrate with inventory management, accounting, and POS systems.
Team Collaboration: Share recipes and meal plans across your organization. Version control for recipe changes. Audit trails for compliance and food safety.
Whether you’re running a fine dining restaurant, managing a commercial kitchen, operating a catering service, or just organizing your home cooking, CookCLI provides the tools to manage it all from the command line.
This guide walks you through deploying CookCLI on Klutch.sh. You’ll learn how to set up the application server, configure persistent storage for your recipe databases and ingredient data, implement security best practices, optimize performance for your kitchen operations, and troubleshoot common issues in production.
Prerequisites
Before deploying CookCLI to Klutch.sh, ensure you have:
- A Klutch.sh account with dashboard access
- A GitHub account for repository hosting
- Docker installed locally for testing (optional but recommended)
- Understanding of command-line interfaces and terminal operations
- Basic knowledge of recipe management and kitchen operations
- Familiarity with JSON and CSV data formats
- A domain name for API access (recommended)
- Understanding of REST APIs and command-line tooling
Understanding CookCLI Architecture
Technology Stack
CookCLI is built on modern, scalable technologies:
Core Platform:
- Go or Python backend for high performance
- REST API for programmatic access
- gRPC for efficient service-to-service communication
- PostgreSQL or SQLite for recipe and ingredient data
- Redis for caching and real-time updates
Data Processing:
- Recipe parsing and validation
- Ingredient scaling algorithms
- Nutritional calculation engine
- Cost analysis and reporting
Storage:
- Persistent database for recipes, ingredients, and plans
- File storage for images, documents, and attachments
- Backup and versioning for recipe changes
- Audit logs for compliance tracking
APIs and Integrations:
- REST API for external access
- Webhook support for event notifications
- CSV/JSON import and export
- Integration adapters for popular systems
Command-Line Interface:
- Interactive REPL for exploration
- Batch commands for automation
- Streaming output for large datasets
- Script-friendly JSON output formats
Core Components
API Server: REST and gRPC APIs handling recipe and inventory operations
Recipe Engine: Processing recipes, scaling, and nutritional calculations
Inventory System: Managing ingredients, costs, and stock levels
Planning Module: Meal planning and shopping list generation
Reporting Engine: Generating analysis reports and exports
User Management: Authentication and permission control
Database: Persistent storage for all recipe and operational data
Cache Layer: Redis for performance optimization
Installation and Setup
Step 1: Create Your Project Directory
Start with a dedicated directory for your CookCLI deployment:
mkdir cookcli-deploymentcd cookcli-deploymentgit initStep 2: Create Directory Structure
Set up the necessary directories for a production-ready deployment:
mkdir -p data logs config recipes backupsYour project structure will look like:
cookcli-deployment/├── Dockerfile├── docker-entrypoint.sh├── .env.example├── .dockerignore├── .gitignore├── config/│ └── cookcli.yaml├── data/│ └── (database files)├── recipes/│ └── (recipe templates)└── logs/ └── (application logs)Step 3: Create the Dockerfile
Create a Dockerfile for a production-ready CookCLI deployment:
# Build stageFROM golang:1.21-alpine as builder
WORKDIR /build
# Install dependenciesRUN apk add --no-cache \ git \ ca-certificates
# Clone or copy CookCLI source# Option 1: Clone from repositoryRUN git clone https://github.com/cookcli/cookcli.git . || true
# Build CookCLIRUN go build -o cookcli ./cmd/cookcli
# Runtime stageFROM alpine:latest
# Install runtime dependenciesRUN apk add --no-cache \ ca-certificates \ postgresql-client \ curl \ dumb-init
# Create app userRUN addgroup -g 1000 cookcli && \ adduser -D -u 1000 -G cookcli cookcli
WORKDIR /app
# Copy binary from builderCOPY --from=builder --chown=cookcli:cookcli /build/cookcli ./
# Copy configurationCOPY --chown=cookcli:cookcli config/ ./config/COPY --chown=cookcli:cookcli recipes/ ./recipes/
# Create necessary directoriesRUN mkdir -p /app/data /app/logs /app/backups && \ chown -R cookcli:cookcli /app
# Switch to non-root userUSER cookcli
# Expose portEXPOSE 8080
# Health checkHEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \ CMD curl -f http://localhost:8080/health || exit 1
# Use dumb-init for proper signal handlingENTRYPOINT ["dumb-init", "--"]
# Start CookCLICMD ["./cookcli", "server", "--port", "8080", "--config", "/app/config/cookcli.yaml"]Step 4: Create Environment Configuration
Create .env.example for CookCLI configuration:
# Server configurationPORT=8080LOG_LEVEL=infoENVIRONMENT=production
# Application settingsAPP_NAME=CookCLIAPP_VERSION=1.0.0
# Database configurationDATABASE_URL=postgresql://cookcli:password@localhost:5432/cookcliDATABASE_POOL_SIZE=20DATABASE_TIMEOUT=30
# Redis configuration (optional, for caching)REDIS_URL=redis://localhost:6379/0REDIS_PASSWORD=
# AuthenticationAUTH_ENABLED=trueJWT_SECRET=your-secret-key-change-thisTOKEN_EXPIRY=3600
# Recipe settingsRECIPE_MAX_SERVING_SIZE=1000RECIPE_SCALING_PRECISION=2AUTO_CALCULATE_NUTRITION=true
# Ingredient managementINGREDIENT_PRICE_HISTORY=trueCOST_UPDATE_FREQUENCY=dailyLOW_STOCK_THRESHOLD=10
# File upload settingsMAX_UPLOAD_SIZE=52428800UPLOAD_DIR=/app/data/uploadsALLOWED_EXTENSIONS=json,csv,pdf,jpg,png
# Meal planningPLAN_FORECAST_DAYS=90AUTO_GENERATE_SHOPPING_LIST=trueSHOPPING_LIST_FORMAT=grouped
# Backup settingsBACKUP_ENABLED=trueBACKUP_SCHEDULE=dailyBACKUP_DIR=/app/backupsBACKUP_RETENTION_DAYS=30
# ReportingGENERATE_REPORTS=trueREPORT_FORMAT=pdfCOST_REPORT_FREQUENCY=weekly
# API settingsAPI_RATE_LIMIT=1000API_TIMEOUT=30ENABLE_SWAGGER=trueStep 5: Create Application Configuration
Create config/cookcli.yaml for detailed settings:
# CookCLI Configuration
application: name: CookCLI version: 1.0.0 description: Kitchen Recipe and Operations Management
server: port: 8080 host: 0.0.0.0 log_level: info timeout: 30 max_connections: 1000
database: type: postgresql host: localhost port: 5432 name: cookcli user: cookcli pool_size: 20 timeout: 30 ssl_mode: require
redis: enabled: false host: localhost port: 6379 db: 0 password: "" ttl: 3600
recipes: storage_path: /app/data/recipes max_ingredients_per_recipe: 100 scaling_precision: 2 auto_calculate_nutrition: true image_storage: /app/data/images
ingredients: database_path: /app/data/ingredients track_price_history: true cost_update_frequency: daily low_stock_threshold: 10 unit_conversions_enabled: true
meal_planning: forecast_days: 90 auto_generate_shopping_list: true shopping_list_format: grouped duplicate_handling: smart
authentication: enabled: true jwt_secret: change-this-secret token_expiry: 3600 session_timeout: 86400
file_operations: upload_dir: /app/data/uploads max_upload_size: 52428800 allowed_extensions: - json - csv - pdf - jpg - png
backup: enabled: true schedule: daily directory: /app/backups retention_days: 30 compression: gzip
reporting: enabled: true formats: - pdf - csv - json cost_report_frequency: weekly nutrition_report_enabled: true
api: rate_limit: 1000 timeout: 30 enable_swagger: true allowed_origins: - "*"Step 6: Create Docker Entry Script
Create docker-entrypoint.sh for container initialization:
#!/bin/sh
set -e
# Wait for database if configuredif [ ! -z "$DATABASE_URL" ]; then echo "Waiting for database..." until pg_isready -h localhost -U cookcli -d cookcli 2>/dev/null; do printf '.' sleep 1 done echo "Database ready!"fi
# Wait for Redis if configuredif [ ! -z "$REDIS_URL" ]; then echo "Waiting for Redis..." until redis-cli -h localhost ping > /dev/null 2>&1; do printf '.' sleep 1 done echo "Redis ready!"fi
# Create necessary directoriesmkdir -p /app/data /app/logs /app/backups /app/data/uploads
# Set proper permissionschmod 755 /app/data
# Run database migrations if neededif [ "$RUN_MIGRATIONS" = "true" ]; then echo "Running database migrations..." ./cookcli migrate --database "$DATABASE_URL"fi
# Start CookCLIecho "Starting CookCLI..."exec "$@"Make it executable:
chmod +x docker-entrypoint.shStep 7: Create Sample Recipe File
Create recipes/example-recipe.json to show recipe format:
{ "id": "recipe-001", "name": "Classic Risotto Milanese", "description": "Traditional Italian risotto with saffron and Parmesan", "cuisine": "Italian", "difficulty": "intermediate", "prep_time_minutes": 15, "cook_time_minutes": 25, "servings": 4, "calories_per_serving": 420, "ingredients": [ { "name": "Arborio Rice", "quantity": 300, "unit": "grams", "cost_per_unit": 0.05, "supplier": "Italian Foods Inc" }, { "name": "Saffron Threads", "quantity": 1, "unit": "gram", "cost_per_unit": 10.00, "supplier": "Specialty Spices" }, { "name": "Parmesan Cheese", "quantity": 100, "unit": "grams", "cost_per_unit": 0.15, "supplier": "Dairy Supplier" } ], "instructions": [ { "step": 1, "instruction": "Toast rice in butter for 2 minutes", "duration_seconds": 120 }, { "step": 2, "instruction": "Add warm stock gradually, stirring constantly", "duration_seconds": 1200 }, { "step": 3, "instruction": "Finish with saffron, butter, and Parmesan", "duration_seconds": 120 } ], "nutritional_info": { "calories": 1680, "protein_grams": 24, "carbs_grams": 156, "fat_grams": 36, "fiber_grams": 2 }, "allergens": ["dairy"], "dietary_tags": ["vegetarian"], "cost_per_serving": 2.85}Step 8: Create package.json
Create package.json for deployment:
{ "name": "cookcli-deployment", "version": "1.0.0", "description": "CookCLI kitchen operations toolkit deployment", "main": "index.js", "scripts": { "start": "cookcli server --port 8080", "dev": "cookcli server --port 8080 --debug", "build": "echo 'Build complete'" }, "keywords": ["cooking", "recipes", "kitchen", "meal-planning"], "author": "Your Team", "license": "MIT"}Step 9: Create .dockerignore
Create .dockerignore:
.git.gitignore.env.env.local.env.*.local.DS_Storenode_modulesnpm-debug.logdata/*logs/*backups/*.vscode.ideaREADME.mddocs/tests/coverage/.eslintrc.githubStep 10: Create .gitignore
Create .gitignore:
# Environment.env.env.local.env.*.local
# Applicationnode_modules/package-lock.jsonyarn.lock
# Data and logsdata/logs/backups/*.lognpm-debug.log*
# Runtimetmp/.cache/*.pid
# IDE.vscode/.idea/*.swp*.swo
# OS.DS_StoreThumbs.db
# Testingcoverage/.nyc_outputStep 11: Commit to GitHub
Push your CookCLI configuration to GitHub:
git add Dockerfile docker-entrypoint.sh .env.example config/ recipes/ package.json .dockerignore .gitignoregit commit -m "Add CookCLI kitchen operations toolkit Docker configuration for Klutch.sh deployment"git branch -M maingit remote add origin https://github.com/yourusername/cookcli-deployment.gitgit push -u origin mainDeploying to Klutch.sh
Now let’s deploy CookCLI to Klutch.sh with proper configuration and persistent storage for recipes and ingredient databases.
Deployment Steps
-
Access Klutch.sh Dashboard
Navigate to klutch.sh/app and sign in with your GitHub account. This is where you’ll manage your CookCLI deployment.
-
Create a New Project
In the Projects section, click “Create Project” and name it something like “Kitchen Operations” or “Recipe Management Platform”.
-
Create a New App
Within your project, click “Create App” to begin configuring your CookCLI deployment.
-
Connect Your Repository
- Select GitHub as your Git source
- Choose the repository where you pushed your CookCLI Dockerfile
- Select the branch to deploy (typically
main)
Klutch.sh will automatically detect the Dockerfile in your repository root.
-
Configure Traffic Settings
- Traffic Type: Select HTTP (CookCLI API is a web service)
- Internal Port: Set to
8080(CookCLI default API port)
This allows applications and users to access the CookCLI API over HTTPS.
-
Configure Environment Variables
Add the following environment variables to configure your CookCLI instance:
Server Configuration:
PORT=8080LOG_LEVEL=infoENVIRONMENT=productionAPP_NAME=CookCLI Kitchen OperationsDatabase Configuration:
For PostgreSQL (recommended for production):
DATABASE_URL=postgresql://cookcli:password@hostname:5432/cookcliDATABASE_POOL_SIZE=20DATABASE_TIMEOUT=30RUN_MIGRATIONS=trueFor SQLite (simpler, single-server deployments):
DATABASE_TYPE=sqliteDATABASE_PATH=/app/data/cookcli.dbAuthentication and Security:
AUTH_ENABLED=trueJWT_SECRET=generate-a-strong-random-secret-hereTOKEN_EXPIRY=3600Recipe and Ingredient Management:
RECIPE_MAX_SERVING_SIZE=1000RECIPE_SCALING_PRECISION=2AUTO_CALCULATE_NUTRITION=trueINGREDIENT_PRICE_HISTORY=trueLOW_STOCK_THRESHOLD=10Meal Planning Configuration:
PLAN_FORECAST_DAYS=90AUTO_GENERATE_SHOPPING_LIST=trueSHOPPING_LIST_FORMAT=groupedFile Upload Settings:
MAX_UPLOAD_SIZE=52428800UPLOAD_DIR=/app/data/uploadsALLOWED_EXTENSIONS=json,csv,pdf,jpg,pngBackup and Reporting:
BACKUP_ENABLED=trueBACKUP_SCHEDULE=dailyBACKUP_RETENTION_DAYS=30GENERATE_REPORTS=trueREPORT_FORMAT=pdfOptional: Redis for Caching (improves performance):
REDIS_URL=redis://your-redis-server:6379/0Security Notes:
- Generate a strong JWT_SECRET using a random string generator
- Use HTTPS for all API calls (automatic with Klutch.sh)
- Rotate authentication tokens regularly
- Keep DATABASE_URL and JWT_SECRET secure
- Restrict file upload sizes appropriately
- Monitor backup storage usage
-
Configure Persistent Storage
CookCLI needs persistent storage to maintain recipes, ingredient data, and operational history:
Volume 1 - Application Data:
- Mount Path:
/app/data - Size: 10-50 GB (depends on recipe count and image storage)
Volume 2 - Backups:
- Mount Path:
/app/backups - Size: 20-100 GB (depends on backup retention and frequency)
Guidelines for volume sizes:
- Small kitchen (< 500 recipes, < 500 ingredients): 10 GB data, 20 GB backups
- Medium kitchen (500-5000 recipes, 500-2000 ingredients): 25 GB data, 50 GB backups
- Large kitchen (5000+ recipes, 2000+ ingredients): 50+ GB data, 100+ GB backups
Data stored:
- Recipe database with instructions and images
- Ingredient master database with costs
- Meal plans and shopping lists
- User preferences and settings
- Backup archives for disaster recovery
- Upload history and versions
Critical: Without persistent storage, all recipe data and ingredient information is lost on container restart. This is essential for production deployments.
- Mount Path:
-
Configure Compute Resources
Choose appropriate resources based on expected usage:
Small Deployment (single kitchen, < 1000 recipes):
- CPU: 1 core
- RAM: 1 GB
- Suitable for: Home kitchens, small restaurants
Medium Deployment (multiple kitchens, 1000-10000 recipes):
- CPU: 2 cores
- RAM: 2 GB
- Suitable for: Growing restaurants, catering companies
Large Deployment (enterprise, 10000+ recipes):
- CPU: 4 cores
- RAM: 4 GB
- Suitable for: Large chains, food service companies
Very Large Deployment (multi-tenant, 100000+ recipes):
- CPU: 8+ cores
- RAM: 8+ GB
- Suitable for: Enterprise platforms, SaaS deployments
Note: Recipe scaling and nutritional calculations are CPU-bound. More cores handle more concurrent operations. Monitor actual usage and scale accordingly.
-
Deploy the Application
Click “Create” to start the deployment. Klutch.sh will:
- Clone your repository from GitHub
- Build the Docker image with CookCLI
- Configure all environment variables
- Set up persistent storage volumes
- Start the CookCLI server
- Assign a public URL (e.g.,
kitchen-api.klutch.sh) - Configure automatic HTTPS with SSL certificates
Initial deployment typically takes 5-10 minutes.
-
Monitor Deployment Progress
Track your deployment:
- Go to the Deployments tab
- View real-time build logs
- Wait for status to show “Running”
- Verify environment variables are correctly set
- Confirm persistent storage is mounted
Ensure the CookCLI API starts without errors.
-
Test Your Deployment
After deployment, verify CookCLI is working:
-
Health Check:
Terminal window curl https://example-app.klutch.sh/healthShould return healthy status.
-
List Recipes:
Terminal window curl -H "Authorization: Bearer YOUR_TOKEN" \https://example-app.klutch.sh/api/v1/recipes -
Create a Recipe:
Terminal window curl -X POST \-H "Authorization: Bearer YOUR_TOKEN" \-H "Content-Type: application/json" \-d @recipes/example-recipe.json \https://example-app.klutch.sh/api/v1/recipes -
Get Recipe Details:
Terminal window curl -H "Authorization: Bearer YOUR_TOKEN" \https://example-app.klutch.sh/api/v1/recipes/recipe-001 -
Test Scaling:
Terminal window curl -X POST \-H "Authorization: Bearer YOUR_TOKEN" \-H "Content-Type: application/json" \-d '{"recipe_id": "recipe-001", "servings": 10}' \https://example-app.klutch.sh/api/v1/recipes/scale -
View Logs: Check application logs in Klutch.sh dashboard for any errors or warnings.
-
-
Configure Your Domain
Add a custom domain for professional API access:
- In Klutch.sh dashboard, go to Domains
- Click “Add Custom Domain”
- Enter your domain (e.g.,
api.kitchen.example.com) - Update DNS with CNAME record pointing to
example-app.klutch.sh - Wait for DNS propagation and SSL certificate provisioning
Update API Configuration:
- Update webhook URLs in integrations
- Update client applications with new domain
- Configure CORS if needed
- Test API access from new domain
-
Initialize with Recipe Data
After deployment, populate with recipes:
-
Import Sample Recipes:
- Create JSON files for your recipes
- Use the API to import them
- Or use the CLI import functionality
-
Set Up Ingredient Database:
- Define your ingredient master list
- Set costs and suppliers
- Configure units and conversions
-
Configure User Permissions:
- Create team members
- Set access levels (view, edit, admin)
- Configure audit logging
-
Set Up Meal Plans:
- Create planning templates
- Define seasonal menus
- Configure shopping list generation
-
Getting Started with CookCLI API
Authentication
Get an access token for API calls:
curl -X POST https://example-app.klutch.sh/api/v1/auth/login \ -H "Content-Type: application/json" \ -d '{ "username": "admin", "password": "your-password" }'Response includes JWT token - use in Authorization header:
Authorization: Bearer eyJhbGciOiJIUzI1NiIs...Recipe Operations
List all recipes:
curl -H "Authorization: Bearer TOKEN" \ https://example-app.klutch.sh/api/v1/recipesGet recipe details:
curl -H "Authorization: Bearer TOKEN" \ https://example-app.klutch.sh/api/v1/recipes/recipe-001Create a new recipe:
curl -X POST \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Pasta Carbonara", "servings": 4}' \ https://example-app.klutch.sh/api/v1/recipesUpdate a recipe:
curl -X PUT \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Updated Recipe Name"}' \ https://example-app.klutch.sh/api/v1/recipes/recipe-001Delete a recipe:
curl -X DELETE \ -H "Authorization: Bearer TOKEN" \ https://example-app.klutch.sh/api/v1/recipes/recipe-001Ingredient Management
List ingredients:
curl -H "Authorization: Bearer TOKEN" \ https://example-app.klutch.sh/api/v1/ingredientsTrack ingredient costs:
curl -X POST \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"ingredient_id": "ing-001", "cost": 2.50, "supplier": "Local Farm"}' \ https://example-app.klutch.sh/api/v1/ingredients/costsUpdate inventory levels:
curl -X PUT \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"ingredient_id": "ing-001", "quantity": 50, "unit": "kg"}' \ https://example-app.klutch.sh/api/v1/ingredients/inventoryMeal Planning
Create meal plan:
curl -X POST \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"name": "Weekly Menu", "start_date": "2024-01-01", "end_date": "2024-01-07"}' \ https://example-app.klutch.sh/api/v1/meal-plansAdd recipes to plan:
curl -X POST \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"plan_id": "plan-001", "recipe_id": "recipe-001", "date": "2024-01-01", "meal_type": "dinner"}' \ https://example-app.klutch.sh/api/v1/meal-plans/itemsGenerate shopping list:
curl -H "Authorization: Bearer TOKEN" \ https://example-app.klutch.sh/api/v1/meal-plans/plan-001/shopping-listPerformance Optimization
API Response Caching
Enable Redis caching for frequently accessed data:
REDIS_URL=redis://your-redis-server:6379/0Caches:
- Recipe listings and details
- Ingredient master data
- Nutritional calculations
- Cost analysis results
Database Optimization
PostgreSQL Performance:
DATABASE_POOL_SIZE=20DATABASE_TIMEOUT=30Create indexes for faster queries:
- Recipe searches
- Ingredient lookups
- Cost history queries
Query Optimization:
- Pagination for large result sets
- Filtering and sorting at database level
- Connection pooling for efficiency
Computational Caching
Pre-calculate expensive operations:
CACHE_NUTRITION_CALCULATIONS=trueCACHE_COST_ANALYSIS=trueCACHE_TTL=3600Reduces computation for repeated requests.
Batch Operations
Use batch APIs for multiple operations:
curl -X POST \ -H "Authorization: Bearer TOKEN" \ -H "Content-Type: application/json" \ -d '{"recipes": ["recipe-001", "recipe-002", "recipe-003"]}' \ https://example-app.klutch.sh/api/v1/recipes/batchFaster than individual API calls.
Security Best Practices
Authentication and Authorization
User Access Control:
- Enforce strong passwords (minimum 12 characters)
- Implement two-factor authentication
- Regular access reviews and audits
Role-Based Access:
- Admin: Full system access
- Chef: Recipe management and planning
- Inventory: Ingredient and cost management
- View-Only: Recipe viewing only
API Security:
- Use JWT tokens with short expiration
- Rotate secrets regularly
- Implement rate limiting per API key
Data Protection
Encryption:
- All data in transit uses HTTPS
- Consider encryption at rest for sensitive data
- Secure backup storage
User Privacy:
- Clear data retention policies
- Regular security audits
- Compliance with food safety regulations
File Security
Upload Validation:
- Restrict file types (JSON, CSV, images only)
- Scan uploads for malware
- Enforce maximum file sizes
Storage Security:
- Keep uploads in secure persistent volume
- Regular backup of recipe images
- Version control for recipe changes
Regular Maintenance
Security Updates:
- Monitor CookCLI releases for patches
- Update dependencies regularly
- Test updates in staging environment
Audit Logging:
- Log all admin actions
- Track recipe modifications
- Monitor cost changes and adjustments
Troubleshooting
Issue 1: API Not Responding
Symptoms: Connection timeouts, 503 errors, no response
Solutions:
-
Check Application Status:
- Verify app is running in Klutch.sh dashboard
- Review deployment logs for startup errors
- Check health endpoint
-
Verify Database Connection:
- Confirm DATABASE_URL is correct
- Check database is running and accessible
- Verify network connectivity to database
-
Review Resource Usage:
- Check if CPU or memory is exhausted
- Monitor disk space availability
- Check network I/O
-
Test Connectivity:
Terminal window curl -I https://example-app.klutch.sh/health
Issue 2: Recipe Data Lost After Restart
Symptoms: Recipes disappeared, data not persistent
Solutions:
-
Verify Persistent Volume:
- Confirm volume mounted at
/app/data - Check volume has sufficient space
- Verify mount path in deployment settings
- Confirm volume mounted at
-
Check Database:
- Confirm database is running
- Verify database file/connection is valid
- Test database connectivity
-
Restore from Backup:
- Use backup files in
/app/backups - Run restore command with backup file
- Verify data after restore
- Use backup files in
Issue 3: Slow Recipe Calculations
Symptoms: Nutritional calculations take seconds, scaling is slow
Solutions:
-
Enable Caching:
- Configure Redis for result caching
- Enable calculation caching
- Reduce cache TTL for fresh data
-
Optimize Calculations:
- Use pre-calculated values when possible
- Batch similar calculations
- Reduce precision if appropriate
-
Upgrade Resources:
- Increase CPU cores for parallel processing
- Add more RAM for larger calculations
- Use faster storage
-
Monitor Performance:
- Check calculation times
- Profile expensive operations
- Review slow query logs
Issue 4: Authentication Failures
Symptoms: “Unauthorized”, “Invalid token”, login fails
Solutions:
-
Verify Credentials:
- Confirm username and password
- Check account is not locked
- Verify user has API access
-
Check JWT Settings:
- Confirm JWT_SECRET is set correctly
- Check token hasn’t expired
- Verify Authorization header format
-
Reset Access:
- Generate new authentication token
- Reset user password if needed
- Check user permissions
Issue 5: High Memory Usage
Symptoms: Memory warnings, sluggish performance, crashes
Solutions:
-
Monitor Memory Usage:
- Track memory consumption during operations
- Identify memory-intensive calculations
- Check for memory leaks
-
Optimize Operations:
- Reduce batch operation sizes
- Implement streaming for large datasets
- Clear caches periodically
-
Upgrade Resources:
- Increase Klutch.sh memory allocation
- Add more RAM for larger datasets
- Consider distributed setup
Issue 6: Backup Failures
Symptoms: Backup directory full, backup process fails
Solutions:
-
Check Storage Space:
- Monitor backup volume usage
- Check retention settings
- Verify backup directory has space
-
Adjust Backup Settings:
- Reduce backup frequency if needed
- Increase retention volume size
- Archive old backups to external storage
-
Test Restore Process:
- Periodically test backup restoration
- Verify backup files are valid
- Document recovery procedures
Custom Domain Setup
Using a custom domain makes the CookCLI API feel like part of your kitchen infrastructure.
Step 1: Add Domain in Klutch.sh
- Go to your CookCLI app in Klutch.sh dashboard
- Navigate to Domains
- Click “Add Custom Domain”
- Enter your domain (e.g.,
api.kitchen.example.com) - Save
Step 2: Update DNS
Update your domain provider’s DNS records:
Type: CNAMEName: api.kitchenValue: example-app.klutch.shTTL: 3600Step 3: Verify SSL Certificate
Klutch.sh automatically provisions SSL certificates:
-
Wait for DNS propagation (up to 1 hour)
-
Test HTTPS access:
Terminal window curl -I https://api.kitchen.example.com/health -
Certificate is automatically renewed (no action needed)
Step 4: Update Configuration
Update any hardcoded domain references:
- Update webhook URLs in integrations
- Update client applications with new domain
- Update documentation
- Test API access from new domain
Production Best Practices
Backup Strategy
What to Back Up:
- Recipe database with all instructions and images
- Ingredient master database with costs
- Meal plans and shopping lists
- User accounts and preferences
- Application configuration
Backup Schedule:
- Daily: Automated full backup
- Weekly: Verify restore process
- Monthly: Archive backups for compliance
Backup Commands:
For PostgreSQL:
pg_dump postgresql://cookcli:password@host/cookcli | gzip > /backup/cookcli-$(date +%Y%m%d).sql.gzFor SQLite:
tar -czf /backup/cookcli-$(date +%Y%m%d).tar.gz /app/dataBackup Storage:
- Keep local backups for quick recovery
- Store offsite backups (cloud storage, NAS)
- Encrypt backups for security
Monitoring and Alerting
Key Metrics:
- API response times
- Database query performance
- Recipe calculation duration
- Storage space usage
- Authentication attempt rate
- Error rates
Alerts:
- CPU > 80% sustained
- Memory > 90% capacity
- API response time > 2 seconds
- Database errors
- Backup failures
- Storage nearly full
Scaling Strategy
Vertical Scaling (larger server):
- Increase CPU cores for calculations
- Add RAM for larger datasets
- Use faster storage for I/O
Horizontal Scaling (multiple servers):
- Multiple API instances behind load balancer
- PostgreSQL for shared database
- Redis for distributed caching
- Object storage for recipe images
When to Scale:
- API response times degrading
- CPU consistently > 70%
- Memory consistently > 80%
- Database becoming bottleneck
User Administration
Regular Tasks:
- Review active users monthly
- Archive inactive accounts
- Update permission levels as needed
- Audit sensitive operations
Access Control:
- Quarterly review of admin users
- Remove access for terminated employees
- Implement role-based access control
- Monitor privilege escalation attempts
Conclusion
You now have a production-ready CookCLI deployment running on Klutch.sh. Your kitchen has access to a comprehensive recipe management and operations toolkit that brings order to culinary complexity.
CookCLI brings professional kitchen operations to any scale—from small restaurants to large catering companies. Organize recipes, track costs, plan menus, and manage ingredients from a single, powerful platform.
The deployment you’ve built handles recipe scaling, nutritional calculations, cost analysis, and meal planning reliably. Scale it as your kitchen grows, backup your recipes regularly, and monitor performance to keep everything running smoothly.
Whether you’re managing a fine dining kitchen, running a catering company, or just organizing your home cooking, CookCLI provides the tools to work more efficiently and reduce waste.
For additional help, check out the CookCLI documentation, explore advanced features, and connect with other users for support and recipe sharing ideas.
Happy cooking!