Skip to content

Latest commit

 

History

History
118 lines (87 loc) · 2.83 KB

File metadata and controls

118 lines (87 loc) · 2.83 KB

Quick Deployment Guide

Commit Summary

All changes committed successfully

64ee806 Add professional documentation and architecture diagram
5a42106 Add GitHub Actions CI/CD pipeline  
fc4a1b0 Add testing and linting configuration
28f0552 Add PostgreSQL driver and secure credential management
e272591 Migrate database from MySQL to PostgreSQL
6ad7772 Add Docker and Render deployment configuration

Next Steps

1. Push to GitHub

git push origin main

This will trigger the GitHub Actions CI/CD pipeline automatically.

2. Verify CI Pipeline

  • Go to GitHub repository → Actions tab
  • Verify the CI workflow passes (lint + tests + coverage)
  • Fix any issues if needed

3. Deploy to Render

Option A: Using Render Blueprint (Recommended)

  1. Log in to render.com
  2. Click "New" → "Blueprint"
  3. Connect your GitHub repository
  4. Render auto-detects render.yaml
  5. Set environment variables:
    • ADMIN_USERNAME: your admin username
    • ADMIN_PASSWORD: secure password
  6. Click "Apply"

Option B: Manual Setup

  1. Create PostgreSQL database (free tier)
  2. Create Web Service
  3. Set build command: pip install -r requirements.txt
  4. Set start command: gunicorn --bind 0.0.0.0:$PORT --workers 4 run:app
  5. Add environment variables from .env.example
  6. Deploy

4. Test Local Docker Setup

# Build and run
docker-compose up --build

# Access at http://localhost:5000
# Login with admin / SecurePass123!

# Stop
docker-compose down

5. Run Tests Locally (Optional)

# Create virtual environment
python3 -m venv venv
source venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run tests
pytest tests/ -v --cov=app

# Run linter
flake8 app/ config/ tests/

Environment Variables Required

For production deployment, set these in Render:

Variable Description Example
FLASK_ENV Environment production
DATABASE_URL PostgreSQL connection Auto-set by Render
SECRET_KEY Flask secret Auto-generated
JWT_SECRET JWT signing key Auto-generated
ADMIN_USERNAME Admin username admin
ADMIN_PASSWORD Admin password YourSecurePassword123!

Verification Checklist

  • All code committed to Git
  • Docker configuration added
  • Render blueprint created
  • PostgreSQL migration complete
  • Environment variables documented
  • CI/CD pipeline configured
  • README updated
  • Architecture diagram added
  • Pushed to GitHub (do this now)
  • CI pipeline passing
  • Deployed to Render
  • Production app tested

Support

  • Local Issues: Check docker-compose logs
  • CI Issues: Review GitHub Actions logs
  • Render Issues: Check Render dashboard logs
  • Database Issues: Verify DATABASE_URL is set correctly