Skip to content

Environment Setup

  • Node.js 20+ and npm — runs all three projects
  • Git — version control
  • MongoDB — either installed locally or accessed via SSH tunnel to the remote instance
  1. Clone the repo and navigate into it:

    Terminal window
    git clone <repo-url>
    cd backend
  2. Create news-server/.env with the values below.

  3. Create news-client/.env with the values below.

  4. Install dependencies in each project:

    Terminal window
    cd news-server && npm install
    cd ../news-client && npm install
PORT=4000
MONGODB_URI=mongodb://localhost:27017/news
JWT_SECRET=replace-with-a-long-random-string
API_KEY=replace-with-your-api-key
AWS_ACCESS_KEY_ID=your-aws-key-id
AWS_SECRET_ACCESS_KEY=your-aws-secret
AWS_REGION=eu-north-1
S3_BUCKET=your-bucket-name
S3_ENDPOINT=https://s3.amazonaws.com
Variable Required Format Purpose
PORT Yes Number HTTP port for Express server
MONGODB_URI Yes MongoDB URI Database connection string
JWT_SECRET Yes Long random string Signs JWT tokens
API_KEY Yes Opaque token Auth for child-site API requests
AWS_ACCESS_KEY_ID For uploads AWS key ID S3 signed URL auth
AWS_SECRET_ACCESS_KEY For uploads AWS secret S3 signed URL auth
AWS_REGION For uploads Region string S3 region
S3_BUCKET For uploads Bucket name Upload destination
S3_ENDPOINT Optional URL Custom S3 endpoint override
VITE_API_BASE_URL=http://localhost:4000/api/v1
VITE_UPLOAD_URL=http://localhost:4000/api/v1/sign-s3
Variable Required Format Purpose
VITE_API_BASE_URL Yes URL Base path for all dashboard API calls
VITE_UPLOAD_URL Yes URL Endpoint that returns signed S3 upload URLs
VITE_JWT_STORAGE_KEY Optional String localStorage key name for the JWT token
VITE_S3_ENDPOINT Optional URL Client-side S3 endpoint
VITE_S3_BUCKET Optional String Client-side S3 bucket name
VITE_S3_REGION Optional String Client-side S3 region
VITE_S3_ACCESS_KEY_ID Optional String Client-side S3 access key
VITE_S3_SECRET_ACCESS_KEY Optional String Client-side S3 secret