CodingNic

Test, Deploy & Ship

Prepare Production Services and Environment Variables

Test, Deploy & Ship 20 min read

Prepare Production Services and Environment Variables

Prepare Production Services and Environment Variables

Task

Prepare the services that the deployed Next.js application will use.

The production architecture is:

text
Vercel
  └── Next.js application

External PostgreSQL
  └── persistent database

S3-compatible object storage
  └── persistent EPUB files and covers

Do not plan to run SeaweedFS as a persistent service inside Vercel. SeaweedFS is the local development object-storage service; production should use a separately managed persistent S3-compatible store.

Configure production values for:

env
DATABASE_URL=
SESSION_SECRET=
S3_ENDPOINT=
S3_REGION=
S3_ACCESS_KEY=
S3_SECRET_KEY=
S3_BUCKET=

Provision the production bucket separately rather than relying on an application startup action.

Never commit production credentials.

Test

Confirm:

  • the production database is reachable from the deployment environment
  • the production storage bucket exists
  • credentials are stored in the deployment platform’s secret/environment settings
  • .env files are not committed
  • local development values remain separate

Checkpoint

The production service boundary is clear and all required environment values are prepared without committing secrets.