惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

T
Threatpost
WordPress大学
WordPress大学
Martin Fowler
Martin Fowler
博客园 - 聂微东
L
LangChain Blog
D
Docker
大猫的无限游戏
大猫的无限游戏
人人都是产品经理
人人都是产品经理
D
DataBreaches.Net
aimingoo的专栏
aimingoo的专栏
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
腾讯CDC
C
Cisco Blogs
L
LINUX DO - 热门话题
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
有赞技术团队
有赞技术团队
Forbes - Security
Forbes - Security
C
Cybersecurity and Infrastructure Security Agency CISA
博客园 - 三生石上(FineUI控件)
S
Secure Thoughts
N
News and Events Feed by Topic
Latest news
Latest news
PCI Perspectives
PCI Perspectives
TaoSecurity Blog
TaoSecurity Blog
博客园 - 司徒正美
量子位
Stack Overflow Blog
Stack Overflow Blog
Know Your Adversary
Know Your Adversary
SecWiki News
SecWiki News
美团技术团队
C
CERT Recently Published Vulnerability Notes
Attack and Defense Labs
Attack and Defense Labs
AWS News Blog
AWS News Blog
C
Check Point Blog
S
Security Affairs
Vercel News
Vercel News
Google DeepMind News
Google DeepMind News
K
Kaspersky official blog
IT之家
IT之家
A
About on SuperTechFans
Help Net Security
Help Net Security
博客园 - 【当耐特】
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Recorded Future
Recorded Future
月光博客
月光博客
博客园_首页
小众软件
小众软件
H
Help Net Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
爱范儿
爱范儿

Railway Blog

