Skip to content

Commit e0bdb58

Browse files
authored
fix: isolate Vercel deployments and document OAuth domain setup (#83)
2 parents 9f79917 + 4d113f1 commit e0bdb58

3 files changed

Lines changed: 55 additions & 7 deletions

File tree

‎.vercelignore‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Keep local credentials and operator files out of every Vercel upload.
2+
.git/
3+
.vercel/
4+
.env*
5+
**/.env*
6+
**/*.env
7+
.neon
8+
.agents/
9+
.codex/
10+
skills-lock.json
11+
**/appsettings.Local.json
12+
**/*.user
13+
**/*.suo
14+
15+
# Backend build output and local data are not deployment inputs.
16+
backend/**/bin/
17+
backend/**/obj/
18+
backend/**/.data/
19+
**/*.db
20+
**/*.db-shm
21+
**/*.db-wal
22+
23+
# Dependencies and generated frontend/test output are rebuilt by Vercel.
24+
node_modules/
25+
.next/
26+
coverage/
27+
playwright-report/
28+
test-results/

‎docs/containers.md‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,12 @@ build needs `global.json` and `shared/`. Its catch-all rewrite serves the API; t
147147
is for a **separate backend Vercel project**, not the existing Next.js project. Container Runtime
148148
and Services are currently beta features.
149149

150-
1. In a separate checkout or worktree, link Vercel CLI to a dedicated backend project with
151-
`vercel link`. Set that project's Root Directory to the repository root. A separate checkout
152-
keeps its local `.vercel` project link apart from the frontend's link.
150+
1. Use a separate checkout or worktree for a dedicated backend project. Create the project
151+
with `vercel project create procoderji-api --scope YOUR_TEAM` if it does not exist, then link
152+
it explicitly with `vercel link --yes --project procoderji-api --scope YOUR_TEAM`. A plain
153+
`vercel link` can select the frontend project from the Git remote. Set the backend project's
154+
Root Directory to the repository root. A separate checkout keeps its local `.vercel` project
155+
link apart from the frontend's link.
153156
2. Set these values in the backend project's environment settings:
154157

155158
| Variable | Value |
@@ -171,20 +174,29 @@ and Services are currently beta features.
171174
docker run --rm --env Database__Provider --env ConnectionStrings__Platform --env Database__Name --env PublicOrigin procoderji-api:local --migrate
172175
```
173176

174-
4. Deploy using the optional configuration from the repository root:
177+
4. In the **backend-only checkout**, copy the optional configuration to `vercel.json` so the
178+
remote build reads the service configuration, then deploy from the repository root. Preserve
179+
any existing `vercel.json` before copying:
175180

176181
```bash
177-
vercel deploy --local-config vercel.backend.json --prod
182+
cp vercel.backend.json vercel.json
183+
vercel deploy --project procoderji-api --scope YOUR_TEAM --prod
178184
```
179185

186+
In PowerShell, use `Copy-Item vercel.backend.json vercel.json`. Keep this generated
187+
`vercel.json` local to the backend checkout; committing its catch-all API rewrite to the
188+
shared branch would change frontend deployments. Keep the repository's `.vercelignore` in
189+
place: Git ignore rules alone do not exclude all local operator files from Vercel CLI uploads.
190+
180191
5. Set the frontend project's server-only `DOTNET_API_URL` to the backend's reachable HTTPS
181192
origin, redeploy the frontend, and verify the callback and account flows. Deployment
182193
Protection must allow the frontend's server requests to reach the backend. The OAuth
183194
callback remains on the frontend origin; do not register the backend URL as the callback.
184195

185196
The optional configuration is an operator template; no Vercel project is created or changed by
186-
committing it. It has not been verified against a live Vercel account. Review beta availability,
187-
project settings and database connectivity before using it for production accounts.
197+
committing it. Verify the deployed API's health, session endpoint, Google redirect and database
198+
connectivity before enabling frontend account traffic. A successful build alone does not
199+
establish that the container serves requests.
188200

189201
The repository does not provision a cloud account, a database, DNS or Google credentials. A
190202
successful image build or CI check does not verify live Google consent in the deployed system.

‎docs/deployment.md‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,14 @@ The intended production setup serves the canonical HTTPS origin directly and red
100100
hosts to that origin while preserving paths. Compare the final served host with canonical tags,
101101
Open Graph URLs, robots and sitemap entries.
102102

103+
Configure this redirect before enabling Google sign-in. A login started on `www.procoderji.com`
104+
sets a host-only correlation cookie there; a callback to `procoderji.com` cannot receive that
105+
cookie. In the frontend Vercel project's Domains settings, redirect `www.procoderji.com` to
106+
`procoderji.com` with status `308`, preserving the path and query. Verify that even
107+
`https://www.procoderji.com/api/platform/auth/google` redirects to the canonical host before a
108+
correlation cookie is issued. Keep the Google callback and backend `PublicOrigin` on that same
109+
canonical origin. This changes hosting redirects, not DNS records.
110+
103111
Read-only checks:
104112

105113
```bash

0 commit comments

Comments
 (0)