Projects
A Railway.Project is a workspace-scoped
namespace. It owns environments and services. Names are unique per
workspace.
Create a Project
Section titled “Create a Project”Alchemy generates a unique name unless you pass one.
const site = yield* Railway.Project("Site");url is https://railway.com/project/{projectId}. A production
environment is created with the project — do not recreate it as an
Environment. environmentId is that
primary environment.
Nothing answers on the public internet until a
Service is deployed. The Service gets its
own *.up.railway.app hostname.
A stable name
Section titled “A stable name”Pass name when you need a stable project name.
const site = yield* Railway.Project("Site", { name: "my-site",});Changing name later updates the project in place.
Description
Section titled “Description”description is optional and updates in place.
const site = yield* Railway.Project("Site", { description: "production web app",});Workspace
Section titled “Workspace”Workspace defaults to the current token
(me.workspace ?? me.workspaces[0]). Pass workspaceId to pin it.
const site = yield* Railway.Project("Site", { name: "my-site", workspaceId: "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",});Default environment name
Section titled “Default environment name”defaultEnvironmentName is create-only. Railway’s default is
production. Extra environments (staging) are a separate
Environment resource.
const site = yield* Railway.Project("Site", { defaultEnvironmentName: "production",});Module-scope declarations
Section titled “Module-scope declarations”Declare the Project once. Pass it into every child.
import * as Railway from "alchemy/Railway";
export const Site = Railway.Project("Site");Resource-valued props accept the resource or an Effect producing it. Do not unwrap it just to pass it along.
Destroy
Section titled “Destroy”alchemy destroy deletes children, then the Project.
Where next
Section titled “Where next”The tutorial deploys a Project from an
empty directory. Services run in the
Project. Environments add staging.
The Project reference lists every
prop.
Example: railway-project
is a Project plus an image Service.