Skip to content

build: route blog through local app origin#2879

Open
cqnykamp wants to merge 7 commits intoDoenet:mainfrom
cqnykamp:feature/dev-frontend-routing
Open

build: route blog through local app origin#2879
cqnykamp wants to merge 7 commits intoDoenet:mainfrom
cqnykamp:feature/dev-frontend-routing

Conversation

@cqnykamp
Copy link
Copy Markdown
Contributor

@cqnykamp cqnykamp commented Apr 23, 2026

What changed

  • route /blog, /_astro, and /_image through the app dev server so blog pages work from localhost:8000
  • disable Astro's dev toolbar in local dev so proxied blog pages do not request Astro-only virtual modules through Vite
  • add the Astro homepage env configuration to apps/web/.env.example and update npm run setup to create apps/web/.env
  • update the README for the unified local frontend routing flow

Why

This makes local frontend URLs work more like production by serving both the app and blog from localhost:8000.

cqnykamp and others added 5 commits April 22, 2026 11:26
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>
@cqnykamp cqnykamp marked this pull request as draft April 23, 2026 03:15
@cqnykamp cqnykamp changed the title feat: route blog through local app origin build: route blog through local app origin Apr 23, 2026
@cqnykamp cqnykamp marked this pull request as ready for review April 24, 2026 02:02
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 /_image from the app dev server (:8000) to the Astro dev server (:4321).
  • Rename PUBLIC_DOENET_MAIN_URLPUBLIC_APP_URL and 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 thread README.md
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.
Copy link
Copy Markdown
Member

@dqnykamp dqnykamp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Address the copilot comments before merging.

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.

3 participants