---
title: "Deploy best-free-static-contact-example"
description: "Deploy and Host a React Contact Form with a Private API on Railway"
category: "Starters"
url: https://railway.com/deploy/best-free-static-contact-example
---

# Deploy best-free-static-contact-example

Deploy and Host a React Contact Form with a Private API on Railway

**[Deploy best-free-static-contact-example on Railway](https://railway.com/template/best-free-static-contact-example)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/best-free-static-contact-example/manifest.json

- **Creator:** William Raphaelson's Projects
- **Category:** Starters

## Template content

### web

- **Source:** https://github.com/WillRaphaelson/railway-react-contact-form
- **Start command:** `npm start`
- **Health check:** /health
- **Public domain:** Yes

### api

- **Source:** https://github.com/WillRaphaelson/railway-react-contact-form
- **Start command:** `npm start`
- **Health check:** /health

## Documentation

# Deploy and Host a React Contact Form with a Private API on Railway

A React/Vite contact page and a separate Node.js form API. The frontend serves static assets and proxies submissions to the API through Railway private networking. The API validates fields and saves messages to a persistent volume. It does not send email.

## About Hosting a React Contact Form

The template creates a public `web` service, a private `api` service, and a volume mounted at `/data` for JSONL submissions. Defaults are included for both ports and the storage directory. The frontend's API host is a service reference, so every deployment uses its own API. There are no external API keys or required user inputs. Railway hosting resource usage is billed according to your plan.

## Why Deploy a React Contact Form on Railway?

Use a single project for the frontend and backend while keeping the API off the public internet. Inspect deployments, healthchecks, environment variables, and storage from the same project. Customize the API for your own workflow rather than embedding secrets in browser code.

## Common Use Cases

- Learning how a static React frontend submits to a backend
- Prototyping a landing-page contact form with persistent storage
- Starting a frontend/API monorepo

## Dependencies for a React Contact Form

- A Railway account with available hosting resources
- Node.js and npm, installed by Railway's build system
- The public source repository: https://github.com/WillRaphaelson/railway-react-contact-form

### Deployment Dependencies

The frontend builds with `npm run build` and starts with `npm start` from `/frontend`. The API starts with `npm start` from `/api`. `API_HOST` references the API's private domain. The API listens on port 3001 and the frontend on port 3000. The `/health` endpoint is configured for both services.

Open the web service's generated domain and visit `/contact`. Submit fictional details, then look for a saved-message reference. Saved submissions are in `/data/submissions.jsonl` on the API volume and can be accessed through Railway's volume file tools. No submission-reading endpoint is exposed.

This is a single-replica teaching example, not a managed form inbox. Before collecting real personal data, add stronger bot/rate protection, appropriate consent and retention controls, backups, and operator access controls. The included aggregate rate limiter is process-local and resets on restart. Add an email integration if messages should reach an inbox. Review the repository README for limits and local tests.


## Similar templates

- [Openfront Gym](https://railway.com/deploy/openfront-gym) — Opensource Mindbody alternative based on Next.js and Keystone.js
- [open-excalidraw](https://railway.com/deploy/open-excalidraw) — Self-hostable collaborative drawing built on Excalidraw
- [Next.js + Prisma + PostgreSQL Starter](https://railway.com/deploy/nextjs-prisma-postgres) — Deploy a Next.js app with Prisma ORM and PostgreSQL in one click.

Open this page in a browser: https://railway.com/deploy/best-free-static-contact-example
