SDLC 05: Infrastructure Management and Release Procedures
Revision history: Updated May 2026 — Branch strategy simplified (main = staging, production = live); migrated to systemd.
1. Branch Strategy
The Pakashop branching model is designed for simplicity and continuous integration:
| Branch | Environment | Purpose | Trigger |
|---|---|---|---|
main | Staging | Integration & Pre-production QA | Push to main |
production | Live | Production Platform | PR from main to production |
feature/* | Preview | Local development & Vercel previews | PR to main |
2. Infrastructure Overview
| Tier | Platform | Notes |
|---|---|---|
| Frontend | Vercel | Production branch: production; Staging branch: main |
| Backend (Staging) | AWS EC2 (Staging) | Tracks main branch |
| Backend (Live) | AWS EC2 (Prod) | Tracks production branch |
| Microservices | AWS EC2 | Managed with systemd; separate unit files |
3. EC2 Service Orchestration
All backend services run under systemd.
3.1 Service Orchestration
The backend ecosystem consists of several specialized microservices (Gateway, API, Notifications, Moderation, etc.) that are managed as independent units to ensure high availability and isolated scaling.
4. Deployment Flow
4.1 Frontend (Vercel)
- Staging: Pushes to
mainare automatically deployed to the staging environment (e.g.,staging.pakashop.store). - Production: Merges into
productionare automatically deployed to the live environment (pakashop.store).
4.2 Backend (EC2)
Deployment is orchestrated via GitHub Actions using the deploy.sh script on the target host.
- Staging Deployment:
- Merge feature branch into
main. - GitHub Action connects to the Staging EC2 instance.
- Executes the deployment orchestration script.
- Merge feature branch into
- Production Deployment:
- Merge
mainintoproductionvia PR. - GitHub Action connects to the Production EC2 instance.
- Executes the deployment orchestration script.
- Merge
5. Release Procedures
5.1 Standard Release
- Complete feature development on a feature branch.
- Open PR to
main. After review and CI pass, merge. - Verify changes on the Staging environment.
- Once verified, open PR from
maintoproduction. - Merge PR to trigger live deployment.
5.2 Hotfix Release
- Branch directly from
productionfor critical fixes. - Apply and verify the fix.
- Merge back to
productionfor immediate live deployment. - Important: Immediately synchronize
mainwith the new production state.
6. Rollback Procedure
- Revert: Revert the problematic commit on the corresponding branch.
- Deploy: Push the revert to trigger the automated deployment.
- Verify: Check the service status and logs to ensure stability.