···11+# CRUSH.md
22+33+## Project Overview
44+55+This is a personal portfolio website built with Bun, React, TypeScript, and Tailwind CSS. It uses the shadcn/ui component library and serves as both a portfolio and development environment for AT Protocol-related projects. The project demonstrates modern web development practices with a focus on decentralized technologies.
66+77+## Development Commands
88+99+### Core Commands
1010+- `bun install` - Install dependencies
1111+- `bun dev` - Start development server with hot reload and HMR
1212+- `bun start` - Run production server
1313+- `bun run build.ts` - Build for production (outputs to `dist/`)
1414+- `bun run build.ts --help` - Show all build options
1515+1616+### Build System
1717+The custom build script (`build.ts`) supports various options:
1818+- `--outdir <path>` - Output directory (default: "dist")
1919+- `--minify` - Enable minification
2020+- `--sourcemap <type>` - Sourcemap type (none|linked|inline|external)
2121+- `--external <list>` - External packages (comma separated)
2222+2323+The build automatically:
2424+- Processes all HTML files in `src/` as entrypoints
2525+- Copies `public/` folder to dist
2626+- Uses Tailwind plugin for CSS processing
2727+- Includes linked sourcemaps by default
2828+2929+## Architecture
3030+3131+### Project Structure
3232+```
3333+src/
3434+├── components/
3535+│ ├── ui/ # shadcn/ui components (Button, Card, Input, etc.)
3636+│ ├── sections/ # Main page sections (Header, Work, Connect)
3737+│ └── ... # Other React components
3838+├── data/
3939+│ └── portfolio.ts # Portfolio content and metadata
4040+├── hooks/ # Custom React hooks
4141+├── lib/ # Utility functions
4242+└── styles/ # Global CSS and Tailwind config
4343+```
4444+4545+### Server Architecture
4646+- Uses Bun's built-in server (`src/index.ts`)
4747+- Serves React SPA with API routes
4848+- API routes use pattern matching (`/api/hello/:name`)
4949+- CORS headers configured for cross-origin requests
5050+- Development mode includes HMR and browser console echoing
5151+5252+### Key Files
5353+- `src/index.ts` - Server entry point with API routes
5454+- `src/App.tsx` - Main React component with intersection observer animations
5555+- `src/data/portfolio.ts` - All portfolio content (personal info, work experience, skills)
5656+- `build.ts` - Custom build script with extensive CLI options
5757+- `styles/globals.css` - Tailwind imports, CSS variables, and custom animations
5858+5959+## Code Conventions
6060+6161+### TypeScript Configuration
6262+- Strict mode enabled with `noUncheckedIndexedAccess`
6363+- Path aliases: `@/*` maps to `./src/*`
6464+- JSX: `react-jsx` transform
6565+- Module resolution: `bundler` mode
6666+- Target: `ESNext` with DOM libraries
6767+6868+### Component Patterns
6969+- Uses shadcn/ui component library with `class-variance-authority`
7070+- Utility function `cn()` combines `clsx` and `tailwind-merge`
7171+- Components follow Radix UI patterns for accessibility
7272+- File exports: Named exports for components, default for main App
7373+7474+### Styling
7575+- Tailwind CSS v4 with custom CSS variables
7676+- Dark theme by default with light mode support
7777+- Glassmorphism effects with custom utilities
7878+- Custom animations: `fade-in-up`, `bounce-slow`
7979+- Fira Code monospace font throughout
8080+8181+### Import Aliases (from components.json)
8282+```typescript
8383+"@/components" → "./src/components"
8484+"@/lib/utils" → "./src/lib/utils"
8585+"@/components/ui" → "./src/components/ui"
8686+"@/lib" → "./src/lib"
8787+"@/hooks" → "./src/hooks"
8888+```
8989+9090+## UI Components
9191+9292+### shadcn/ui Integration
9393+The project uses shadcn/ui with:
9494+- Style variant: "new-york"
9595+- Base color: "neutral"
9696+- Icon library: Lucide React
9797+- CSS variables enabled
9898+- Custom CSS location: `styles/globals.css`
9999+100100+### Available UI Components
101101+- Button (multiple variants: default, destructive, outline, secondary, ghost, link)
102102+- Card
103103+- Input
104104+- Label
105105+- Select
106106+- Textarea
107107+108108+### Custom Components
109109+- ThemeToggle (dark/light mode switching)
110110+- SectionNav (navigation between portfolio sections)
111111+- ProjectCard/WorkExperienceCard (portfolio item displays)
112112+- SocialLink (social media links with icons)
113113+114114+## Content Management
115115+116116+Portfolio data is centralized in `src/data/portfolio.ts`:
117117+- `personalInfo` - Name, title, description, availability, contact
118118+- `currentRole` - Current employment status
119119+- `skills` - Array of technical skills
120120+- `workExperience` - Array of work history with projects
121121+- `socialLinks` - Social media profiles
122122+- `sections` - Page section identifiers
123123+124124+The description format supports rich text with bold styling and URLs:
125125+```typescript
126126+type DescriptionPart = {
127127+ text: string
128128+ bold?: boolean
129129+ url?: string
130130+}
131131+```
132132+133133+## Deployment
134134+135135+### Netlify Configuration
136136+- Static site hosting
137137+- CORS headers configured in `public/netlify.toml`
138138+- AT Protocol DID file at `public/.well-known/atproto-did`
139139+140140+### Build Output
141141+- Production builds output to `dist/`
142142+- All HTML files in `src/` become entrypoints
143143+- Public assets copied automatically
144144+- Source maps linked for debugging
145145+146146+## Development Notes
147147+148148+### Hot Module Replacement
149149+- Development server includes HMR
150150+- Browser console logs echoed to server
151151+- Automatic reloading on file changes
152152+153153+### Performance Features
154154+- Intersection Observer for scroll-triggered animations
155155+- Code splitting support in build configuration
156156+- Minification enabled by default in production
157157+- Lazy loading with `react` imports
158158+159159+### AT Protocol Integration
160160+- Project showcases AT Protocol-related work
161161+- Uses `atproto-ui` component library
162162+- Bluesky and Tangled integration in portfolio
163163+164164+## Gotchas
165165+166166+### Build System
167167+- Custom build script requires Bun runtime (not Node.js)
168168+- HTML files in `src/` automatically become entrypoints
169169+- Must use `--external` flag for libraries that shouldn't be bundled
170170+171171+### Styling
172172+- Dark mode is default styling approach
173173+- CSS variables are used extensively for theming
174174+- Custom glassmorphism effects require SVG filters (defined in CSS)
175175+176176+### Server Routes
177177+- API routes use Bun's pattern matching syntax
178178+- All unmatched routes serve the main SPA (catch-all route)
179179+- CORS headers pre-configured for API access
180180+181181+### Content Structure
182182+- Portfolio content is TypeScript data, not markdown
183183+- Rich text descriptions use specific object structure
184184+- Projects support multiple links (live demo, GitHub, etc.)
+8-1
build.ts
···11#!/usr/bin/env bun
22import plugin from "bun-plugin-tailwind";
33import { existsSync } from "fs";
44-import { rm } from "fs/promises";
44+import { rm, cp } from "fs/promises";
55import path from "path";
6677if (process.argv.includes("--help") || process.argv.includes("-h")) {
···145145146146console.table(outputTable);
147147const buildTime = (end - start).toFixed(2);
148148+149149+// Copy public folder to dist
150150+const publicDir = path.join(process.cwd(), "public");
151151+if (existsSync(publicDir)) {
152152+ console.log("📁 Copying public folder to dist...");
153153+ await cp(publicDir, outdir, { recursive: true });
154154+}
148155149156console.log(`\n✅ Build completed in ${buildTime}ms\n`);