A minimal, deployable full-stack demo for an internal developer platform (IDP). It pairs a TanStack Start frontend (React + SSR) with a Rust (axum) backend and wires them together with a single, simple interservice call.
┌──────────────────────────┐ HTTP (server function) ┌───────────────────────┐
│ frontend (Node 3000) │ ───────────────────────────▶ │ backend (Rust 3001) │
│ TanStack Start (React) │ GET /api/info │ axum │
│ │ GET /api/items │ │
│ │ ◀─────────────────────────── │ │
└──────────────────────────┘ JSON └───────────────────────┘
frontend/— TanStack Start (React 19, file-based routing, Tailwind).backend/— Rust + axum HTTP server.
The browser never calls the backend directly. Instead:
- The page calls a TanStack Start server function
(
fetchBackendInfo,fetchBackendItems) infrontend/src/lib/backend.ts. - The server function runs on the frontend's Node server and makes a normal
fetchto the Rust backend. - The backend URL comes from the
BACKEND_URLenvironment variable (defaults tohttp://localhost:3001locally,http://backend:3001in Docker Compose).
| Method | Path | Description |
|---|---|---|
| GET | /health |
Liveness probe (used by the IDP / Compose) |
| GET | /api/info |
Service metadata + uptime + request counter |
| GET | /api/items |
A small list of demo items |
Prerequisites: Node ≥ 20, pnpm, Rust (stable).
Backend (terminal 1):
cd backend cargo run # listens on http://localhost:3001
Frontend (terminal 2):
cd frontend pnpm install pnpm dev # listens on http://localhost:3000
Open http://localhost:3000.
docker compose up --build
- Frontend: http://localhost:3000
- Backend: http://localhost:3001
Compose connects the two services over an internal network and waits for the
backend's /health check before starting the frontend.
# Frontend — builds dist/client (static) + dist/server/server.js (server entry) cd frontend && pnpm build pnpm start # runs: srvx --prod -s dist/client dist/server/server.js # Backend cd backend && cargo build --release
Each service ships a production Dockerfile:
backend/Dockerfile— multi-stage Rust build into a minimal Debian runtime with a/healthHEALTHCHECK.frontend/Dockerfile— multi-stage Node build served bysrvx.
Point your IDP at the two containers and:
- Expose the frontend on port
3000(public). - Keep the backend on port
3001(internal), or expose it for debugging. - Set
BACKEND_URLon the frontend to the backend's internal address (e.g.http://backend:3001). - Use
GET /healthon the backend as the liveness/readiness probe.
| Variable | Service | Default | Description |
|---|---|---|---|
BACKEND_URL |
frontend | http://localhost:3001 |
Base URL of the Rust backend |
PORT |
both | 3000 / 3001 |
Listen port |
RUST_LOG |
backend | backend=info,tower_http=info |
Log level |