Environment Architecture - MindVista/website GitHub Wiki

Environment Architecture

Overview

We use three distinct environments: Development, Staging, and Production.

Environment Details

Development

  • Database: Local PostgreSQL (Docker)
  • Storage: LocalStack S3 (Docker)
  • Domain: localhost:port (3000 by default)
  • Purpose: Local development and testing

Staging (a.k.a. "Preview" on Vercel)

  • Database: Neon PostgreSQL (branch from production, shared across all staging environments)
  • Storage: Dedicated S3 bucket (separate from production, shared across all staging environments)
  • Domain: Vercel Preview URLs
  • Purpose: Testing and verification

Production

  • Database: Neon PostgreSQL (Main Branch)
  • Storage: Dedicated S3 bucket
  • Domain: mindvista.ca
  • Purpose: Live production environment

Environment Variables

Each environment has its own .env file:

  • Development: .env.development (reminder that this should be named .env in your local environment)
  • Staging: .env.staging
  • Production: .env.production

[!WARNING] .env.development should be named .env in your local environment. Any references made to .env.development in our documentation refers to your local .env file.

Data Flow

graph TD
    A[Production] -->|Seeds| B[Staging]
    C[Local Dev] -->|Independent| D[Local Data]

Key Points

  • Local development uses isolated environment for independent testing and is reseeded using example data
  • Staging must be manually reseeded from production for more up-to-date specific testing
  • Production remains isolated with its own dedicated resources