Deployment

The Dissertation Editor Platform uses separate deployment mechanisms for backend and frontend.

Backend Deployment

The backend (Lambda functions, API Gateway, DynamoDB tables, S3 buckets) is deployed via Serverless Framework into the PhD Advantage client AWS account (735234196709).

Deploy Command

cd platform/backend
AWS_SDK_LOAD_CONFIG=1 npx serverless deploy --aws-profile dissertation-editor

This runs a full CloudFormation deployment to the dev stage in us-east-1. It provisions or updates all resources defined in serverless.yml.

Single Function Deploy

For faster iteration when only Lambda code has changed (no infrastructure changes):

AWS_SDK_LOAD_CONFIG=1 npx serverless deploy function \
  --function <functionName> \
  --aws-profile dissertation-editor

Rollback

To roll back to a previous deployment:

AWS_SDK_LOAD_CONFIG=1 npx serverless rollback \
  --timestamp <deploymentTimestamp> \
  --aws-profile dissertation-editor

Find available timestamps with:

AWS_SDK_LOAD_CONFIG=1 npx serverless deploy list \
  --aws-profile dissertation-editor

Frontend Deployment

The Next.js frontend auto-deploys via AWS Amplify.

Amplify Configuration

Setting Value
App ID d1vpp3bmermmyp
Region us-east-1
Staging branch staging (auto-deploy)
Production branch main (auto-deploy)

How It Works

  1. A push or merge to the staging branch triggers an Amplify build automatically.
  2. Amplify runs npm run build and deploys the Next.js output.
  3. Once staging is verified, merging staging into main triggers a production deploy.

Manual Redeploy

If you need to trigger a redeploy without a code change:

  1. Open the Amplify Console in the PhD Advantage account.
  2. Select the branch (staging or main).
  3. Click Redeploy this version.

Amplify Environment Variables

Environment variables for the frontend are configured in the Amplify Console, not in the repository. To update them:

  1. Open the Amplify Console for the app.
  2. Go to Hosting > Environment variables.
  3. Add or update the variable.
  4. Trigger a redeploy for the change to take effect.

See Environment Variables for the full list.

Git Workflow

feature/my-feature ──PR──> staging ──PR──> main
                            │                │
                       Amplify staging   Amplify production

Rules

  • Never push directly to main or staging. All changes go through pull requests.
  • Deploy Lambda before frontend when changes span both. The backend must be backward-compatible so the existing frontend continues to work during the deploy window.
  • One PR per task. Use squash merge to keep history clean.
  • Feature branches are created from staging using the naming convention feature/<task-slug> or fix/<task-slug>.

Typical Release Flow

  1. Create branch: git checkout -b feature/add-turnaround-options staging
  2. Develop and commit.
  3. Push and open PR to staging.
  4. Merge PR. Amplify deploys staging automatically.
  5. Test on the staging URL.
  6. Open PR from staging to main.
  7. Merge PR. Amplify deploys production automatically.