Monorepo de la communauté Beyblade République Populaire du Beyblade — tournois, classements, gacha TCG, économie et duels.
| Surface | URL | Hébergement |
|---|---|---|
| Dashboard | rpbey.fr | VPS — nginx → rpbey-web.service (:3002) |
| CDN | cdn.rpbey.fr | VPS — nginx + rg-cdn.service (:8804) |
| API edge | api.rpbey.fr | VPS nginx → Cloud Run (bot + gacha) |
| Gacha Activity | play.rpbey.fr | VPS — nginx, SPA statique Vite |
| Bot Discord | — | Cloud Run europe-west3 |
| Base de données | — | Neon Postgres eu-central-1 |
| App | Package | Techno |
|---|---|---|
| Web | apps/web (@rose-griffon/dashboard) |
Next.js 16, App Router, standalone, better-auth, Drizzle |
| Bot | apps/bot (@rose-griffon/bot) |
discord.js v14, discordx, Skia |
| Gacha | apps/gacha-server |
Colyseus 0.17, BunWebSockets |
| Gacha client | apps/gacha-client |
Vite, PixiJS, Discord Activity SDK |
| CDN | apps/cdn |
Bun, uploads + assets statiques |
| DB | packages/db (@rpbey/db) |
Drizzle ORM, schéma partagé |
Runtime : Bun canary (lockfile v2). Orchestration : Turborepo.
- Bun canary (
bun upgrade --canary) - Accès GitHub Packages (
@aphrody-code/*,@rpbey/*) — token dans~/.npmrc - Variables d'env : copier
.env.example→.envà la racine et dansapps/web/
bun install
bun run dev:web # dashboard :3002
bun run dev:bot # bot DiscordRéinitialisation complète (caches, deps, build bot + web) :
bun scripts/reactivate-local.tsContrôles qualité :
bun run lint
bun run type-check
bun run test:ciTout se fait depuis le VPS (51.77.147.152, repo dans ~/rpbey).
cd ~/rpbey
git pull
bun scripts/deploy-infra.ts --webEnchaîne : bun run build (Next standalone) → scripts/deploy-web.sh → systemd rpbey-web.service → nginx.
bun scripts/deploy-infra.ts # tous les vhosts
bun scripts/deploy-infra.ts --only=cdn # un seul domaine
bun scripts/deploy-infra.ts --play # + rebuild gacha-clientConfigs versionnées dans infra/nginx/, unités systemd dans infra/systemd/.
Push sur main touchant apps/bot/** → workflow .github/workflows/deploy-bot.yml.
Déploiement manuel : voir commentaires dans le workflow.
Automatiques sur push main quand le schéma Drizzle change — workflow .github/workflows/deploy-web.yml (job migrate-prod).
Manuel :
cd packages/db && DIRECT_DATABASE_URL=... bunx drizzle-kit migrateTous les sous-domaines *.rpbey.fr doivent pointer vers le VPS :
| Record | Type | Cible |
|---|---|---|
@ (apex) |
A | 51.77.147.152 |
www |
A | 51.77.147.152 |
cdn, api, play |
A | 51.77.147.152 |
Script OVH (si la zone est gérée par l'API) :
bun scripts/ovh-dns-prod.ts # dry-run
bun scripts/ovh-dns-prod.ts --apply # appliqueSans certificat TLS valide, nginx sert un bootstrap HTTP pour rpbey.fr jusqu'à ce que Let's Encrypt réussisse.
| Workflow | Déclencheur | Rôle |
|---|---|---|
ci.yml |
push / PR | lint, type-check, tests |
deploy-web.yml |
push main (web) |
migrations Neon prod |
deploy-bot.yml |
push main (bot) |
Cloud Run prod |
cron-profile-sync.yml |
cron | sync profils Discord |
cron-staff-sync.yml |
cron | sync staff → Neon |
Le déploiement du site sur le VPS reste manuel sur le serveur (deploy-infra.ts --web) — pas de runner self-hosted configuré.
Index complet : docs/README.md.
Références utiles :
apps/
web/ # Dashboard Next.js (rpbey.fr)
bot/ # Bot Discord
gacha-server/ # Serveur Colyseus
gacha-client/ # Client Discord Activity
cdn/ # Assets & uploads
packages/
db/ # Schéma Drizzle + migrations
api-contract/ # Contrat Zod / OpenAPI
api-client/ # SDK généré
challonge/ # Scraper & intégration Challonge
infra/
nginx/ # Vhosts prod versionnés
systemd/ # Unités services VPS
scripts/
deploy-infra.ts # Déploiement nginx + certs + web
deploy-web.sh # Post-build standalone Next.js