Thank you for contributing to the Claude Code Leaderboard!
- Node.js 18 or later
- npm or pnpm
- Git
# Clone the repository
git clone https://github.com/jsell-rh/cc-leaderboard.git
cd cc-leaderboard
# Install dependencies
npm install
# Set up environment variables
cp web/.env.example web/.env- Go to https://github.com/settings/developers
- Create a new OAuth App
- Set callback URL to:
http://localhost:3000/api/auth/github - Add credentials to
web/.env:
NUXT_OAUTH_GITHUB_CLIENT_ID=your_client_id
NUXT_OAUTH_GITHUB_CLIENT_SECRET=your_client_secret
NUXT_JWT_SECRET=any-random-secret-for-dev
NUXT_PUBLIC_APP_URL=http://localhost:3000# Start web app (development mode with hot reload)
npm run dev:web
# In another terminal, start CLI in watch mode
npm run dev:cli
# Test CLI locally
cd cli && npm link
cc-leaderboard --helpcc-leaderboard/
├── cli/ # CLI tool
│ ├── src/
│ │ ├── commands/ # Command implementations
│ │ ├── api-client.ts # API client
│ │ ├── config.ts # Configuration management
│ │ └── index.ts # Entry point
│ └── package.json
├── web/ # Web application
│ ├── app/
│ │ ├── components/ # Vue components
│ │ ├── layouts/ # Layout components
│ │ ├── middleware/ # Route middleware
│ │ ├── pages/ # Page components
│ │ └── server/ # Server-side code
│ │ ├── api/ # API routes
│ │ ├── database/ # Database schema & client
│ │ ├── routes/ # OAuth routes
│ │ └── utils/ # Server utilities
│ ├── nuxt.config.ts # Nuxt configuration
│ └── package.json
└── deployment/ # Kubernetes manifests
We use ESLint and Prettier for code formatting:
# Lint code
npm run lint
# Format code
npm run format
# Type check
npm run typecheck# Run all tests
npm test
# Run web tests
npm test --workspace=web
# Run CLI tests
npm test --workspace=cli
# Run with coverage
npm test -- --coveragemain- Production-ready codefeature/*- New featuresfix/*- Bug fixesdocs/*- Documentation updates
We use conventional commits:
feat: add auto-submit scheduling
fix: resolve database connection issue
docs: update deployment guide
chore: update dependencies
test: add API endpoint tests
- Create a feature branch from
main - Make your changes
- Add tests for new functionality
- Update documentation if needed
- Run linting and tests locally
- Push and create a PR
- Wait for CI checks to pass
- Request review
- Create command file in
cli/src/commands/ - Implement the command logic
- Export the command function
- Add command to
cli/src/index.ts - Add tests
- Update CLI documentation
Example:
// cli/src/commands/mycommand.ts
import chalk from 'chalk'
export async function myCommand(options: any) {
console.log(chalk.green('Hello from my command!'))
}
// cli/src/index.ts
import { myCommand } from './commands/mycommand.js'
program.command('mycommand').description('Description of my command').action(myCommand)- Create route file in
web/app/server/api/ - Implement the endpoint handler
- Add validation with Zod
- Add authentication if needed
- Add tests
- Update API documentation
Example:
// web/app/server/api/myendpoint.get.ts
import { z } from 'zod'
const querySchema = z.object({
id: z.string(),
})
export default defineEventHandler(async (event) => {
const query = await getValidatedQuery(event, querySchema.parse)
// Your logic here
return { data: 'response' }
})- Create page file in
web/app/pages/ - Implement the Vue component
- Add to navigation if needed
- Update middleware if authentication required
Example:
<!-- web/app/pages/mypage.vue -->
<template>
<div>
<h1>My Page</h1>
</div>
</template>
<script setup lang="ts">
definePageMeta({
middleware: 'auth', // If authentication required
})
</script>We use Drizzle ORM. To create a migration:
cd web
npx drizzle-kit generate:sqlite --schema=app/server/database/schema.tsPlease report security vulnerabilities to [security contact]. Do not create public issues for security problems.
- Input validation on all endpoints
- Authentication required for sensitive operations
- Rate limiting on public endpoints
- SQL injection protection (use ORM)
- XSS prevention (Vue escapes by default)
- CSRF protection (handled by Nuxt)
- Secure headers (HTTPS, CSP, etc.)
- Use database indexes for frequently queried fields
- Implement caching where appropriate
- Minimize API calls in CLI
- Use lazy loading for components
- Optimize images and assets
When adding features, please update:
- README.md (if user-facing)
- DEPLOYMENT.md (if deployment-related)
- API documentation (for new endpoints)
- Code comments (for complex logic)
- Update version in package.json files
- Update CHANGELOG.md
- Create a git tag:
git tag v1.0.0 - Push tag:
git push origin v1.0.0 - Build and push Docker image
- Create GitHub release with notes
- Check existing issues
- Read the documentation
- Ask in discussions
- Reach out to maintainers
By contributing, you agree that your contributions will be licensed under the MIT License.