Skip to content

Commit 477786e

Browse files
committed
Deploy the site to Railway, and document how
Live at https://diskpush-web-production.up.railway.app - all ten routes serve 200, the docs render from this repo's docs/*.md, and the traversal and unknown-doc cases still 404. Railway builds with Railpack now, not Nixpacks, and it ignored railway.json: the first deploy failed at prepare with "No start command detected". The build and start commands are RAILPACK_* service variables instead. Those live in Railway rather than in git, so docs/website.md records them - a service recreated without them will not build. Three details in those commands that are not obvious and were each found by a failing or wasteful build: - `--filter @diskpush/web...` keeps the install to the site. A full workspace install downloads Electron, which the website has no use for. - `--prod=false` is required because Railway sets NODE_ENV=production, under which pnpm skips devDependencies - and TypeScript and Tailwind, which the build needs, are devDependencies. - The build runs from the repository root. Setting a service root directory would break the docs pages, which read ../../docs. railway.json is deleted rather than migrated. `railway config migrate` generates a file describing the whole project's resources, and this is the shared Profullstack project which also runs tipoffwatch.com. Applying it risks pruning services this repository did not create. Verified beforehand by building and serving from a clean `git clone` with NODE_ENV=production, which is what caught the devDependency problem.
1 parent 270b3eb commit 477786e

4 files changed

Lines changed: 93 additions & 0 deletions

File tree

‎.nvmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

‎.railwayignore‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
node_modules
2+
.git
3+
.shots
4+
apps/*/node_modules
5+
packages/*/node_modules
6+
apps/*/.next
7+
apps/desktop/out
8+
apps/desktop/dist-electron
9+
packages/*/dist
10+
apps/cli/dist

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ to make that flag hard to trigger by accident.
117117
| [docs/security.md](docs/security.md) | Threat model and the decisions that follow from it |
118118
| [docs/architecture.md](docs/architecture.md) | Packages, processes and boundaries |
119119
| [docs/troubleshooting.md](docs/troubleshooting.md) | What the errors mean |
120+
| [docs/website.md](docs/website.md) | diskpush.com architecture and deployment |
120121

121122
## Repository layout
122123

‎docs/website.md‎

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# diskpush.com
2+
3+
The marketing and documentation site. Next.js App Router, server components
4+
throughout, no client JavaScript of its own.
5+
6+
## Architecture
7+
8+
- Static and server-rendered. Every page, including the docs, is readable with
9+
JavaScript disabled.
10+
- Docs are read from this repository's `docs/*.md` at build time by
11+
`apps/web/lib/docs.ts`, which also rewrites inter-document links so
12+
`defaults.md` resolves to `/docs/defaults`. There is no second copy of the
13+
documentation, so the site cannot drift from the product.
14+
- Release metadata is fetched server-side and normalised in
15+
`apps/web/lib/releases.ts`, cached for an hour. No database. A repository
16+
with no tagged release yet degrades to "not yet published" rather than an
17+
error.
18+
- `/api/releases/latest` exposes that normalised shape so the download UI never
19+
has to know GitHub's response format.
20+
21+
## Deployment
22+
23+
Railway, in the shared **Profullstack, Inc.** project, service `diskpush-web`.
24+
25+
```bash
26+
railway link -w "Profullstack, Inc." -p "Profullstack, Inc." -e production
27+
railway service link diskpush-web
28+
railway up
29+
```
30+
31+
### Build configuration lives in Railway, not in this repo
32+
33+
Railway builds with **Railpack**, which reads three service variables. They are
34+
set on the service and are **not** in version control, so they are recorded
35+
here — a service recreated without them will fail to build:
36+
37+
```text
38+
RAILPACK_INSTALL_CMD = pnpm install --frozen-lockfile --prod=false --filter @diskpush/web...
39+
RAILPACK_BUILD_CMD = pnpm --filter @diskpush/web build
40+
RAILPACK_START_CMD = pnpm --filter @diskpush/web start
41+
```
42+
43+
Three things those commands are doing deliberately:
44+
45+
- **`--filter @diskpush/web...`** keeps the install to the site and its
46+
dependencies. A full workspace install would download Electron, which the
47+
website has no use for.
48+
- **`--prod=false`** is required because Railway sets `NODE_ENV=production`,
49+
under which pnpm would skip devDependencies — and TypeScript and Tailwind,
50+
which the build needs, are devDependencies.
51+
- **The build runs from the repository root**, not from `apps/web`. Setting a
52+
service root directory would break the docs pages, which read `../../docs`.
53+
54+
`.nvmrc` pins Node 24; `engines.node` is a range and not something a builder
55+
can pin to.
56+
57+
`.railwayignore` keeps `node_modules` and build output out of the upload.
58+
59+
### Config as code
60+
61+
Railway deprecated `railway.json` in favour of `.railway/railway.ts`
62+
(existing files work until 2026-12-01). The migration is **not** applied here:
63+
`railway config migrate` generates a file describing the whole project's
64+
resources, and this is a shared project that also runs other production
65+
services. Applying it risks pruning services this repository did not create.
66+
The Railpack variables above are service-scoped and carry no such risk.
67+
68+
## Custom domain
69+
70+
The site is served from Railway's generated domain. `diskpush.com` is not
71+
attached yet; the canonical URLs, sitemap and Open Graph metadata in
72+
`apps/web/lib/site.ts` already point at it, so those are correct in advance of
73+
the DNS change rather than after it.
74+
75+
To attach it:
76+
77+
```bash
78+
railway domain diskpush.com
79+
```
80+
81+
then add the CNAME Railway prints at the registrar.

0 commit comments

Comments
 (0)