Skip to content
Merged
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
24 changes: 21 additions & 3 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@ name: Deploy Mindmap to GitHub Pages
on:
pull_request:
workflow_dispatch:
inputs:
app:
# The switch between the two apps. Rolling back = running this again with the
# other choice. Both use the same sign-in client and URL, so nothing else changes.
description: "Which app to deploy to mindmap.thoughtful-ai.com"
type: choice
options:
- current
- next
default: current

permissions:
contents: read
Expand All @@ -22,17 +32,25 @@ jobs:
with:
node-version: 24
cache: npm
cache-dependency-path: |
package-lock.json
next/package-lock.json
- run: npm ci
- run: npm run build:pages
- run: npm run verify:pages
# Pull requests build and verify both apps; a deployment builds only the chosen one.
- name: Build current app
if: ${{ github.event_name != 'workflow_dispatch' || inputs.app != 'next' }}
run: npm run build:pages && npm run verify:pages
- name: Build next app
if: ${{ github.event_name != 'workflow_dispatch' || inputs.app == 'next' }}
run: npm ci --prefix next && npm run build --prefix next && node scripts/verify-pages-build.mjs next
- name: Configure Pages
if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
uses: actions/configure-pages@v5
- name: Upload Pages artifact
if: ${{ github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' }}
uses: actions/upload-pages-artifact@v4
with:
path: dist
path: ${{ inputs.app == 'next' && 'next/dist' || 'dist' }}

deploy:
name: Deploy Pages artifact
Expand Down
289 changes: 289 additions & 0 deletions docs/tools-first-pass.md

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions next/.env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
VITE_BACKEND_URL=https://app.thoughtful-ai.com/api
VITE_OAUTH_CLIENT_ID=writing-tools-mindmap
41 changes: 41 additions & 0 deletions next/TESTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Trying the tools-first Mindmap locally

For colleagues who already have the Writing Tools repo with its backend set up
(dependencies installed, `OPENAI_API_KEY` in `backend/.env`). Calls are paid by that key.

## 1. Start your Writing Tools backend with sign-in off

From inside `writing-tools/backend` (it loads `.env` from the folder it starts in):

```powershell
$env:BETTER_AUTH_ENABLED='false'; npx tsx src/index.ts
```

On macOS/Linux: `BETTER_AUTH_ENABLED=false npx tsx src/index.ts`

It must be on port 8000, and your checkout must be from 2026-07-17 or later (that is
when `/api/openai/responses` was added; `git pull` if unsure). If something else is
already on port 8000, such as an old backend, stop it first, or the app will talk to it.

## 2. Run the app

```bash
git clone https://github.com/AIToolsLab/mindmap
cd mindmap
git checkout explore/tools-first
cd next
npm ci
npm run dev
```

Open http://localhost:5183.

## If something's off

- **"Couldn't reach the coach"** in the chat: the backend isn't running on port 8000, or
sign-in is on.
- **A model error:** your key may not have access to the default model. Choose another
with `VITE_MINDMAP_MODEL` (e.g. `$env:VITE_MINDMAP_MODEL='gpt-5'; npm run dev`).
- Your chat, map and draft are saved only in your browser. "New session" clears them.

What this app is and what it tests: `../docs/tools-first-pass.md`.
12 changes: 12 additions & 0 deletions next/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Mindmap · tools-first</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading
Loading