Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ cd DoenetTools
npm install
```

**3. Create the `.env` file**
**3. Create the API `.env` file**

```bash
npm run setup
```

This copies `apps/api/.env.example` to `apps/api/.env`. The 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).
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.
Comment on lines +41 to +43

**4. Start the database**

Expand Down Expand Up @@ -68,12 +70,17 @@ This starts:

- Shared package watcher
- Express API → http://localhost:3000
- React SPA → http://localhost:8000 (proxies `/api/*` to the API)
- React SPA → http://localhost:8000 (proxies `/api/*` to the API and `/blog/*` to Astro)
- Astro site → http://localhost:4321

This command first builds `shared` once, then starts its watch process alongside
the app, API, and web dev servers.

For local development, use the app origin for both frontends:

- app pages → `http://localhost:8000/...`
- blog pages → `http://localhost:8000/blog/...`

Alternatively, run each in a separate terminal if needed:

```bash
Expand Down
5 changes: 5 additions & 0 deletions apps/app/vite.config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@ export default defineConfig({
server: {
port: 8000,
proxy: {
// Route blog pages and Astro-generated assets through the same frontend
// entry point used by the app in production.
"/blog": "http://localhost:4321",
"/_astro": "http://localhost:4321",
"/_image": "http://localhost:4321",
"/cyapi": "http://apache",
//"/media": "http://apache",
"/api": "http://localhost:3000",
Expand Down
11 changes: 10 additions & 1 deletion apps/web/.env
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
# Default local build environment variables for the Doenet blog.
# This file is intentionally committed — all PUBLIC_ vars are public.
PUBLIC_DOENET_MAIN_URL=http://localhost:8000

# Environment-specific build values live in .env.dev3 and .env.prod.
# Use .env.local for machine-specific overrides.
# Use `npm run build -- --mode dev3` or `npm run build -- --mode prod` to
# select a non-default env file.

# Main Doenet application URL
PUBLIC_APP_URL=http://localhost:8000

# Canonical site URL used at build time for metadata and sitemap generation
PUBLIC_SITE_URL=http://localhost:4321
2 changes: 1 addition & 1 deletion apps/web/.env.dev3
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Development environment variables for the Doenet blog.
# This file is intentionally committed — all PUBLIC_ vars are public.
PUBLIC_DOENET_MAIN_URL=https://dev3.doenet.org
PUBLIC_APP_URL=https://dev3.doenet.org
PUBLIC_SITE_URL=https://dev3.doenet.org
19 changes: 0 additions & 19 deletions apps/web/.env.example

This file was deleted.

2 changes: 1 addition & 1 deletion apps/web/.env.prod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Production environment variables for the Doenet blog.
# This file is intentionally committed — all PUBLIC_ vars are public.
PUBLIC_DOENET_MAIN_URL=https://beta.doenet.org
PUBLIC_APP_URL=https://beta.doenet.org
PUBLIC_SITE_URL=https://beta.doenet.org
2 changes: 1 addition & 1 deletion apps/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Build commands:

Public env vars:

- `PUBLIC_DOENET_MAIN_URL`: URL for the main Doenet site. If not specified, the header shows a plain image.
- `PUBLIC_APP_URL`: URL for the main Doenet app. If not specified, the header shows a plain image.
- `PUBLIC_SITE_URL`: canonical site URL used for build-time metadata and sitemap generation.

## 👀 Want to learn more?
Expand Down
3 changes: 3 additions & 0 deletions apps/web/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ const env = loadEnv(mode, process.cwd(), "");

// https://astro.build/config
export default defineConfig({
devToolbar: {
enabled: false,
},
site: env.PUBLIC_SITE_URL,
integrations: [mdx(), sitemap(), react()],
markdown: {
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/components/Header.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import { getImage } from "astro:assets";
import { BLOG_BASE_URL, DOENET_MAIN_URL } from "../consts";
import { APP_URL, BLOG_BASE_URL } from "../consts";
import HeaderLink from "./HeaderLink.astro";
import doenetLogo from "../../public/Doenet_Logo_Frontpage_color_text.png";

Expand All @@ -11,8 +11,8 @@ const optimizedLogo = await getImage({ src: doenetLogo });
<nav>
<div class="nav-left">
{
DOENET_MAIN_URL ? (
<a class="logo-link" href={DOENET_MAIN_URL}>
APP_URL ? (
<a class="logo-link" href={APP_URL}>
<img src={optimizedLogo.src} alt="Doenet" width="140" height="32" />
</a>
) : (
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const SITE_DESCRIPTION =
"A place where the Doenet community shares thoughts and ideas about math education";

export const BLOG_BASE_URL = "/blog";
export const DOENET_MAIN_URL = import.meta.env.PUBLIC_DOENET_MAIN_URL;
export const APP_URL = import.meta.env.PUBLIC_APP_URL;
4 changes: 2 additions & 2 deletions apps/web/src/content/learn-doenet-saint-louis-university.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ pubDate: "Feb 13 2026"
heroImage: "/blog/images/learn-doenet-saint-louis-university/mean-value-theorem-zoomed-in.png"
---

import { DOENET_MAIN_URL } from "../consts";
import { APP_URL } from "../consts";

During our November 7-8 Doenet workshop, participants built classroom-ready activities featuring instant answer checking, interactive graphs, and randomized problems - all designed to give students immediate feedback as they work in a classroom setting.

Expand All @@ -22,5 +22,5 @@ If you want to play around, the whole activity can be found [here](https://beta.
Participants left the workshop not just with technical skills, but with concrete materials ready to
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>.
Visit beta.doenet.org for upcoming events, registration, and more!
Loading