Learn how to develop and work with the codebase.
Development Workflow
Starting the Dev Server
bun run devFeatures in development mode:
- Hot module replacement
- Fast refresh
- Error overlay
- Source maps
Previewing the Documentation Site
The separate Next.js/Fumadocs documentation app lives in docs/. From the repository root:
flox activate
bun install --cwd docs --frozen-lockfile
bun run docs:devOpen the local docs site.
Author Markdown in docs/src/ and update docs/navigation.json for new pages.
Regenerate MDX after edits with bun run --cwd docs generate:content.
The preview reloads when generated content changes. Run bun run docs:check
inside Flox to validate the full docs application. The root AGENTS.md requires
relevant documentation updates alongside code changes.
The docs app uses the actual set-me-up-docs shell and components with portfolio branding. See documentation architecture for content generation and deployment responsibilities.
Available Scripts
Development
bun run dev # Start dev server
bun run build # Build for production
bun run start # Start production serverCode Quality
bun run lint # Run ESLint
bun run format # Format with Prettier
bun run format:check # Check formattingTesting
bun run test # Run tests (watch mode)
bun run test:run # Run tests once
bun run test:watch # Watch mode
bun run test:coverage # Generate coverage reportBuild Scripts
bun run download:images:unsplash # Download Unsplash images
bun run prepare-chatbot-data # Prepare chatbot training dataCode Organization
Components
Components are organized by domain:
chat/- Chatbot widget and dynamic loadergallery/- VSCO and featured galleryhome/- Homepage sections (bio, social, Gumroad)layout/- SiteNav, BottomNav, CommandPalette, SmoothScrollmdx/- Table, YouTubeEmbed for MDX contentnotes/- Article pages, note list, related articlesprojects/- Project list, filter bar, open sourceui/- Shared primitives (ImagePreview, UniversalImage)
Hooks
Custom hooks in src/hooks/:
use-views.ts- Page view trackinguse-gumroad-products.ts- Gumroad product fetchinguse-vsco-gallery.ts- VSCO gallery datause-infinite-vsco-gallery.ts- Paginated VSCO gallery
Lib
Library code grouped by feature:
animation/- Framer Motion variants and configcontent/- MDX parsing with gray-matterimage/- Unsplash image resolution and attributionprojects/- Project config and icon componentsog.ts- OG image URL generationvsco-local.ts- Local VSCO export reader
Best Practices
Code Style
- Use TypeScript for all new code
- Follow existing patterns in the codebase
- Use kebab-case for file names
- Export named functions/components
Performance
- Use React Server Components where possible
- Implement proper loading states
- Optimize images with Next.js Image
- Use dynamic imports for heavy components
Testing
- Write tests for new features
- Maintain test coverage above 80%
- Test edge cases and error states
- Use Testing Library best practices
Nicholas Adamou