Where Railway is, and where it's going (Summer 2026) PaaS vs IaaS vs SaaS: What Each Means and Who Should Pick What in 2026 The Best Continuous Deployment Tools in 2026 The Best PaaS for Multi-Region Deployments in 2026 The Best Platforms for Monorepo Deployments in 2026 Compliance Isn't a Feature, It's a Posture What is BYOC (Bring Your Own Cloud)? A Developer's Guide for 2026 The Best Managed Kubernetes Hosting in 2026 The Best Container Registries in 2026 The Vanilla Cloud Tax: What Rolling Your Own on AWS Actually Costs What is a PaaS? A Developer's Guide for 2026 The Best Cloud Observability and Logging Tools in 2026 The Best PostgreSQL Hosting for Developers in 2026 The Best Multi-Region Hosting Platforms in 2026 The Best Platforms to Deploy AI Apps in 2026 (Not the Models, the Apps Around Them) The Agent-Native Cloud: What It Means and Why It Matters Incident Report: May 19, 2026- GCP Account Suspension Counting to 3 with a new builder processing 50M+ monthly builds Railway iOS preview now available via TestFlight Kill your onboarding: selling to 10,000+ new users a day Your AI wants to nuke your database. Guardrails fix that. Better Rails for Agents: A New Remote MCP and Railway Agent in the CLI Moving Railway's Frontend Off Next.js One command deploys, there's a Stripe APP for that From registrar to deployed: buying a domain inside Railway A letter to open source builders who deserve more Networking is a black box, we used eBPF to open it Heroku Walked So Railway Can Run Security Features Your Security Team Will Love Railway Runs Open Source, Now We're Funding It Railway raises $100M Series B to unburden the builders Deploy autoscaling services, AI Workflow automation, and LLM APIs Without Kubernetes Hosting Postgres with GeoLite2: a practical guide to IP geolocation, data loading, and updates Serverless functions vs containers: CI/CD, database connections, cron jobs, and long-running tasks Hosting Postgres with pgvector: provider tradeoffs, migrations, indexes, and tuning Introducing the Railway integration on Delve.co Secure Cloud Hosting for Compliance: A Practical Guide for Startups and Regulated Industries How G2X Unlocked Rapid Experimentation at Scale with Railway MindFort Runs 100+ AI Pen Testing Agents Without Their Previous $10k AWS Bill How Bilt's Marketing Engineering Team Delivers at Scale with Railway Railway Technology Partners: Earn Revenue on Templates You Didn't Build ~$1 Million Paid to Developers Who Built Railway Templates CI/CD for Modern Deployment: From Manual Deploys to PR Environments Kernel Powers 1,000+ AI Agents on $444/Month of Railway Infrastructure Deploy Full-Stack TypeScript Apps: Architectures, Execution Models, and Deployment Choices Railway vs Cloudflare: How Their Architectures Differ and When to Use Each Run Scheduled and Recurring Tasks with Cron Monitoring & Observability: Using Logs, Metrics, Traces, and Alerts to Understand System Failures Logs, Metrics, and Traces: What Does Each Signal Tell You? Server rendering benchmarks: Railway vs Cloudflare vs Vercel Top five Heroku alternatives Comparing top PaaS and deployment providers Pricing to Encourage Use The F in SOC2 stands for functional Deploy Together, Earn Together: Introducing Railway Partnerships How We Oops-Proofed Infrastructure Deletion on Railway Bring Back the Free Plan Railway MCP - Stateful, Serverful, Pay-per-use Infrastructure Hackathon: Winners Announced! Mark Your Calendar: Railway User Hackathon with Prizes Launching Railway's Affiliate Program Zero-Touch Bare Metal at Scale Ssh, We’re Announcing One More Thing! $1M for Open Source Introducing Central Station Speed Isn’t Just About Code, It’s About Where That Code Runs One-Second Deploys? We Didn’t Believe It Either Why We’re Moving on From Nix Railway V3: Faster and Cheaper How to Migrate from Cloudflare Pages to Railway Supercharging Directus on Railway with a Static Frontend How to Migrate from AWS Lambda to Railway Deploy Triton Inference Server on Railway How to Handle Database Connection Pooling Building a NestJS App on Railway Manually Optimize Deployments on Railway Implement a GitHub Actions Testing Suite Scaling a SaaS application on Railway Deploy a Dart App on Railway, Part 2 Deploy a Dart App on Railway, Part 1 Implementing Feature Flags from Scratch Cron Jobs with Django and GitHub Actions Deploy Offen on Railway Queues on Railway Working with NX, Railway and CI/CD Automated PostgreSQL Backups Using GitLab CI/CD with Railway Migrating From Heroku To Railway Cron Jobs on Railway Deploy Beam on Railway Deploy Authorizer on Railway Deploying Monorepo Applications How to Backup and Restore Your Postgres Database How to Backup Your Redis Instance Deploy Cusdis on Railway Deploy Ghost on Railway Using Github Actions with Railway Deploy Calendso (cal.com) on Railway Self-hosted website analytics Use Notion as a CMS for your NextJS blog
Building a SaaS application on Railway
Anshuman Bhardwaj · 2024-12-13 · via Railway Blog

Software as a Service (SaaS) is a business where you provide value to your users using your software without them having to install or maintain it. A SaaS doesn’t have to be a full-blown software suite but it can also be as simple as a Slack Bot or a ToDo app.

Why build a SaaS business

Building a SaaS business is one of the most lucrative avenues for software engineers because it provides:

  • Space to experiment with tech: an opportunity to experiment with new technologies you don’t get to work with at your full-time job.
  • Lessons beyond tech: gives real-life experience of product management that teaches you a lot more than the engineering aspect of it.
  • Extra income: a successful SaaS business can generate a good side income or even a full-time income.

In this tutorial, you’ll build a SaaS application for a job application board and deploy it on the web to your custom domain.

Plan the SaaS

Before starting development it’s important to understand the project requirements and expectations. It is also important to start with the most basic requirements for the Minimal Viable Product (MVP) to test your SaaS idea.

Requirements

This job board application has the following requirements:

  • Hiring managers from companies can add new jobs to the board after logging in.
  • Job seekers can apply to these job posts by filling out a form without logging in.

In terms of features, the application will have the following pages:

  • For job seekers:
    • A home page that displays all open job posts.
    • A job details page displays the job description and a form for applying for the position.
  • For hiring managers:
    • Login/sign-up page.
    • A page to create the job post.
    • A page to view applicants who applied for a particular job post.

