Skip to content

ziex-dev/template-railway

Repository files navigation

Ziex App on Railway

A starter template for building web applications with Ziex deployed on Railway.

Documentation →

Deploy on Railway

Getting Started

Prerequisites

1. Install ZX CLI

# Linux/macOS
curl -fsSL https://ziex.dev/install | bash

# Windows
powershell -c "irm ziex.dev/install.ps1 | iex"

2. Install Zig

brew install zig  # macOS
winget install -e --id zig.zig  # Windows

Other platforms →

Project Structure

├── app/
│   ├── assets/         # Static assets (CSS, images, etc)
│   ├── main.zig        # Zig entrypoint
│   ├── pages/          # Pages (Zig/ZX)
│   │   ├── layout.zx   # Root layout
│   │   ├── page.zx     # Home page
│   │   ├── client.zx   # Client-side component
│   │   └── ...
│   └── public/         # Public static files (favicon, etc)
├── build.zig           # Zig build script
└── build.zig.zon       # Zig package manager config

Development

zig build dev

App will be available at http://localhost:3000 with hot reload enabled.

Deploy to Railway

Via Railway Dashboard

  1. Push this repo to GitHub
  2. Go to Railway and create a new project
  3. Select Deploy from GitHub repo
  4. In your service settings, configure:
    • Build Command: zig build -Doptimize=ReleaseSafe && zig build zx -- bundle
    • Start Command: ./bundle/ziex_app --rootdir ./bundle/static

Configuration

The app listens on port 3000 by default. In your Railway service settings, set the Internal Port to 3000.

To use a custom port, add -Dport=8080 to the build command and update the start command accordingly.

Contributing

Contributions are welcome! For feature requests, bug reports, or questions, see the Ziex Repo.

Links

About

Railway cloud provider

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors