Contributing Guide
How to contribute to Yume Tools development.
Getting Started
- Fork the repository
- Clone your fork
- Create a feature branch from
dev - Make your changes
- Submit a pull request to
dev
# Clone
git clone https://github.com/your-username/webpage.git
cd webpage
# Create feature branch
git checkout dev
git checkout -b feature/your-feature
Code Style
TypeScript/JavaScript
- Use TypeScript for new code
- ESLint configuration provided
- Prettier for formatting
# Lint
npm run lint
# Format
npm run format
React Components
// Use functional components with hooks
export function MyComponent({ prop }: MyComponentProps) {
const [state, setState] = useState<string>('');
return (
<div className="my-class">
{/* JSX */}
</div>
);
}
CSS/Styling
- Use Tailwind CSS
- shadcn/ui for component library
- Custom CSS in
index.csswhen needed
// Prefer Tailwind classes
<div className="flex items-center gap-4 p-4 rounded-lg bg-card">
// Use cn() for conditional classes
<div className={cn(
"base-class",
isActive && "active-class"
)}>
Commit Messages
Follow conventional commits:
type(scope): description
feat(auth): add Discord role sync
fix(bingo): correct point calculation
docs(api): update authentication docs
refactor(events): simplify submission handler
Types
| Type | Description |
|---|---|
feat | New feature |
fix | Bug fix |
docs | Documentation |
refactor | Code refactoring |
test | Adding tests |
chore | Maintenance |
Pull Requests
PR Checklist
- Branch created from
dev - Code follows style guide
- Tests pass (if applicable)
- Documentation updated
- Descriptive PR title and description
PR Template
## Description
Brief description of changes
## Type of Change
- [ ] New feature
- [ ] Bug fix
- [ ] Documentation
- [ ] Refactoring
## Testing
How was this tested?
## Screenshots (if applicable)
Review Process
- Submit PR to
devbranch - Automated checks run
- Code review by maintainer
- Address feedback
- Merge when approved
Project Structure
Frontend Projects
emuy-pages/
├── src/
│ ├── components/ # Reusable components
│ │ └── ui/ # shadcn/ui components
│ ├── contexts/ # React contexts
│ ├── hooks/ # Custom hooks
│ ├── lib/ # Utilities, API config
│ ├── pages/ # Page components
│ └── main.tsx # Entry point
├── public/ # Static assets
└── index.html
Worker Projects
auth-api/
├── src/
│ └── index.js # Worker entry point
├── schema.sql # Database schema
├── wrangler.jsonc # Cloudflare config
└── package.json
Adding Features
New Page (Frontend)
- Create component in
src/pages/ - Add route in
App.tsx - Add navigation link in
Layout.tsx - Update permissions if needed
New API Endpoint (Worker)
- Add handler in
src/index.js - Update schema if needed
- Document in
docs-pages - Test locally with Wrangler
New Permission
- Add to
rbac_permissionstable - Add to relevant roles
- Implement checks in code
- Document in permissions guide
Testing
Local Testing
# Frontend
npm run dev
# Open http://localhost:5173
# Worker
npx wrangler dev
# API at http://localhost:8787
Testing Auth
- Use Discord Developer Portal test app
- Configure local redirect URIs
- Test full OAuth flow
Testing with Production Data
warning
Never test with real user data locally. Use mock data.
Documentation
Documentation lives in docs-pages/docs/:
cd docs-pages
npm run dev
# Opens http://localhost:4000
Adding New Docs
- Create
.mdfile in appropriate folder - Add frontmatter with id, title, sidebar_position
- Add to
sidebars.jsif needed - Test locally
Getting Help
- Discord: Join our server for questions
- GitHub Issues: Bug reports and feature requests
- Code Review: Ask for feedback in PRs
Code of Conduct
- Be respectful and inclusive
- Provide constructive feedback
- Help newcomers get started
- Keep discussions technical and on-topic