Open Source Bazaar is an open-source project showcase platform built with Next.js 15, TypeScript, React Bootstrap, and MobX. It includes license filters, Wiki knowledge base, volunteer showcase, Lark integration, and other features.
Always reference these instructions first and fallback to search or bash commands only when you encounter unexpected information that does not match the info here.
- Check Node.js version:
node --version - Development and linting commands work on Node.js 20+
- Use PNPM as package manager, not NPM or Yarn
- Install global pnpm:
npm install -g pnpm - Install dependencies:
pnpm install-- takes 1-3 minutes. NEVER CANCEL. Set timeout to 5+ minutes. - Verify setup:
pnpm --version(should be 10.x+)
Important: If you see "node_modules missing" error, you MUST run pnpm install first before any other commands.
- Start development server:
pnpm dev-- starts in 5-15 seconds on http://localhost:3000 - Run linting:
pnpm lint-- takes 15 seconds. NEVER CANCEL. Set timeout to 2+ minutes. - Run tests:
pnpm test-- runs lint-staged + lint, takes 15 seconds. Set timeout to 2+ minutes.
- Production build:
pnpm build-- works on Node.js 20+ (estimated 30s-2 minutes)- NEVER CANCEL. Set timeout to 5+ minutes.
- Static export: Available but not commonly used in development
After making ANY changes, ALWAYS validate by running through these scenarios:
- Start development server:
pnpm devand verify it starts without errors - Navigate to homepage: Visit http://localhost:3000 and verify page loads with navigation menu
- Test core pages:
- License filter: http://localhost:3000/license-filter (interactive license selection tool)
- Wiki pages: http://localhost:3000/wiki (policy documents from GitHub)
- Volunteer page: http://localhost:3000/volunteer (contributor showcase)
- Projects: http://localhost:3000/project (GitHub repository listings)
- Test API endpoints: Verify GitHub API integrations work
- Check responsive design: Test mobile/desktop layouts with React Bootstrap components
- Verify i18n functionality: Check Chinese/English language switching works
ALWAYS run before committing changes:
npm test # Runs linting + staged file checkspages/- Next.js pages and API routescomponents/- Reusable React components with Bootstrap stylingmodels/- MobX stores and data modelstranslation/- i18n language files (zh-CN, en-US, zh-TW)styles/- CSS and styling filespublic/- Static assets
package.json- Dependencies and scriptsnext.config.ts- Next.js configuration with MDX supporttsconfig.json- TypeScript configurationeslint.config.ts- ESLint configurationbabel.config.js- Babel configuration
- Next.js 15 - React framework
- React Bootstrap 2.10 - UI component library
- MobX 6.13 - State management
- MobX-GitHub 0.4 - GitHub API integration
- MobX-i18n 0.7 - Internationalization
- License-Filter 0.2 - License filtering functionality
- Marked 16.2 - Markdown processing
Based on comprehensive PR review analysis, follow these critical development standards:
- ALWAYS use React Bootstrap components instead of custom HTML elements
- Use utilities from established libraries: 'web-utility'
- Import
'./Base'in model files for proper configuration
- Natural error throwing for static generation - let errors bubble up to catch build issues
- Ensure build passes before pushing - resolve issues at compile time
// ✅ Correct - use React Bootstrap components
import { Button, Badge, Breadcrumb, Card, Container } from 'react-bootstrap';
<Button variant="outline-primary" size="sm" href={url} target="_blank">
{t('edit_on_github')}
</Button>
<Badge bg="secondary">{label}</Badge>
// ❌ Wrong - custom HTML elements
<a href={url} className="btn btn-outline-primary">Edit</a>
<span className="badge bg-secondary">{label}</span>- Use ordered lists (
<ol>) for countable items, unordered lists (<ul>) for navigation - Apply proper semantic structure:
<article>,<header>,<section> - Use
list-unstyledclass for first-level lists to remove default styling
- Use optional chaining and modern JavaScript features
- Let TypeScript infer types when possible to avoid verbose annotations
- Use modern ECMAScript patterns for cleaner, more maintainable code
- Import from established sources: ContentModel from mobx-github, utilities from web-utility
- Import configuration files where needed:
'./Base'for GitHub client setup - Use minimal exports and avoid unnecessary custom implementations
- Use configured clients rather than creating new ones
- ALL user-facing text MUST be translated using i18n system
- This includes button text, labels, error messages, placeholder text, and dynamic content
- Use the
t()function from I18nContext for all translations
- Use the
t()function from I18nContext for all user-facing text - Translate all button text, labels, error messages, and dynamic content
- Avoid hardcoded text in any language
- Use generic terms unless specifically scoped:
t('knowledge_base')nott('policy_documents') - Add translation keys to ALL language files:
zh-CN.ts,en-US.ts,zh-TW.ts - Remove unused translation keys when replacing with generic ones
- Use ContentModel with configured client from mobx-github
- Import configuration via
'./Base'to ensure proper GitHub client setup - Handle Base64 content decoding when processing GitHub API responses
- Use
treeFromutility from web-utility for hierarchical data structures - Follow established patterns for tree node organization and navigation
- Import configured
githubClientfrommodels/Base.ts
- GitHub API authentication is configured in
models/Base.ts - Use the configured client to avoid rate limiting and authentication issues
- Don't create separate GitHub API instances
- Run linting:
pnpm lintto auto-fix formatting - Check build: Ensure
pnpm buildpasses - Validate translations: Verify all text is properly translated
- Remove unused code: Clean up unused imports and translation keys
- Follow exact code suggestions from reviews when provided
- Use minimal approach - only include explicitly requested functionality
- Don't add extra features not specified in requirements
- Address reviewer feedback completely before requesting re-review
pnpm install # Install dependencies (1-3 minutes)
pnpm --version # Check pnpm versionpnpm dev # Start development server (5-15s)
pnpm build # Production build (30s-2min)
pnpm start # Start production serverpnpm lint # Run ESLint with auto-fix (15s)
pnpm test # Run tests (lint-staged + lint, 15s)- "Unsupported engine" warnings: Expected on Node.js <22, development still works
- Build hangs: Never cancel builds - they may take several minutes, set appropriate timeouts
- Missing dependencies: Always run
pnpm installfirst
- Custom HTML not working: Replace with React Bootstrap components
- Translation not showing: Ensure all text uses
t()function and keys exist in all language files - GitHub API errors: Verify you're using configured
githubClientfrommodels/Base.ts
- Base64 content errors: Use
atob(item.content)to decode GitHub API responses - Missing content: Check ContentModel configuration and repository access
- Tree structure problems: Use
treeFrom()utility from web-utility
- Clear browser cache if components don't render properly
- Restart development server after major configuration changes
- Verify all translation files are updated when adding new keys
- Uses GitHub ContentModel to access policy documents from
fpsig/open-source-policyrepository - Renders markdown content with front-matter metadata
- Supports hierarchical document structure with breadcrumb navigation
- Interactive multi-step license selection process
- Uses
license-filterpackage for license recommendation logic - Supports multiple languages with comprehensive i18n coverage
- Displays GitHub organization contributors
- Integrates with OSS Insight widgets for contributor analytics
- Uses GitHub API for real-time contributor data
Always prioritize these project-specific standards over generic Next.js or React guidance when working in this specific codebase.