Skip to content

Latest commit

 

History

History
57 lines (39 loc) · 1.14 KB

README.md

File metadata and controls

57 lines (39 loc) · 1.14 KB

Frontend

React + Vite SPA for the Stellar Remittance Platform. Runs on port 3000 in development.

Requirements

  • Node.js 20+

Local Development

cp .env.example .env
# set VITE_API_URL in .env (or leave empty to use the Vite proxy to localhost:3001)

npm install
npm run dev

Docker

Build

VITE_API_URL is baked into the static bundle at build time — pass it as a build argument:

docker build --build-arg VITE_API_URL=https://api.example.com -t stellar-frontend .

Run

docker run -p 8080:8080 stellar-frontend

The container serves the compiled SPA via Nginx on port 8080 as the unprivileged nginx user (port 80 requires root).

Docker Compose example

services:
  frontend:
    build:
      context: ./frontend
      args:
        VITE_API_URL: https://api.example.com
    ports:
      - "8080:8080"

Nginx

nginx.conf configures:

  • SPA routing fallback (try_files → /index.html) for client-side routes
  • Immutable long-term caching for hashed JS/CSS/image assets
  • no-cache on index.html so new deploys are picked up immediately
  • Gzip compression for text responses