Important
Experimenting vibe-coding. I never checked anything regarding the code
BeyHub allows you to:
- Compare Beyblades: Select two beyblades and compare their stats side-by-side
- View Win Probability: See estimated win percentages based on stats
- Explore Stats: View detailed blade, ratchet, and bit statistics
- Compose Beyblades: Create custom beyblade combinations from available components
- Search-based beyblade selection with autocomplete (
Cmd+Kto open) - Side-by-side stat comparison with visual bars
- Custom beyblade composition with strategy presets (balanced, attack, defense, stamina)
- Light/Dark theme toggle (
Cmd+Dto switch) - Mobile-responsive design
- Expandable component details (Blade, Ratchet, Bit stats)
- Bun >= 1.x (latest LTS recommended)
- Git
-
Clone the repository:
git clone https://github.com/andreafspeziale/beyhub.git cd beyhub -
Install dependencies:
bun install
-
Start the development server:
bun run dev
-
Open your browser and navigate to
http://localhost:5173
| Script | Description |
|---|---|
bun run dev |
Start development server with hot reload |
bun run build |
Build for production |
bun run preview |
Preview production build locally |
bun run lint |
Run Biome linter |
bun run format |
Format code with Biome |
bun run check |
Run linter and formatter checks (used in pre-commit) |
bun test |
Run unit tests with Vitest |
bun run test:coverage |
Run tests with coverage report |
beyhub/
βββ public/
β βββ assets/beyblades/ # Beyblade images
β βββ data/
β βββ beyblades.json # Beyblade data
βββ src/
β βββ components/ # React components
β β βββ comparison/ # Comparison feature components
β β βββ compose/ # Compose feature components
β β βββ error/ # Error boundaries
β β βββ layout/ # Layout components (Header, Nav, ThemeToggle)
β β βββ ui/ # shadcn/ui components
β βββ hooks/ # Custom React hooks
β βββ pages/ # Page components
β βββ schemas/ # Zod validation schemas
β βββ types/ # TypeScript types
β βββ utils/ # Utility functions
β βββ App.tsx # Main app component
Beyblades are stored in /public/data/beyblades.json:
{
"beyblades": [
{
"id": "impact_drake_9_60LR",
"name": "Impact Drake 9-60LR",
"type": "Attack",
"bladeName": "Impact Drake",
"ratchetName": "9-60",
"bitName": "LR",
"blade": {
"attack": 75,
"defense": 25,
"stamina": 10
},
"ratchet": {
"attack": 13,
"defense": 10,
"stamina": 7,
"height": 60
},
"bit": {
"attack": 45,
"defense": 5,
"stamina": 15,
"dash": 35,
"burst": 80
},
"image": "/assets/beyblades/impact_drake_9_60LR.png"
}
]
}Via Pull Request (Recommended):
- Fork the repository
- Add entry to
public/data/beyblades.jsonfollowing the structure above - Use snake_case for
id(e.g.,beyblade_name_parts) - Provide all required stats as integers
- Add image to
/public/assets/beyblades/or use placeholder URL - Submit PR with clear description and source for stats
- Data validation runs automatically on app startup
This project uses strict code quality tools:
- Biome: Linting and formatting
- Import sorting by type
- Single quotes, semicolons required
- Line length: 100 characters
- TypeScript: Strict mode, no
anytypes allowed - Husky: Git hooks for automated checks
-
Create a new branch:
git checkout -b feat/your-feature-name
-
Make your changes following the code style
-
Run checks before committing:
bun run check
-
Commit using conventional commit format:
git commit -m "feat(scope): description"
Format: type(scope): description
Types:
feat: New featurefix: Bug fixdocs: Documentation changesstyle: Code style changesrefactor: Code refactoringtest: Test changeschore: Maintenance tasks
Examples:
git commit -m "feat(comparison): add win probability calculation"
git commit -m "fix(search): correct fuzzy matching logic"
git commit -m "docs(readme): update installation instructions"Husky automatically runs:
- Biome linter on staged files
- Biome formatter on staged files
- Commit message validation (commitlint)
If checks fail, fix the issues and commit again.
# Run all tests
bun test
# Run tests in watch mode
bun test --watch
# Run with coverage
bun test --coverageUnit tests cover:
- Win probability calculations
- Stat aggregation functions
- Search/filter functionality
Tests are located in __tests__ directories alongside source files.
- Runtime: Bun
- Framework: React 19 + TypeScript
- Build Tool: Vite
- Styling: Tailwind CSS v4 + shadcn/ui
- Validation: Zod
- Linting/Formatting: Biome
- Testing: Vitest
- Author - Andrea Francesco Speziale
- Beyblade Community - Beyblade Wiki
BeyHub is MIT licensed.
