Skip to content

Route ported API groups to the .NET API and add one-command local dev - #20

Merged
iligashi merged 2 commits into
mainfrom
feat/dotnet-api-rewrites
Nov 14, 2026
Merged

iligashi merged 2 commits into
mainfrom
feat/dotnet-api-rewrites

Conversation

@iligashi

Copy link
Copy Markdown
Owner

What

  • client/next.config.ts: Next.js rewrites send /api/v1/cars, /locations, /extras and /blog to the .NET API (DOTNET_API_URL) and everything else to Express (EXPRESS_API_URL). With no EXPRESS_API_URL, no rewrites are added and the client keeps calling NEXT_PUBLIC_API_URL directly.
  • npm run setup writes local .env files with random JWT secrets (never overwrites existing ones). npm run dev:all starts Express, Next.js and the .NET API (dotnet watch) together. db:up / db:down manage the Docker MySQL.
  • README: how to run with the .NET API.

The browser only talks to the Next.js origin, so the refresh-token cookie stays first-party.

Verified locally

  • Through Next on port 3000, the four groups are answered by .NET and the rest by Express.
  • Login on Express, then the same token works on .NET /auth/me. Refresh and logout work through the proxy.
  • /cars and a car detail page render with no console errors.

Deploy

On Vercel, set EXPRESS_API_URL, DOTNET_API_URL and NEXT_PUBLIC_API_URL=/api/v1. To roll back a group, remove it from DOTNET_ROUTE_GROUPS.

Add env-driven rewrites so the browser calls /api/v1 on the site's own
origin and Next.js forwards each route group to its backend: cars to the
ASP.NET Core API (nexorarent-api) when DOTNET_API_URL is set, everything
else and /uploads to Express. Without EXPRESS_API_URL nothing changes.

Add npm run setup to generate local env files with random secrets,
npm run dev:dotnet to start the .NET API with server/.env, npm run dev:all
to start all three services, and db:up/db:down for the MySQL container.
These groups are read-only on Express and are now ported and covered by the
parity tests in nexorarent-api.
@vercel

vercel Bot commented Nov 14, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
nexorarent Ready Ready Preview Nov 14, 2026 1:51pm UTC
nexorarent-svi9 Ready Ready Preview Nov 14, 2026 1:51pm UTC
nexorarentacar Ready Ready Preview Nov 14, 2026 1:51pm UTC

@chatgpt-codex-connector

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-14T13:50:27.377834Z
We couldn’t complete this review. Comment @codex review to try again.
5cb4971 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

This branch was successfully deployed

3 active deployments
Preview – nexorarent-svi9 — 5cb49716 Deployed Nov 14, 2026 by vercel[bot]
Preview – nexorarentacar — 5cb49716 Deployed Nov 14, 2026 by vercel[bot]
Preview – nexorarent — 5cb49716 Deployed Nov 14, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant