Deployment Overview
Architecture
All three projects are deployed to a VPS (Virtual Private Server) and managed with PM2 process manager. There is no Docker or containerization — the applications run directly on the server.
┌──────────────────────────────────────────┐
│ VPS │
│ │
│ ┌──────────────────┐ Port 3000 │
│ │ Express API │ api.myeasyguide │
│ │ (PM2 process) │ .com │
│ └──────────────────┘ │
│ │
│ ┌──────────────────┐ Port 3001 │
│ │ Next.js Frontend │ myeasyguide.com │
│ │ (PM2 process) │ │
│ └──────────────────┘ │
│ │
│ ┌──────────────────┐ │
│ │ PostgreSQL │ Port 5432 │
│ │ - walkthroughnepal│ │
│ │ - cms_myeasyguide │ │
│ └──────────────────┘ │
│ │
│ ┌──────────────────┐ │
│ │ Nginx (reverse │ Port 80/443 │
│ │ proxy) │ SSL termination │
│ └──────────────────┘ │
└──────────────────────────────────────────┘PM2 Process Names
| Application | Branch | PM2 Name | Port |
|---|---|---|---|
| Express API (production) | main | api.walkthroughnepal.com | 3000 |
| Express API (staging) | dev | staging.api.walkthroughnepal.com | 9000 |
| Frontend (production) | main | myeasyguide.com | 3001 |
| Frontend (staging) | dev | staging.myeasyguide.com | 9001 |
Server Setup
The server runs:
- Ubuntu (or similar Linux distribution)
- Node.js (managed via nvm)
- PostgreSQL (database server)
- Nginx (reverse proxy, SSL termination with Let's Encrypt)
- PM2 (process manager)
- pnpm (package manager)
Nginx Reverse Proxy
Nginx proxies requests to the appropriate PM2 process based on the domain:
api.myeasyguide.com → localhost:3000
myeasyguide.com → localhost:3001
cms.myeasyguide.com → (CMS — possibly deployed separately)SSL certificates are managed with Let's Encrypt (Certbot).
Deployment Process
Deployments are automated via GitHub Actions CI/CD pipelines. The workflow:
- Push to branch triggers deployment workflow
- GitHub Actions runs on the runner:
- Checkout code
- Setup pnpm
- Install dependencies
- Generate Prisma client
- TypeScript check
- Build
- Upload artifacts
- SSH into VPS via
appleboy/ssh-action:- Navigate to app directory
git pull(orgit reset --hardfor frontend)pnpm install --frozen-lockfilepnpm buildpm2 restart <process-name>
Manual Deployment
If CI/CD is unavailable, deploy manually:
bash
ssh user@vps
cd /path/to/api.myeasyguide.com # or myeasyguide.com
git pull origin main
pnpm install --frozen-lockfile
pnpm build
pm2 restart api.walkthroughnepal.com # or myeasyguide.comInfrastructure Files
| Project | CI/CD Files |
|---|---|
| API | .github/workflows/ci-cd.yml (production), .github/workflows/staging.yml |
| Frontend | .github/workflows/deploy.yml (production), .github/workflows/staging.yml |
The CMS does not have CI/CD workflow files in the repository. It may be deployed manually or through a different mechanism (e.g., Vercel).