- PHP 52.6%
- Vue 38.6%
- TypeScript 7.1%
- Nix 1%
- Blade 0.5%
- Other 0.2%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .vscode | ||
| app | ||
| bootstrap | ||
| config | ||
| database | ||
| docs | ||
| public | ||
| resources | ||
| routes | ||
| storage | ||
| tests | ||
| .editorconfig | ||
| .env.example | ||
| .envrc | ||
| .gitattributes | ||
| .gitignore | ||
| .oxlintrc.json | ||
| .prettierrc.json | ||
| artisan | ||
| bun.lock | ||
| Cahier des charges — Site du tournoi GreenTN.md | ||
| components.json | ||
| composer.json | ||
| composer.lock | ||
| devenv.lock | ||
| devenv.nix | ||
| devenv.yaml | ||
| env.d.ts | ||
| eslint.config.ts | ||
| Logo_BDS2.png | ||
| logogreen.png | ||
| package.json | ||
| phpunit.xml | ||
| pint.json | ||
| README.md | ||
| tsconfig.app.json | ||
| tsconfig.json | ||
| tsconfig.node.json | ||
| tsconfig.vitest.json | ||
| uno.config.ts | ||
| vite.config.ts | ||
| vitest.config.ts | ||
GreenTN
Site du tournoi de volley GreenTN (32 équipes) — interface publique mobile-first et back-office. Implémente le cahier des charges.
A single Laravel 13 app (PHP 8.4, SQLite) rendering Vue 3 pages with Inertia v3 — TypeScript, shadcn-vue, UnoCSS, bun. No separate API: pages get their data as props.
app/Tournament/ |
Tournament rules: phases, Brassage 2 algorithm, brackets, standings |
app/Http/Controllers/ |
Inertia pages + admin actions |
resources/js/Pages/ |
Vue pages (Public/*, Admin/*) |
docs/PAGES.md |
Routes, page props and admin actions |
Démarrage
Requires Nix + devenv. Everything else (PHP, Composer, Node, bun, SQLite) comes from devenv.nix.
devenv shell # or `direnv allow` to auto-activate
setup # composer + bun install, .env, migrate & seed, storage link
devenv up # Laravel on :8000 + Vite
Open http://127.0.0.1:8000 — back-office at /admin (admin@greentn.local / greentn,
set ADMIN_EMAIL / ADMIN_PASSWORD in .env then reset-db).
The home page image is uploaded from Réglages to storage/app/public. When deploying, run
php artisan storage:link, keep APP_URL right and allow 8 MB uploads in PHP
(upload_max_filesize = 8M, post_max_size = 10M).
Other shell commands: reset-db, test-all, vscode-extensions (installs .vscode/extensions.json).
To click through a whole tournament quickly, fill in random scores for a phase:
php artisan tournament:fill-scores brassage1 # brassage2, principal, consolante
Déroulé
setup → brassage1 → brassage2 → finals → finished, each step gated in
app/Tournament/TournamentManager.php:
- Équipes — rename the 32 seeded teams (only before Brassage 1 is validated).
- Brassage 1 — random draw (groups of 4 on terrains 3 and 4), manual edits, validation (32 teams, no duplicates, 8×3 + 2×4). Validation creates the round-robin matches.
- Brassage 2 — enabled once every Brassage 1 match is played; composition generated by
app/Tournament/Brassage2Generator.php, never editable. - Principal / Consolante — general ranking (wins → goal average → tirage au sort), top 16 → Principal (places 1–16), others → Consolante (17–32). Each tableau has 15 public matches plus 17 placement matches (admin only) so every team gets a unique place.
- Finir le tournoi — freezes all scores and publishes the final ranking 1–32.
Réinitialiser le tournoi (dashboard) goes back to setup from any step: groups, matches and
scores are deleted, team names and settings are kept.
Interprétations du cahier des charges
- §7 Brassage 2 — the spec lists 10 initial columns and then calls the empty construction
columns "10, 11, 12". The only reading that places all 32 teams in 8×3 + 2×4 is that they are
the 11th–13th columns; see the docblock in
Brassage2Generator.phpandtests/Unit/Brassage2GeneratorTest.phpfor the exact resulting groups. - §10 General ranking — only Brassage 2 results count to split the teams between the Principal and the Consolante.
- Ties — the same rule is used in every table: wins, goal average, then a random draw fixed
once per team (
teams.tiebreak), so ties always break the same way. - Finals generation — an admin button, rather than triggered by the last Brassage 2 score, so a mistyped score can still be corrected first.
- Score corrections — allowed while the stage is open and the downstream match hasn't been played yet.
Tests
test-all # everything
php artisan test # algorithm, rules, a full 32-team tournament through the pages