build: route blog through local app origin#2879
Open
cqnykamp wants to merge 7 commits intoDoenet:mainfrom
Open
build: route blog through local app origin#2879cqnykamp wants to merge 7 commits intoDoenet:mainfrom
cqnykamp wants to merge 7 commits intoDoenet:mainfrom
Conversation
Start all three dev servers (API, app, web) with a single 'npm run dev' command. This simplifies the developer experience by eliminating the need to run multiple terminals for: - npm run dev --workspace @doenet-tools/api (port 3000) - npm run dev --workspace @doenet-tools/app (port 8000) - npm run dev --workspace @doenet-tools/web (port 4321) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use a Vite serve-only resolver for the app and a dev-only tsconfig for the API so local development does not require a prebuilt shared package. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Run an initial shared build before the root dev workflow starts, then keep the shared workspace rebuilding in watch mode alongside the API, app, and web dev servers. This removes the custom dev-only shared source resolution setup and uses the standard built-package workflow instead. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Force the initial shared build and shared watch mode so deleting packages/shared/dist does not leave the dev startup depending on stale TypeScript incremental state. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Proxy Astro blog pages and assets through the app dev server so local blog URLs work under localhost:8000/blog/... like production. Also add the Astro homepage env configuration to setup and document the updated local dev flow. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ture/dev-frontend-routing
There was a problem hiding this comment.
Pull request overview
This PR aligns local development routing with production by serving the React app and Astro blog from the same origin (localhost:8000) via Vite proxying, while updating the web app/blog configuration to use a renamed public app URL env var.
Changes:
- Proxy
/blog,/_astro, and/_imagefrom the app dev server (:8000) to the Astro dev server (:4321). - Rename
PUBLIC_DOENET_MAIN_URL→PUBLIC_APP_URLand update references across Astro components/content and env files. - Disable Astro’s dev toolbar and update READMEs to document the unified local routing flow.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/app/vite.config.mts | Adds dev-server proxy rules to route blog pages/assets through the app origin. |
| apps/web/astro.config.mjs | Disables Astro dev toolbar to avoid dev-only module requests when proxied. |
| apps/web/src/consts.ts | Renames exported env-backed URL constant to APP_URL. |
| apps/web/src/components/Header.astro | Switches header logo link to use APP_URL. |
| apps/web/src/content/learn-doenet-saint-louis-university.mdx | Updates workshop link to use APP_URL. |
| apps/web/.env | Updates local env var name and expands local env documentation comments. |
| apps/web/.env.dev3 | Renames the public app URL env var for dev3. |
| apps/web/.env.prod | Renames the public app URL env var for prod. |
| apps/web/README.md | Updates documented public env var name. |
| README.md | Updates local dev docs to describe unified routing via :8000. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| enhance student learning in their courses. | ||
|
|
||
| Interested in creating your own interactive activities? Join our free monthly virtual training sessions to get started with Doenet <a href={`${DOENET_MAIN_URL}/events#workshops`}>here</a>. | ||
| Interested in creating your own interactive activities? Join our free monthly virtual training sessions to get started with Doenet <a href={`${APP_URL}/events#workshops`}>here</a>. |
Comment on lines
+41
to
+43
| This copies `apps/api/.env.example` to `apps/api/.env`. | ||
|
|
||
| The API defaults work for local development, but edit as needed (e.g. change `DATABASE_HOST`, `DATABASE_PORT`, or `DATABASE_PASSWORD` if your MySQL setup differs — and update `DATABASE_URL` to match). The web defaults are already committed in `apps/web/.env`; use `apps/web/.env.local` for machine-specific overrides. |
dqnykamp
approved these changes
Apr 30, 2026
Member
dqnykamp
left a comment
There was a problem hiding this comment.
Address the copilot comments before merging.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Why
This makes local frontend URLs work more like production by serving both the app and blog from localhost:8000.