> ## Documentation Index
> Fetch the complete documentation index at: https://help.getatelier.design/llms.txt
> Use this file to discover all available pages before exploring further.

# Deployment

> How Atelier's server is built and deployed on Railway.

The `apps/server` app deploys to **Railway**.

## How Railway builds

Railway runs `npm ci` using the server's own `package-lock.json`, then runs
`prisma migrate deploy` on startup.

<Warning>
  Railway uses `npm ci`, not pnpm, for the server. After adding or updating any
  dependency in `apps/server/package.json`, regenerate the lockfile or the build
  fails with `Missing: ... from lock file`:

  ```bash theme={null}
  cd apps/server && npm install --package-lock-only
  ```

  Commit `apps/server/package-lock.json` alongside `apps/server/package.json`.
</Warning>

## Migrations in production

Production applies schema changes only through `prisma migrate deploy`. Every
change to `schema.prisma` must ship with a migration file — a missing migration
causes runtime errors. Never run `prisma db push` against the production
database; use `pnpm db:push` locally, which blocks pushes to the Railway DB.

## Pre-deploy checks

Run the server typecheck before pushing, since Railway runs `npx tsc` during
deploy:

```bash theme={null}
cd apps/server && pnpm exec tsc --noEmit
```
