| 1 | # Railway Website: SolidStart |
| 2 | |
| 3 | Deploys a [SolidStart](https://start.solidjs.com) site to Railway with |
| 4 | `Railway.Website.SolidStart` — no adapter wiring in the project config. |
| 5 | Alchemy runs the project's own `vite build` and appends nitro's Node |
| 6 | preset: the SSR server plus client assets run on one `Railway.Service`. |
| 7 | |
| 8 | Alchemy generates a Dockerfile and uploads the build context; Railway builds the image. The Service listens on port 3000. |
| 9 | |
| 10 | |
| 11 | - `src/routes/index.tsx` is server-rendered on the Railway Service and reads `GREETING` from `process.env`. |
| 12 | - A Tailwind-styled Card component ships with the page. |
| 13 | - `vite.config.ts` holds only `solidStart()` and the Tailwind plugin — |
| 14 | no `nitroV2Plugin()`; the deploy target owns the nitro plugin |
| 15 | instance. |
| 16 | - Static assets under `public/` (or `static/`) deploy with the service. |
| 17 | |
| 18 | ```ts |
| 19 | const site = yield* Railway.Website.SolidStart("Website", { |
| 20 | env: { GREETING: "Hello from SolidStart on Railway!" }, |
| 21 | }); |
| 22 | ``` |
| 23 | |
| 24 | The integration package must be installed in the project (it is loaded |
| 25 | dynamically at deploy time), alongside `@solidjs/vite-plugin-nitro-2`: |
| 26 | |
| 27 | ```sh |
| 28 | bun add -d @alchemy.run/frontend-frameworks |
| 29 | bun add @solidjs/vite-plugin-nitro-2 |
| 30 | ``` |
| 31 | |
| 32 | ## Deploy |
| 33 | |
| 34 | ```sh |
| 35 | bun install |
| 36 | bun run deploy |
| 37 | ``` |
| 38 | |
| 39 | Unchanged sources skip the build entirely on subsequent deploys — the |
| 40 | input files are content-hashed (scoped by `memo.include`). |
| 41 | |
| 42 | ## Dev |
| 43 | |
| 44 | ```sh |
| 45 | bun run dev |
| 46 | ``` |
| 47 | |
| 48 | `alchemy dev` runs the framework's own dev server (HMR included) and |
| 49 | no cloud resources are created. |
| 50 | |
| 51 | SolidStart 2's dev server (via `srvx/node`) misrenders under Bun, so |
| 52 | run `alchemy dev` with Node for this example. |
| 53 | |
| 54 | ## Destroy |
| 55 | |
| 56 | ```sh |
| 57 | bun run destroy |
| 58 | ``` |