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
1 change: 1 addition & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ After making changes in a specific package, run its check script:
| `apps/server` | `bun run check:server` | `bun run format:server` |
| `apps/sandbox` | `bun run check:sandbox` | `bun run format:sandbox` |
| `apps/server-simple` | `bun run check:server-simple` | `bun run format:server-simple` |
| `packages/convex` | `bun run check:convex` | `bun run format:convex` |
| `packages/shared` | `bun run check:shared` | `bun run format:shared` |

## Code Style
Expand Down
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ This is a Bun monorepo using Turborepo. **Only use `bun`** - never npm/yarn.
```bash
bun install
bun run dev:web # Start web app with Convex
bun run dev:desktop # Start desktop app, web app, and Convex
bun run dev:convex # Start Convex only
bun run dev:cli # Start CLI in watch mode
bun run server # Start server in watch mode
bun run cli # Run CLI (no watch)
Expand Down Expand Up @@ -70,6 +72,7 @@ All scripts use Turborepo for caching. Run from the repository root.
| `bun run check:all` | Type check all packages |
| `bun run check:cli` | Type check CLI |
| `bun run check:web` | Type check web app |
| `bun run check:convex` | Type check Convex package |
| `bun run check:server` | Type check server |
| `bun run check:sandbox` | Type check sandbox |
| `bun run check:shared` | Type check shared package |
Expand All @@ -81,6 +84,7 @@ All scripts use Turborepo for caching. Run from the repository root.
| `bun run format:all` | Format all packages |
| `bun run format:cli` | Format CLI |
| `bun run format:web` | Format web app |
| `bun run format:convex` | Format Convex package |
| `bun run format:server` | Format server |
| `bun run format:sandbox` | Format sandbox |
| `bun run format:shared` | Format shared package |
Expand All @@ -102,14 +106,16 @@ All scripts use Turborepo for caching. Run from the repository root.

### Packages

| Package | Path | Description |
| ----------------------- | ---------------------- | ---------------------------- |
| `btca` | `apps/cli` | CLI tool |
| `btca-server` | `apps/server` | API server |
| `@btca/web` | `apps/web` | Web app (SvelteKit + Convex) |
| `btca-sandbox` | `apps/sandbox` | Sandbox environment |
| `@btca/shared` | `packages/shared` | Shared utilities |
| `@btca/analytics-proxy` | `apps/analytics-proxy` | PostHog analytics proxy |
| Package | Path | Description |
| ----------------------- | ---------------------- | ------------------------------- |
| `btca` | `apps/cli` | CLI tool |
| `btca-server` | `apps/server` | API server |
| `@btca/web` | `apps/web` | Web app (SvelteKit) |
| `@btca/desktop` | `apps/desktop` | Desktop app (Tauri + SvelteKit) |
| `@btca/convex` | `packages/convex` | Shared Convex backend |
| `btca-sandbox` | `apps/sandbox` | Sandbox environment |
| `@btca/shared` | `packages/shared` | Shared utilities |
| `@btca/analytics-proxy` | `apps/analytics-proxy` | PostHog analytics proxy |

## model recs...

Expand Down
13 changes: 13 additions & 0 deletions apps/desktop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
node_modules

# Output
/.svelte-kit
/build

# Rust
/src-tauri/target

# Env
.env
.env.*
!.env.example
41 changes: 41 additions & 0 deletions apps/desktop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# @btca/desktop

Bundled Tauri + SvelteKit desktop frontend for btca.

## How it works

- The desktop app now ships its own SvelteKit frontend inside Tauri
- App UI code is copied from `apps/web` and kept close to the web app's authenticated `/app` experience
- Server-backed flows still go over HTTP to the web app server via `PUBLIC_BACKEND_BASE_URL`
- In development, `PUBLIC_BACKEND_BASE_URL` defaults to `http://localhost:5173`
- Shared public env for Clerk and Convex is loaded from the `apps/web` env directory so the desktop app can stay aligned with the current stack

## Dev

1. Install workspace dependencies from the repo root:

```sh
bun install
```

2. Start the full desktop stack from the repo root:

```sh
bun run dev:desktop
```

3. `dev:desktop` runs Convex, the web app, and the Tauri desktop app together.

4. The desktop frontend dev server runs on `http://localhost:1420`, and server-backed flows target `PUBLIC_BACKEND_BASE_URL`.

## Env

- `PUBLIC_BACKEND_BASE_URL`
Defaults to `http://localhost:5173` in dev
Falls back to `https://btca.dev` outside dev
Set this for non-default backend targets

## Notes

- The desktop app no longer embeds the hosted site
- It still depends on the web server for MCP URLs, billing redirects, and any other same-origin HTTP flows that are not bundled into the desktop frontend
49 changes: 49 additions & 0 deletions apps/desktop/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"name": "@btca/desktop",
"private": true,
"version": "0.0.1",
"type": "module",
"description": "Tauri desktop shell for the btca web app",
"scripts": {
"prepare": "svelte-kit sync || echo ''",
"dev:ui": "vite dev --host 127.0.0.1 --port 1420 --strictPort",
"build:ui": "vite build",
"dev": "tauri dev",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json && cargo check --manifest-path src-tauri/Cargo.toml",
"format": "prettier --plugin prettier-plugin-svelte --plugin prettier-plugin-tailwindcss --write package.json README.md svelte.config.js tsconfig.json vite.config.ts src src-tauri/tauri.conf.json src-tauri/capabilities/default.json && cargo fmt --manifest-path src-tauri/Cargo.toml --all"
},
"devDependencies": {
"@sveltejs/adapter-static": "^3.0.8",
"@sveltejs/kit": "^2.50.2",
"@sveltejs/vite-plugin-svelte": "^6.2.4",
"@tailwindcss/typography": "^0.5.19",
"@tailwindcss/vite": "^4.1.18",
"@tauri-apps/cli": "^2.10.1",
"prettier": "^3.8.1",
"prettier-plugin-svelte": "^3.4.1",
"prettier-plugin-tailwindcss": "^0.7.2",
"svelte": "^5.50.2",
"svelte-check": "^4.3.6",
"tailwindcss": "^4.1.18",
"typescript": "^5.9.3",
"vite": "^7.3.1"
},
"dependencies": {
"@btca/convex": "workspace:*",
"@btca/shared": "workspace:*",
"@clerk/clerk-js": "^5.122.1",
"@clerk/types": "^4.101.14",
"@lucide/svelte": "^0.562.0",
"@shikijs/langs": "^3.22.0",
"@shikijs/themes": "^3.22.0",
"better-result": "^2.7.0",
"convex": "^1.31.7",
"convex-svelte": "^0.0.12",
"isomorphic-dompurify": "^2.36.0",
"marked": "^17.0.2",
"nanoid": "^5.1.6",
"posthog-js": "^1.345.5",
"shiki": "^3.22.0",
"zod": "^4.3.6"
}
}
4 changes: 4 additions & 0 deletions apps/desktop/src-tauri/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Generated by Cargo
# will have compiled files and executables
/target/
/gen/schemas
Loading