---
title: "Deploy static-hosting-react-api"
description: "Deploy and Host a React frontend and private form API with Railway"
category: "Starters"
url: https://railway.com/deploy/static-hosting-react-api
---

# Deploy static-hosting-react-api

Deploy and Host a React frontend and private form API with Railway

**[Deploy static-hosting-react-api on Railway](https://railway.com/template/static-hosting-react-api)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/static-hosting-react-api/manifest.json

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

## Template content

### api

- **Source:** https://github.com/WillRaphaelson/railway-react-static-api
- **Health check:** /health

### web

- **Source:** https://github.com/WillRaphaelson/railway-react-static-api
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host a React Frontend With a Form API on Railway

A React/Vite website served by Caddy with a separate Node.js validation API. The browser submits to the frontend's same-origin `/api/contact` path, which Caddy forwards over private networking.

## About Hosting a React Frontend With a Form API

The template creates two services: `web` and `api`. The frontend builds static assets and serves them with Caddy. The API validates a name, email, and message, returning a receipt without storing or emailing the submission. No database or external credentials are required. The API port, environment mode, and private hostname reference are preconfigured; no user-supplied variables are required.

## Why Deploy This Example on Railway

Deploy the frontend and API in one project, connect them through private networking, and manage public domains and service logs together. Enable the built-in CDN on the frontend after deployment to cache public assets. Origin services still use billable resources according to your plan.

## Common Use Cases

- Learning the difference between static delivery and dynamic requests.
- Moving a React website from shared hosting.
- Starting a frontend/API project before adding real form delivery or storage.

## Dependencies for This Example

The repository contains React/Vite frontend dependencies, Caddy configuration, and a Node.js API with no external packages.

### Deployment Dependencies

A Railway account with sufficient credits or an appropriate paid plan. No email account, database, API key, or custom domain is required. The API returns a demonstration receipt only; add persistence or email delivery, rate limiting, and abuse protection before collecting real enquiries. Enable CDN caching in the web service settings after its public domain is created.


## 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/static-hosting-react-api
