Skip to content

About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Repository files navigation

Bun + React + PostgreSQL Starter on Railway

Deploy a React application with PostgreSQL powered by the Bun runtime to Railway.

Deploy on Railway

Local Development

After cloning the repository:

  1. Install dependencies:
bun install
  1. Run the development server:
bun dev

Deployment

Method 1: Deploy via CLI

Make sure you have the Railway CLI installed:

bun install -g @railway/cli

Log into your Railway account:

railway login

After successfully authenticating, create a new project:

# Initialize project
railway init

# Add PostgreSQL database. Make sure to add this first!
railway add --database postgres

# Add your application service.
railway add --service bun-react-db --variables DATABASE_URL=\${{Postgres.DATABASE_URL}}

After the services have been created and connected, deploy the application to Railway. By default, services are only accessible within Railway's private network. To make your app publicly accessible, you need to generate a public domain.

# Deploy your application
railway up

# Generate public domain
railway domain

Auto-deploy on push

railway up deploys once from your machine. To deploy on every git push instead, push this repo to GitHub, then in the Railway dashboard open your service, go to Settings, and under Source click Connect Repo and pick the repository and branch. From then on every push to that branch deploys on its own. The dashboard method below sets this up for you from the start.

Method 2: Deploy via Dashboard

Step 1: Create New Project

  1. Go to Railway Dashboard
  2. Click "New Project"
  3. Select "Deploy from GitHub repo"
  4. Choose your repository

Step 2: Generate Public Domain

  1. Select your service
  2. Go to "Settings" tab
  3. Under "Networking", click "Generate Domain"

Your website is now live! Railway auto-deploys on every GitHub push.


About

No description, website, or topics provided.

Resources

Stars

9 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages