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
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
node_modules
/.pnp
.pnp.*
.yarn/*
Expand Down Expand Up @@ -40,3 +40,7 @@ yarn-error.log*
# typescript
*.tsbuildinfo
next-env.d.ts

# tauri / rust
apps/desktop/src-tauri/target/
apps/desktop/src-tauri/gen/
45 changes: 40 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Minimal notepad built to sit next to the agent tab.

Live: [memo.chasehuh.com](https://memo.chasehuh.com)
Live: [www.agentnote.dev](https://www.agentnote.dev)

## Stack

Expand All @@ -11,6 +11,7 @@ Live: [memo.chasehuh.com](https://memo.chasehuh.com)
- CodeMirror 6 note editor (Zed-like chrome, soft wrap, Tab→spaces; ⌘⌫ deletes to hard line start, ⇧⌘K deletes the line)
- Postgres (`pg`) — notes scoped by Clerk `user_id`
- Vercel
- Optional macOS desktop shell (Tauri 2) that loads the web app

## Setup

Expand Down Expand Up @@ -55,10 +56,10 @@ When media env vars are set, pasting or dropping an image uploads it (Clerk-auth
Development can use Clerk’s shared GitHub credentials. Production needs a GitHub OAuth App:

1. Create an OAuth App at [GitHub Developer Settings](https://github.com/settings/developers) (under `chasehuh` or the operator account).
2. Set **Homepage URL** to `https://memo.chasehuh.com`.
3. Set **Authorization callback URL** to the value shown in the Clerk Dashboard for the **agentnote** production instance → Social connections → GitHub (typically `https://<clerk-frontend-api>/v1/oauth_callback`).
2. Set **Homepage URL** to `https://www.agentnote.dev`.
3. Set **Authorization callback URL** to the value shown in the Clerk Dashboard for the **agentnote** production instance → Social connections → GitHub (typically `https://clerk.agentnote.dev/v1/oauth_callback`).
4. Paste Client ID + Client Secret into Clerk production → GitHub connection.
5. Add production domain `memo.chasehuh.com` in Clerk, deploy with production Clerk keys on Vercel.
5. Keep production domain `agentnote.dev` / `www.agentnote.dev` in Clerk, deploy with production Clerk keys on Vercel.

### Existing notes without `user_id`

Expand All @@ -71,9 +72,43 @@ ALTER TABLE notes ALTER COLUMN user_id SET NOT NULL;

(`ensureSchema` will set `NOT NULL` automatically once no nulls remain.)

## Desktop (macOS)

Thin [Tauri 2](https://v2.tauri.app/) shell under `apps/desktop`. It loads the **same** web UI — no second frontend, no local notes DB.

| Mode | Webview URL |
| --- | --- |
| `pnpm desktop:dev` | `http://localhost:3000` |
| `pnpm desktop:build` | `https://www.agentnote.dev` |

Prerequisites: Rust (`rustup`), Xcode Command Line Tools, and (for `desktop:dev`) the Next app running on port 3000.

```bash
# Terminal A
pnpm dev

# Terminal B
pnpm desktop:dev
```

Production `.app`:

```bash
pnpm desktop:build
# → apps/desktop/src-tauri/target/release/bundle/macos/agentnote.app
```

(DMG packaging is optional; enable `"targets": ["app", "dmg"]` in `tauri.conf.json` if you want it.)

Window chrome uses macOS Overlay titlebar + traffic lights; the in-page Zed-like titlebar gets a left padding when `data-desktop="tauri"` is set. Existing shortcuts (`⌘B`, `⌘N`, `⌘\`) stay in the web app.

**Clerk / OAuth note:** GitHub OAuth inside WKWebView can fail (popups, cookie partitions, redirects). If sign-in breaks in the desktop shell, use the browser app or follow up with system-browser OAuth. The shell does not embed Clerk secrets or `DATABASE_URL`.

Packaging layout is loosely inspired by [fastrepl/anarlog](https://github.com/fastrepl/anarlog) `apps/desktop` — not its local-first stack.

## Deploy

Point the project at Vercel, set the Clerk + `DATABASE_URL` env vars for Production, attach `memo.chasehuh.com`, and complete the production GitHub OAuth App steps above.
Point the project at Vercel, set the Clerk + `DATABASE_URL` env vars for Production, attach `www.agentnote.dev`, and complete the production GitHub OAuth App steps above.

## License

Expand Down
32 changes: 32 additions & 0 deletions app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,38 @@ button:disabled {
user-select: none;
}

/* macOS Overlay titlebar — opaque chrome + traffic-light inset */
html[data-desktop="tauri"],
html[data-desktop="tauri"] body {
background: var(--c-background);
}

html[data-desktop="tauri"] .zed-desktop-chrome {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 10000;
height: 38px;
background: var(--c-background);
border-bottom: 1px solid var(--c-border-variant);
pointer-events: none;
}

/* Main app already has `.zed-titlebar` — hide the stub chrome strip */
html[data-desktop="tauri"] body:has(.zed-shell) .zed-desktop-chrome {
display: none;
}

html[data-desktop="tauri"] .zed-titlebar {
height: 38px;
padding-left: 78px;
}

html[data-desktop="tauri"] .zed-login {
padding-top: 38px;
}

.zed-titlebar__title {
min-width: 0;
max-width: min(42vw, 360px);
Expand Down
2 changes: 2 additions & 0 deletions app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type { Metadata, Viewport } from "next";
import { ClerkProvider } from "@clerk/nextjs";
import { DesktopShell } from "@/components/desktop-shell";
import { ThemeBoot } from "@/components/theme-boot";
import { faviconBootScript } from "@/lib/themes";
import "./globals.css";
Expand Down Expand Up @@ -39,6 +40,7 @@ export default function RootLayout({
</head>
<body className="h-full">
<ClerkProvider>
<DesktopShell />
<ThemeBoot />
{children}
</ClerkProvider>
Expand Down
13 changes: 13 additions & 0 deletions apps/desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# @agentnote/desktop

macOS Tauri 2 shell for agentnote.

- Dev: loads `http://localhost:3000` (run `pnpm dev` in the repo root first)
- Prod build: loads `https://www.agentnote.dev`

From repo root:

```bash
pnpm desktop:dev
pnpm desktop:build
```
14 changes: 14 additions & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "@agentnote/desktop",
"private": true,
"version": "0.1.0",
"type": "module",
"scripts": {
"tauri": "tauri",
"dev": "tauri dev",
"build": "tauri build"
},
"devDependencies": {
"@tauri-apps/cli": "^2"
}
}
7 changes: 7 additions & 0 deletions apps/desktop/src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Generated by Cargo
# will have compiled files and executables
/target/

# Generated by Tauri
# will have schema files for capabilities auto-completion
/gen/schemas
Loading