|
1 | 1 | # openboot.dev |
2 | 2 |
|
3 | | -> Website, dashboard, and API for [OpenBoot](https://github.com/openbootdotdev/openboot) — one-line macOS dev environment setup. |
| 3 | +Web dashboard and install API for [OpenBoot](https://github.com/openbootdotdev/openboot). |
4 | 4 |
|
5 | 5 | [](https://github.com/openbootdotdev/openboot.dev/actions/workflows/deploy.yml) |
6 | 6 |
|
7 | 7 | **Live at [openboot.dev](https://openboot.dev)** |
8 | 8 |
|
9 | | -## What This Repo Does |
| 9 | +This repo handles the web interface for managing configs, serving install scripts, and storing snapshots. The CLI lives at [openbootdotdev/openboot](https://github.com/openbootdotdev/openboot). |
10 | 10 |
|
11 | | -- **Landing page** — product overview, presets, install commands |
12 | | -- **Dashboard** — create, edit, duplicate, and share custom configs |
13 | | -- **Install API** — serves configs for the OpenBoot CLI |
14 | | -- **Brewfile import** — parse and convert Brewfiles into OpenBoot configs |
15 | | -- **Homebrew search** — live package search from the dashboard |
16 | | -- **CLI auth** — device flow for authenticating the CLI via browser |
17 | | -- **Snapshot API** — receive and store machine snapshots from the CLI |
| 11 | +## What's in Here |
18 | 12 |
|
19 | | -## Tech Stack |
| 13 | +- Landing page + docs (SvelteKit + mdsvex) |
| 14 | +- Dashboard for creating and editing configs |
| 15 | +- Install script generator (the URL you curl from) |
| 16 | +- Brewfile import parser |
| 17 | +- Package search proxies (Homebrew, NPM) |
| 18 | +- OAuth login (GitHub, Google) + CLI device auth flow |
| 19 | +- Snapshot upload API (CLI posts your machine state here) |
20 | 20 |
|
21 | | -| Layer | Technology | |
22 | | -|-------|-----------| |
23 | | -| Framework | [SvelteKit 5](https://svelte.dev/) + TypeScript | |
24 | | -| Styling | CSS variables (dark/light theme) | |
25 | | -| Auth | GitHub & Google OAuth | |
26 | | -| Database | Cloudflare D1 (SQLite) | |
27 | | -| Hosting | Cloudflare Workers + Pages | |
| 21 | +## Stack |
28 | 22 |
|
29 | | -## Development |
| 23 | +SvelteKit 5 + TypeScript, Cloudflare Workers + D1 (SQLite), GitHub/Google OAuth. |
| 24 | + |
| 25 | +## Running Locally |
30 | 26 |
|
31 | 27 | ```bash |
32 | 28 | npm install |
33 | | - |
34 | | -# Apply all migrations automatically |
35 | | -wrangler d1 migrations apply openboot --local |
36 | | - |
| 29 | +wrangler d1 migrations apply openboot --local # Sets up DB |
37 | 30 | npm run dev |
38 | 31 | ``` |
39 | 32 |
|
40 | | -Create a `.dev.vars` file: |
| 33 | +Create `.dev.vars` with your OAuth credentials: |
41 | 34 |
|
42 | 35 | ``` |
43 | | -GITHUB_CLIENT_ID=your_github_client_id |
44 | | -GITHUB_CLIENT_SECRET=your_github_client_secret |
| 36 | +GITHUB_CLIENT_ID=... |
| 37 | +GITHUB_CLIENT_SECRET=... |
| 38 | +GOOGLE_CLIENT_ID=... |
| 39 | +GOOGLE_CLIENT_SECRET=... |
45 | 40 | ``` |
46 | 41 |
|
47 | 42 | ## Deployment |
48 | 43 |
|
49 | | -Automatic on push to `main` via GitHub Actions. |
| 44 | +Push to `main` and GitHub Actions deploys to Cloudflare. Runs migrations before deploying code. |
50 | 45 |
|
51 | | -```bash |
52 | | -npm run build |
53 | | -wrangler deploy |
54 | | -``` |
| 46 | +Secrets needed: `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` |
55 | 47 |
|
56 | | -GitHub repository secrets required: `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` |
57 | | - |
58 | | -## API Endpoints |
59 | | - |
60 | | -### Install Scripts |
61 | | - |
62 | | -| Endpoint | Description | |
63 | | -|----------|-------------| |
64 | | -| `GET /install` | Default install script | |
65 | | -| `GET /:alias` | Install script for short alias | |
66 | | -| `GET /:username/:slug/install` | Install script for specific config | |
67 | | -| `GET /:username/:slug/config` | Config JSON for CLI consumption | |
68 | | - |
69 | | -### Auth |
70 | | - |
71 | | -| Endpoint | Description | |
72 | | -|----------|-------------| |
73 | | -| `GET /api/auth/login` | GitHub/Google OAuth login redirect | |
74 | | -| `GET /api/auth/callback/github` | GitHub OAuth callback | |
75 | | -| `GET /api/auth/callback/google` | Google OAuth callback | |
76 | | -| `GET /api/auth/logout` | Clear session | |
77 | | -| `POST /api/auth/cli/start` | Start CLI device auth flow | |
78 | | -| `POST /api/auth/cli/approve` | Approve CLI auth request | |
79 | | -| `GET /api/auth/cli/poll` | Poll CLI auth status | |
80 | | - |
81 | | -### Configs |
82 | | - |
83 | | -| Endpoint | Description | |
84 | | -|----------|-------------| |
85 | | -| `GET /api/user` | Current user info | |
86 | | -| `GET /api/configs` | List user's configs | |
87 | | -| `POST /api/configs` | Create config | |
88 | | -| `GET /api/configs/:slug` | Get config by slug | |
89 | | -| `PUT /api/configs/:slug` | Update config | |
90 | | -| `DELETE /api/configs/:slug` | Delete config | |
91 | | -| `POST /api/configs/from-snapshot` | Create config from CLI snapshot | |
92 | | - |
93 | | -### Utilities |
94 | | - |
95 | | -| Endpoint | Description | |
96 | | -|----------|-------------| |
97 | | -| `POST /api/brewfile/parse` | Parse Brewfile content into packages | |
98 | | -| `GET /api/homebrew/search?q=` | Search Homebrew packages | |
99 | | -| `GET /api/npm/search?q=` | Search NPM packages | |
100 | | - |
101 | | -## Database Schema |
102 | | - |
103 | | -```sql |
104 | | -CREATE TABLE users ( |
105 | | - id TEXT PRIMARY KEY, |
106 | | - github_id TEXT UNIQUE, |
107 | | - username TEXT UNIQUE, |
108 | | - email TEXT, |
109 | | - avatar_url TEXT, |
110 | | - created_at TEXT |
111 | | -); |
112 | | - |
113 | | -CREATE TABLE configs ( |
114 | | - id TEXT PRIMARY KEY, |
115 | | - user_id TEXT, |
116 | | - slug TEXT, |
117 | | - name TEXT, |
118 | | - description TEXT, |
119 | | - base_preset TEXT, |
120 | | - packages TEXT, |
121 | | - custom_script TEXT, |
122 | | - dotfiles_repo TEXT, |
123 | | - snapshot TEXT, |
124 | | - alias TEXT UNIQUE, |
125 | | - visibility TEXT DEFAULT 'unlisted', |
126 | | - install_count INTEGER DEFAULT 0, |
127 | | - created_at TEXT, |
128 | | - updated_at TEXT |
129 | | -); |
130 | | -``` |
| 48 | +## Key Endpoints |
| 49 | + |
| 50 | +**Install scripts** (what the CLI curls): |
| 51 | +- `GET /:alias` — Short alias redirect or install script (curl-detected) |
| 52 | +- `GET /:username/:slug/install` — Config install script |
| 53 | +- `GET /:username/:slug/config` — Config JSON for CLI |
| 54 | + |
| 55 | +**Configs** (CRUD for dashboard): |
| 56 | +- `GET/POST /api/configs` — List/create |
| 57 | +- `GET/PUT/DELETE /api/configs/:slug` — Read/update/delete |
| 58 | +- `POST /api/configs/from-snapshot` — CLI snapshot upload |
| 59 | + |
| 60 | +**Auth**: |
| 61 | +- OAuth callbacks at `/api/auth/callback/{github,google}` |
| 62 | +- CLI device flow: `/api/auth/cli/{start,approve,poll}` |
| 63 | + |
| 64 | +**Utilities**: |
| 65 | +- `POST /api/brewfile/parse` — Brewfile → package list |
| 66 | +- `GET /api/homebrew/search?q=...` — Search Homebrew |
| 67 | +- `GET /api/npm/search?q=...` — Search NPM |
| 68 | + |
| 69 | +## Database |
| 70 | + |
| 71 | +D1 (SQLite). Two tables: `users` and `configs`. See `migrations/` for schema. Key fields: |
| 72 | + |
| 73 | +- `configs.packages` — JSON array of {name, type, desc} |
| 74 | +- `configs.snapshot` — JSON object from CLI `openboot snapshot` |
| 75 | +- `configs.visibility` — `public` | `unlisted` | `private` |
| 76 | +- `configs.alias` — short URL (e.g., `openboot.dev/dev` → redirects) |
131 | 77 |
|
132 | 78 | ## Related |
133 | 79 |
|
|
0 commit comments