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
16 changes: 2 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
# Logs
logs
*.log
npm-debug.log*

# NPM
node_modules/*
# Dependencies
node_modules/

# Build output
dist/
.astro/

# logs
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# Just in case somebody runs the wrong command
yarn.lock
package-lock.json
tsconfig.tsbuildinfo
bun.lockb

# Mac shit
.DS_Store
Expand Down
45 changes: 17 additions & 28 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,44 +10,35 @@ moq.dev is a web blog and demo for Media over QUIC (MoQ) protocol. It's built wi

```bash
# Development
npm run dev # Start dev server with auto-open and HTTPS
just dev # Start dev server with auto-open

# Build & Production
npm run build # Production build
npm run prod # Build and preview production
# Build & Deploy
just build # Production build
just deploy # Deploy to Cloudflare Pages (staging by default)
just deploy live # Deploy to production
just prod # Build and preview production locally

# Code Quality
npm run check # Run Biome linting and TypeScript checking
npm run fix # Auto-fix code issues and audit dependencies
just check # Run Biome linting and TypeScript checking
just fix # Auto-fix code formatting/lint issues
```

## Architecture Overview

### Technology Stack
- **Framework**: Astro with SSR via Node.js adapter
- **Framework**: Astro (static output)
- **UI Components**: Solid.js for interactive elements
- **Styling**: Tailwind CSS
- **Build**: Vite with WASM and mkcert plugins
- **Build**: Vite
- **Code Quality**: Biome for linting/formatting
- **Package Manager**: bun v1.3.4
- **Task Runner**: just

### Key Components

1. **MoQ Client Implementation** (`@kixelated/hang` package):
- Custom web components: `<hang-publish>`, `<hang-watch>`, `<hang-support>`
- WebTransport protocol for relay connections
- Publishing: `src/components/publish.tsx` - Creates broadcasts with random names
- Watching: `src/components/watch.tsx` - Connects to broadcasts by name

2. **Routing Structure**:
- `/publish` - Create new broadcasts
- `/watch/{name}` - View specific broadcast
- `/blog/` - MDX-based blog posts
- Dynamic routes use `export const prerender = false` for SSR

3. **Environment Configuration**:
- `PUBLIC_RELAY_URL` - WebTransport URL
- Separate `.env` files for dev/production
**MoQ Client Implementation** (`@moq/publish` + `@moq/watch` packages):
- Custom web components: `<moq-publish>`, `<moq-watch>`
- UI wrapper components: `<moq-publish-ui>`, `<moq-watch-ui>`

### Important Patterns

Expand All @@ -59,14 +50,12 @@ npm run fix # Auto-fix code issues and audit dependencies

### Deployment

- Docker multi-stage builds
- Terraform infrastructure in `/infra/`
- Production entry: `dist/server/entry.mjs`
- Cloudflare Pages via Wrangler
- `just deploy` for staging, `just deploy live` for production

## Development Tips

- WebTransport requires HTTPS even in development (handled by vite-plugin-mkcert)
- Broadcasts are ephemeral - no persistence layer
- The `@kixelated/hang` package handles all MoQ protocol implementation
- The `@moq/publish` and `@moq/watch` packages handle all MoQ protocol implementation
- For new blog posts, add MDX files to `src/pages/blog/`
- Component changes in `src/components/` automatically reload with HMR
8 changes: 3 additions & 5 deletions astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export default defineConfig({
fs: {
allow: [
".",
// Allow `npm link @kixelated/hang`
fs.realpathSync(path.resolve("node_modules/@kixelated/hang")),
// Allow `npm link @moq/*`
fs.realpathSync(path.resolve("node_modules/@moq/publish")),
fs.realpathSync(path.resolve("node_modules/@moq/watch")),
],
},
},
Expand All @@ -36,8 +37,5 @@ export default defineConfig({
"@": "/src",
},
},
optimizeDeps: {
exclude: ["@kixelated/hang"],
},
},
});
35 changes: 34 additions & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.0.5/schema.json",
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
"vcs": {
"enabled": true,
"clientKind": "git",
Expand All @@ -18,6 +18,14 @@
"enabled": true,
"rules": {
"recommended": true,
"suspicious": {
"noUnknownAtRules": {
"level": "error",
"options": {
"ignore": ["tailwind"]
}
}
},
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
Expand All @@ -32,9 +40,34 @@
}
}
},
"css": {
"parser": {
"tailwindDirectives": true
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"overrides": [
{
"includes": ["**/*.astro"],
"linter": {
"rules": {
"style": {
"useConst": "off",
"useImportType": "off"
},
"correctness": {
"noUnusedVariables": "off",
"noUnusedImports": "off"
}
}
}
}
],
"html": {
"experimentalFullSupportEnabled": true
}
}
Loading