Locus is designed to produce a standard, production-ready codebase that can be deployed to any modern hosting provider. This guide explains the concepts and provides examples for common platforms.
Locus does not lock you into a specific hosting provider. Instead of running a magical, opaque deployment command, you will use the standard deployment workflows for your chosen hosts.
The Locus build process compiles your .locus
files into a standard project structure containing:
You will deploy these generated artifacts just like you would deploy any other standard Next.js or Express.js application.
locus deploy
Command: A Pre-flight CheckThe locus deploy
command is not a deployment tool. It is a pre-deployment utility that helps you prepare for a real deployment.
Usage:
locus deploy <environment>
When you run this command, it does two things:
locus build
to ensure your generated code is up-to-date.Locus.toml
file and displays the deployment settings found in the [deploy.environment]
section.This allows you to verify your configuration before kicking off a real deployment with your hosting provider’s tools.
You define your deployment targets in the Locus.toml
file. You can specify different settings for each environment (e.g., production
, staging
).
[deploy.production]
# The service that will host your Next.js frontend
platform = "vercel"
# The service that will host your Express.js backend
backend_platform = "railway"
# It is strongly recommended to set your database URL via an
# environment variable in your hosting provider's dashboard.
database_url = "env(PRODUCTION_DATABASE_URL)"
Here is a common deployment pattern for a Locus application.
locus build
generated/next-app
npm install
NEXT_PUBLIC_API_URL=https://your-api.railway.app
).main
branch to trigger a deployment.npm start
(which should run node generated/server.js
or similar).DATABASE_URL
: Railway will provide this from its database service.LOCUS_JWT_SECRET
: Your application’s JWT secret.main
, Railway will build and deploy your service.npx prisma migrate deploy
.This is just one example. Because Locus generates standard code, you can adapt this workflow to any provider that supports Node.js, such as Netlify, Fly.io, Render, or AWS.