Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/jtapieromalambo-ctrl/Signia/llms.txt

Use this file to discover all available pages before exploring further.

Signia ships with every file Railway needs to perform a fully automated deployment. When you push to GitHub, Railway picks up the Procfile to know how to start the server, nixpacks.toml to install system-level libraries, build.sh to prepare the application, and runtime.txt to pin the Python version — no additional configuration files are required. The sections below explain what each file does, then walk you through connecting your repository and setting the required environment variables.

Configuration Files

Railway’s Nixpacks builder reads four files at the project root to orchestrate the entire build and run cycle.

Procfile

The Procfile defines the two process types Railway executes. The web entry starts Gunicorn and binds it to the port provided by Railway’s $PORT environment variable. The release entry runs Django migrations after every successful build, before traffic is shifted to the new deployment.
web: gunicorn Signia.wsgi --bind 0.0.0.0:$PORT --timeout 120 --log-file -
release: python manage.py migrate
The --timeout 120 flag is important: MediaPipe landmark extraction and Whisper audio transcription can each take several seconds, so the default 30-second Gunicorn worker timeout would kill long-running requests.

build.sh

build.sh is the build script Nixpacks runs once the system dependencies have been installed. It installs Python packages, gathers static files into /staticfiles/, and runs the initial database migration.
#!/usr/bin/env bash
set -o errexit

pip install -r requirements.txt
python manage.py collectstatic --no-input --clear
python manage.py migrate
The set -o errexit directive causes the script to abort immediately if any command exits with a non-zero status, preventing a partially built container from going live.

nixpacks.toml

nixpacks.toml lists the APT packages that must be present before Python packages are installed. OpenCV and MediaPipe require shared libraries that are not available in a bare Ubuntu container.
[phases.setup]
aptPkgs = ["libgl1", "libglib2.0-0", "libgl1-mesa-glx", "ffmpeg"]
PackageWhy it’s needed
libgl1OpenCV’s core rendering dependency
libglib2.0-0GLib runtime required by OpenCV and MediaPipe
libgl1-mesa-glxMesa OpenGL for headless environments
ffmpegAudio decoding for faster-whisper (STT)

runtime.txt

runtime.txt locks the Python interpreter version. Nixpacks reads this file and provisions exactly the requested release.
python-3.11.11

Deploying to Railway

1

Create a Railway project

Log in to railway.app and click New Project. Choose Deploy from GitHub repo if your code is already on GitHub, or select Empty Project and push the code manually via the Railway CLI.
2

Connect your GitHub repository

Authorize Railway to access your GitHub account, then select the Signia repository. Railway will watch the default branch and trigger a new deployment on every push.
3

Add environment variables

Navigate to your service → Variables and add the following key-value pairs. Railway injects these into every build and runtime environment.
VariableExample valuePurpose
SECRET_KEYdjango-insecure-...Django cryptographic secret
DEBUGFalseDisables debug mode in production
DATABASE_URLpostgresql://user:pass@host.neon.tech/signia?sslmode=requireNeon PostgreSQL connection string
GROQ_API_KEYgsk_...LSC grammar conversion via Groq
BREVO_API_KEYxkeysib-...Transactional email delivery
EMAIL_HOST_USERyou@gmail.comSender address for outbound mail
EMAIL_HOST_PASSWORDapp-passwordGmail application password
RAILWAY_PUBLIC_DOMAINsignia.up.railway.appSets ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS
RAILWAY_PUBLIC_DOMAIN is read by settings.py to dynamically append your deployment’s hostname to both ALLOWED_HOSTS and CSRF_TRUSTED_ORIGINS. Without it, every POST request — including login and translation — will return a 403 CSRF error.
railway_domain = config('RAILWAY_PUBLIC_DOMAIN', default='')
if railway_domain:
    ALLOWED_HOSTS.append(railway_domain)
    CSRF_TRUSTED_ORIGINS = [f'https://{railway_domain}']
4

Railway auto-detects Procfile and nixpacks.toml

As soon as a build is triggered, Railway’s Nixpacks builder scans the repository root. It finds nixpacks.toml and installs libgl1, libglib2.0-0, libgl1-mesa-glx, and ffmpeg via APT before any Python work begins. It then finds the Procfile and registers the web and release process types automatically — no manual service configuration is required.
5

build.sh runs

Nixpacks executes build.sh during the build phase. In order, it:
  1. Installs all Python packages from requirements.txt
  2. Runs python manage.py collectstatic --no-input --clear to copy all static assets (CSS, JS, MediaPipe WASM bundles) into /staticfiles/
  3. Runs python manage.py migrate to apply any pending database migrations
After the build completes, the release command in the Procfile runs python manage.py migrate once more to handle migrations that depend on the live database state.
6

App goes live

Railway starts the web process:
gunicorn Signia.wsgi --bind 0.0.0.0:$PORT --timeout 120 --log-file -
Gunicorn listens on the port Railway assigns, and Railway’s edge proxy routes HTTPS traffic to it. Your app is live at https://<RAILWAY_PUBLIC_DOMAIN>.
The /media/ folder — which stores sign videos uploaded through the /admin-videos/ panel — is part of the container’s ephemeral filesystem. It is wiped on every Railway deployment. Any videos uploaded between deploys will be lost, and the ML model will need to be retrained after each deploy.For a production system that persists sign videos across deploys, integrate an object storage service such as Amazon S3 or Cloudinary and configure Django’s DEFAULT_FILE_STORAGE accordingly before going live.

Build docs developers (and LLMs) love