Technical design

Now that the feature specifications are done. You can choose a tech stack that provides the best developer experience to build it. The following technologies match the requirements laid out previously:

  • Remix for the full-stack development because it is built on React and supports server-side rendering.
  • PostgreSQL for data storage because it is easy to get started and scale later on.
  • Clerk for authentication and user management.

Build the application

To get started, create a Remix project by running the following command in the CLI:

npx create-remix@latest

This is an interactive command that will bootstrap a Remix project with TailwindCSS and TypeScript. Choose the following options when prompted:

  • Where should we create your new project?: job-board.
  • Initialise a new git repository?: Yes.
  • Install dependencies with npm?: Yes.

Set up shadcn/ui

You’ll use shadcn/ui as the UI library for consistent design and fast development. To get started, run the following command.

npx shadcn@latest init

This is an interactive command that will set up shadcn/ui with all its dependencies. Choose the following options when prompted:

  • Which style would you like to use?: New York.
  • Which color would you like to use as the base color?: Neutral.
  • Would you like to use CSS variables for theming?: Yes.

Now install the components you’ll be using to build the application by running this command in your project:

npx shadcn@latest add button input textarea card label separator

Add PostgreSQL database

You’ll use PostgreSQL to store the application data such as the job posts and applicants. The following diagram gives an overview of the data model for this application:

Job Board Application ERD
Job Board Application ERD

To integrate the Postgres database, you’ll use Drizzle ORM with postgres.js driver that lets you use Postgres in the TypeScript application. Follow these steps to get started with Drizzle:

  • Run npm i drizzle-orm nanoid postgres in the project command line to install the dependencies.
  • Run npm i -D drizzle-kit dotenv to add utilities for development.
  • Create a file app/db.server/index.ts to initialize the drizzle orm:
import { drizzle } from "drizzle-orm/postgres-js";
import postgres from "postgres";
import "dotenv/config";

const queryClient = postgres(String(process.env.DATABASE_URL));
export const db = drizzle(queryClient);

.server a naming convention in Remix used to explicitly exclude files from the client-side JS bundle.

  "scripts": {
		// other scripts..
    "generate": "drizzle-kit generate",
    "migrate": "drizzle-kit push"
  },

These commands will come in handy for managing database schema migrations. To learn more about schema migrations, see Drizzle migrations fundamentals.

  • Run npm run generate to generate the first migration file. This should create a new drizzle folder in the project. You should check this into your Git project.

For local development you need to run Postgres on your computer, you can use Docker for it. To follow the next step, you must have docker installed on your computer.

  • Run the following command to start Postgres server on your computer:
docker run -e POSTGRES_USER=admin -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=pgdb -p 5432:5432 -d postgres
  • Create a .env file in your project and add DATABASE_URL variable to it:
DATABASE_URL=postgres://admin:mysecretpassword@127.0.0.1:5432/pgdb

Make sure that the env file is not checked into your Git project.

  • Run npm run migrate to apply the schema migrations to the local database.

You’re now all set to start working with the local Postgres database.

Set up Clerk

To get started, sign up for a Clerk account if you don’t have one and then login into your Clerk dashboard. Then follow these steps:

  • Click Create application.
  • Fill in the application name and select email login as the only sign-in option.
  • Click Create application.
  • Go to Configure > API keys and select Remix as the framework.
  • Copy the credentials.
  • Paste the credentials in the .env file.

Add authentication

Inside your project follow these steps to add authentication using Clerk:

  • Run npm install @clerk/remix in the terminal to install the dependencies.
  • Update the app/root.tsx file to wrap the application in the ClerkApp higher order component. This ensures that the application has access to the authentication context and utilities from Clerk.
  • Create a new file routes/sign-up.$.tsx to render the sign up page using the SignUp component.
  • Create a new file routes/sign-in.$.tsx to render the sign in page using the SignIn component.
  • Add the following content to the .env file for server-side auth routing:
CLERK_SIGN_IN_URL=/sign-in
CLERK_SIGN_UP_URL=/sign-up
CLERK_SIGN_IN_FALLBACK_URL=/
CLERK_SIGN_UP_FALLBACK_URL=/

This will configure Clerk authentication provider and utilities throughout the application, which you’ll use in the next steps.

Build pages for job seekers

This code fetches the jobs from the database using the loader function and displays them to the user.

Running locally - page for job seekers
Running locally - page for job seekers

To render the job details markdown content as HTML, install the showdown package.

  • Run the following command:
npm i showdown
npm i -D @types/showdown

Now add the typography plugin for Tailwind CSS to apply styles for markdown content.

  • Install the package by running npm install -D @tailwindcss/typography
  • Add the plugin to the tailwind.config.ts file as follows:
/** @type {import('tailwindcss').Config} */
module.exports = {
  theme: {
    // ...
  },
  plugins: [
    require('@tailwindcss/typography'),
    // ...
  ],
}

This file will create the route for job post details from where the visitor can apply for the job.

The $ in the file name creates a dynamic route and lets you access the jobId param at runtime.

The loader function provides the job details data and creates the HTML markup for the markdown content. The action function handles the POST request from the job application <Form> and then saves the resume (PDF file) to the server disk and the applicant details in the database.

Running locally - Job posting page
Running locally - Job posting page

Build pages for hiring managers

The user journey for a hiring manager will be as follows:

User journey for a hiring manager
User journey for a hiring manager
  • Create a file app/routes/dashboard.tsx for the dashboard layout. This file acts as the root of the dashboard and handles the authentication check on the server side data loader. It redirects the user to the /sign-in page if they’re not logged in. The <Outlet /> component renders all the child or nested routes under the dashboard.
  • Create a app/routes/dashboard._index.tsx file for the dashboard home page and display all the job posts created by the logged in hiring manager.
  • Now create a app/routes/dashboard.new.tsx file for the /dashboard/new route. This is the page from where the hiring managers will create new job posts.

The page will render as shown in the following image:

Running locally - New job post page
Running locally - New job post page

To let the hiring managers manage their job posts -

The edit job post page is similar to the new job post page but pre-filled with the default form values.

Running locally - Edit job post page
Running locally - Edit job post page

To display the applicants for a job post -

The loader function fetches the list of applicants for the current job post and lets the hiring manager download their resumes. The Download resume button is a download link to a route you’ll learn about in the next steps.

Running locally - Applicants page
Running locally - Applicants page

To let the users download the resumes, create a resource route in that only has a loader and returns a file response.

  • Create a new file [app/routes/dashboard.$jobId.$applicantId.resume.ts](https://github.com/anshumanbhardwaj/job-board/blob/main/app/routes/dashboard.%24jobId.%24applicantId.resume.tsx)x

In this file the loader function reads the resume file from the disk and returns it as the response.

Deploy the application

The MVP application is now ready and it’s time to deploy it. To deploy this application you can choose any cloud provider but setting up a virtual private server (VPS) is rather complicated and time-consuming to start with. To get started quickly, you can use a platform like Railway that manages the low-level details of application deployment and exposes a seamless developer experience.

Before proceeding

  • Add a new script to the package.json to run database migration in production before starting the server:
  "scripts": {
	  // other scripts...
    "railway": "npm run migrate && npm run start"
  },

To deploy your application to Railway follow these steps:

  • Push your code to a GitHub repository.
  • Create a new account on Railway and sign into the dashboard.
  • Click New > Deploy from GitHub > Select the repository.
  • Click Deploy now.

This will create a new project with an application service and an automatic deployment will start. Railway will now automatically deploy the application whenever there’s a new commit on the main branch of your GitHub repository.

Job board deploying in Railway
Job board deploying in Railway
  • Go to job-board > Settings > Deploy > Custom Start Command and enter the npm run railway script you created earlier.
  • Click Save > Deploy. This will redeploy the application.
Adding a custom start command in Railway
Adding a custom start command in Railway

The deployment will crash because it’s missing the important credentials such as the DATABASE_URL and Clerk configuration. Close the job-board service pane.

Add persistent storage

The application stores applicant resumes on the server disk but Railway services don’t have persistent volumes by default. To fix this, follow these steps:

  • Open the project page in the Railway dashboard.
  • Right-click on the job-board service card.
  • Click Attach volume.
  • In the mount path input field, enter /resumes . This is because /resumes is the directory that the file upload action is using.
  • Click Deploy.

A persistent volume is now attached to your service.

Add production database

To create a Postgres database in this project, follow these steps:

  • Open the project page in your Railway dashboard.
  • Click Create.
  • Click Database.
  • Click Add PostgreSQL.

This will add a PostgreSQL service to your project.

Adding Postgres to project in Railway
Adding Postgres to project in Railway

Add environment variables

To add the environment variables, follow these steps:

  • On your Railway dashboard, go to job-board > Settings > Variables.
  • Click Raw Editor: Raw editor dialog opens.
  • Copy the variables from your local .env file and paste in the raw editor dialog.
  • Click Update variables.

For brevity, this article is using the Clerk development credentials. You should change those before going to production. To learn more about deploying Clerk authentication to production, refer to Clerk documentation

  • For the DATABASE_URL variable, use the Reference Variables from the Postgres service, as shown in the following image.
Adding variables to Job Board in Railway
Adding variables to Job Board in Railway
  • Click Deploy.

Changing the environment variables will trigger automatic deployment. After the deployment finishes, you’ll see that the application is running successfully.

Access the application

To access the application, you need the service domain.

  • Go to job-board > Settings > Networking > Public Networking and click Generate Domain.

After a few seconds, a random and unique domain will be assigned to your service.

Generate Domain for Job Board service in Railway
Generate Domain for Job Board service in Railway

You can now access the application on the internet using this URL.

Job Board accessible via public domain
Job Board accessible via public domain

Set up a custom domain with Cloudflare

Now that the application is up and running on the internet it’s time to add a custom domain that is easy to remember and share. For this application, you’ll be using Cloudflare for DNS setup as well as the CDN proxy because it provides:

  • DDoS Protection: Cloudflare offers robust DDoS mitigation, ensuring your app remains online even during attacks by filtering and absorbing malicious traffic.
  • Bot Detection: It identifies and blocks harmful bots while allowing legitimate traffic, protecting against scraping and other bot-driven abuse.
  • Rate Limiting: Controls excessive requests from specific users, preventing resource overuse or brute-force attacks.
  • CDN Caching: Cloudflare caches static content globally, reducing server load on Railway, improving load times, and saving bandwidth costs.

To add a custom domain to your Railway application, follow these steps:

  • On your Railway dashboard, go to job-board > Settings > Networking > Public Networking and click + Custom Domain.
Adding a Custom Domain to Job Board in Railway
Adding a Custom Domain to Job Board in Railway
  • Enter the domain name.
  • Select the port. You should choose the running application port suggested by Railway.
  • Click Add domain: the Configure DNS Records dialog opens.
  • Copy the CNAME value.
  • Open your Cloudflare dashboard.
Cloudflare Dashboard
Cloudflare Dashboard
  • Go to Site > DNS > Records.
  • Click Add record.
  • In the Type field, select CNAME.
  • In the Name field, enter the subdomain or @ if you’re using root domain.
  • In the Target field, paste the CNAME value copied earlier from the Railway dashboard.
  • Keep the Proxied status on.
  • Click Save.

To use Cloudflare proxy, you must activate end-to-end encryption.

After saving all changes, your Railway service should detect the custom domain and Cloudflare proxy, as shown in the following image.

Custom domain is detected in Railway
Custom domain is detected in Railway

You can now access the application on your custom domain.

Accessing Job Board from custom domain
Accessing Job Board from custom domain

Conclusion

After completing this tutorial, you will have successfully built and deployed a SaaS application with Remix, PostgreSQL, and Railway. This application is a good starting point from which you can start your SaaS journey and build on top of it as you go.

In the next tutorial, you’ll learn about scaling a SaaS using Railway, including cost management, multiple environments, and continuous deployments.