Graph Viewer Deployment
Production Server
Section titled “Production Server”The graph viewer ships with server.mjs — a lightweight Node.js HTTP server that serves the Vite-built static files from dist/. It handles:
- Content-type detection for all common web assets
- Immutable cache headers (
max-age=31536000) on/assets/*(Vite hashed filenames) no-cachefor HTML and non-hashed files- SPA fallback — unknown routes serve
index.htmlfor client-side routing - HEAD request support
- Path traversal protection
The server listens on 0.0.0.0:3000 by default. Override with HOST and PORT environment variables.
Docker
Section titled “Docker”The included multi-stage Dockerfile builds and serves the viewer:
FROM node:20-slim AS builderWORKDIR /appCOPY package*.json ./RUN npm ciCOPY . .RUN npm run build
FROM node:20-slimWORKDIR /appCOPY --from=builder /app/dist ./distCOPY --from=builder /app/server.mjs ./COPY --from=builder /app/package*.json ./ENV HOST=0.0.0.0EXPOSE 3000CMD ["node", "server.mjs"]Build and run:
docker build -t automem-graph-viewer .docker run -p 3000:3000 automem-graph-viewerTo connect to a local AutoMem instance, use Docker networking:
docker run -p 3000:3000 \ -e VITE_API_TARGET=http://host.docker.internal:8001 \ automem-graph-viewerRailway
Section titled “Railway”The viewer deploys to Railway using the included railway.toml:
[build]builder = "RAILPACK"
[deploy]restartPolicyType = "ON_FAILURE"restartPolicyMaxRetries = 5Railway auto-detects the Node.js project, runs the Dockerfile build, and exposes the service. The PORT environment variable is set automatically by Railway.
To deploy:
- Push the repository to GitHub
- Connect it to a Railway project
- Railway builds and deploys automatically on push
No additional environment variables are required for Railway — the viewer defaults to relative API URLs. Configure the API server URL via the viewer’s settings UI or localStorage after deployment.
Static Hosting
Section titled “Static Hosting”Since the viewer is a static SPA after build, you can also host it on any static file server (Nginx, Cloudflare Pages, Vercel, etc.):
npm run build# Upload dist/ to your hosting providerRequirements for the hosting provider:
- Serve
index.htmlfor all unknown routes (SPA fallback) - Set appropriate cache headers on
/assets/*
The viewer will use relative URLs by default. Users configure the AutoMem API URL through the settings UI on first visit.