A full-stack web application demonstrating modern CI/CD practices with automated deployment pipelines. This project features a Next.js frontend deployed to Vercel and a Flask backend deployed to Render, with branch-based deployment automation.
This project is designed for training and educational purposes to demonstrate:
- Modern CI/CD Pipelines: Automated deployment workflows using shell scripts and GitHub Actions
- Branch-Based Deployments: Different branches deploy to different environments (production vs preview)
- Multi-Service Architecture: Frontend and backend deployed to different platforms
- Platform-Specific Configurations: Working with Vercel and Render deployment requirements
- Authentication in Automation: Handling API tokens and authentication in deployment scripts
- DevOps Best Practices: Environment variables, configuration management, and deployment orchestration
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CI/CD Pipeline β
β β
β Git Push β Branch Detection β Deploy Frontend & Backend β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββ΄βββββββββββββββββ
β β
ββββββββββββββββββ ββββββββββββββββββ
β Frontend β β Backend β
β (Next.js) β ββββββββββββ β (Flask) β
β β API Calls β β
β Vercel β β Render β
ββββββββββββββββββ ββββββββββββββββββ
Frontend:
- Next.js 16.0.2
- React 19.2.0
- TypeScript
- Deployed on Vercel
Backend:
- Python 3.11+
- Flask 3.1.2
- Flask-CORS 6.0.1
- Deployed on Render
CI/CD:
- Bash shell scripts
- GitHub Actions
- Vercel CLI
- Render CLI/API
cicd-demo/
βββ frontend/ # Next.js frontend application
β βββ src/
β β βββ app/ # Next.js app router
β β β βββ page.tsx # Main page
β β β βββ layout.tsx # Root layout
β β β βββ globals.css # Global styles
β β βββ components/ # React components
β β βββ Header.tsx # Header with logo
β β βββ Body.tsx # Main HTTP request form
β βββ public/ # Static assets
β βββ vercel.json # Vercel configuration
β βββ .env.example # Environment variable template
β βββ package.json # Dependencies
β
βββ backend/ # Flask backend application
β βββ server.py # Main Flask server
β βββ setup.py # Virtual environment setup
β βββ requirements.txt # Python dependencies
β βββ render.yaml # Render Blueprint config
β βββ Procfile # Process configuration
β βββ .env.example # Environment variable template
β
βββ .github/
β βββ workflows/
β βββ deploy.yml # GitHub Actions workflow
β
βββ deploy.sh # Main deployment automation script
βββ DEPLOYMENT.md # Comprehensive deployment guide
βββ README.md # This file
- Node.js 18+ and npm
- Python 3.11+
- Git
- Vercel account
- Render account
git clone https://github.com/acm-industry/cicd-demo.git
cd cicd-democd frontend
npm install
cp .env.example .env.local
# Edit .env.local with your backend URL
npm run devFrontend runs at http://localhost:3000
cd backend
python setup.py # Creates virtual environment and installs dependencies
# Activate virtual environment
# On Windows:
.venv\Scripts\activate
# On Mac/Linux:
source .venv/bin/activate
# Run the server
python server.pyBackend runs at http://localhost:8080
Use the deployment script for one-command deployment:
# Make script executable (Mac/Linux/WSL)
chmod +x deploy.sh
# Deploy current branch
./deploy.shThe script will:
- Detect your current branch
- Check for required tools (Vercel CLI, Render CLI)
- Prompt for authentication if needed
- Deploy frontend to Vercel
- Deploy backend to Render
See DEPLOYMENT.md for complete deployment instructions.
mainbranch: Production deployments- Other branches: Preview/staging deployments
Frontend:
cd frontend
vercel deploy --prod # For main branch
vercel deploy # For preview branchesBackend:
cd backend
render services list
render deploys create <SERVICE_ID>- HTTP Request Builder: Interactive form to send HTTP requests
- Multiple HTTP Methods: Support for GET, POST, PUT, DELETE
- Dynamic Port Configuration: Test against different backend ports
- Request Body Input: Send custom request bodies
- Response Display: View server responses in real-time
- Modern UI: Clean, dark-themed interface with proper contrast
- RESTful API: Multiple endpoints demonstrating different HTTP methods
- CORS Enabled: Cross-origin requests supported
- Simple Database: In-memory dictionary for data storage
- Health Check:
/get-testendpoint for monitoring
GET /get-test- Returns "Hello" (health check)POST /post-test- Echo validation endpointPUT /item- Add item to databaseGET /item/<name>- Retrieve item from databaseDELETE /kill/<killed>- Delete item from database
NEXT_PUBLIC_API_URL=http://localhost:8080FLASK_ENV=development
PORT=8080
PYTHON_VERSION=3.11.0
CORS_ORIGINS=http://localhost:3000,https://your-frontend.vercel.appnpm run dev # Start development server
npm run build # Build for production
npm run start # Start production serverpython setup.py # Setup virtual environment
python server.py # Start Flask server./deploy.sh # Deploy current branch- DEPLOYMENT.md - Complete deployment guide with authentication setup, troubleshooting, and best practices
- frontend/README.md - Frontend-specific documentation
- backend/README.md - Backend-specific documentation
This project teaches:
-
CI/CD Fundamentals
- Automated deployment pipelines
- Branch-based deployment strategies
- Environment management
-
DevOps Practices
- Infrastructure as Code (vercel.json, render.yaml)
- Configuration management
- Secrets management
-
Platform-Specific Deployment
- Vercel CLI and API
- Render CLI and API
- Platform authentication
-
Full-Stack Development
- Frontend/Backend separation
- API communication
- CORS handling
-
Shell Scripting
- Bash automation
- Error handling
- Cross-platform compatibility
Common issues and solutions:
Issue: "Vercel CLI not found"
npm install -g vercelIssue: "CORS errors in frontend"
- Update
CORS_ORIGINSin backend environment variables - Include your frontend URL
Issue: "Cannot connect to backend"
- Check backend is running on correct port
- Verify
NEXT_PUBLIC_API_URLin frontend .env.local
Issue: "Permission denied: ./deploy.sh"
chmod +x deploy.shSee DEPLOYMENT.md for more troubleshooting tips.
This is a training project. To contribute:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is for educational purposes.
- Next.js Documentation
- Flask Documentation
- Vercel Documentation
- Render Documentation
- GitHub Actions Documentation
Created for ACM Industry Training
Ready to deploy? Check out DEPLOYMENT.md to get started! π