|
1 | | -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). |
| 1 | +## Tournament Bracket (Static Next.js) |
2 | 2 |
|
3 | | -## Getting Started |
| 3 | +Aplikasi bracket tournament single-elimination berbasis Next.js (App Router), semua data disimpan lokal per device. |
4 | 4 |
|
5 | | -First, run the development server: |
| 5 | +Brand: **nextdraft** |
| 6 | + |
| 7 | +### Fitur Utama |
| 8 | +- Generate bracket otomatis dari daftar tim (dengan dukungan bye). |
| 9 | +- Input skor per match, pemenang maju otomatis ke ronde berikutnya. |
| 10 | +- Persist state lokal menggunakan `zustand` + `localStorage`. |
| 11 | +- Export/Import state JSON. |
| 12 | +- Share state via URL terkompresi (`?s=...`). |
| 13 | +- Reset tournament lokal. |
| 14 | + |
| 15 | +### Menjalankan Project |
| 16 | + |
| 17 | +1. Install dependencies: |
| 18 | + |
| 19 | +```bash |
| 20 | +npm install |
| 21 | +``` |
| 22 | + |
| 23 | +2. Buat file env lokal dari template: |
| 24 | + |
| 25 | +```bash |
| 26 | +cp .env.example .env.local |
| 27 | +``` |
| 28 | + |
| 29 | +3. Jalankan development server: |
6 | 30 |
|
7 | 31 | ```bash |
8 | 32 | npm run dev |
9 | | -# or |
10 | | -yarn dev |
11 | | -# or |
12 | | -pnpm dev |
13 | | -# or |
14 | | -bun dev |
15 | 33 | ``` |
16 | 34 |
|
17 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 35 | +Open [http://localhost:3000](http://localhost:3000). |
18 | 36 |
|
19 | | -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. |
| 37 | +### Scripts |
| 38 | + |
| 39 | +```bash |
| 40 | +npm run dev |
| 41 | +npm run lint |
| 42 | +npm test |
| 43 | +npm run build |
| 44 | +``` |
20 | 45 |
|
21 | | -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
| 46 | +### Build Static |
22 | 47 |
|
23 | | -## Learn More |
| 48 | +```bash |
| 49 | +npm run build |
| 50 | +``` |
24 | 51 |
|
25 | | -To learn more about Next.js, take a look at the following resources: |
| 52 | +Build saat ini menghasilkan route static (`/`). |
26 | 53 |
|
27 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
28 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 54 | +### Struktur Inti |
| 55 | +- `app/page.tsx`: UI create tournament + bracket board. |
| 56 | +- `store/tournamentStore.ts`: state management + persistence. |
| 57 | +- `lib/bracket.ts`: algoritma generate/update/propagate bracket. |
| 58 | +- `lib/share.ts`: encode/decode state untuk URL. |
29 | 59 |
|
30 | | -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
| 60 | +### Catatan |
| 61 | +- Penyimpanan lokal berarti data tidak sync antar device. |
| 62 | +- Untuk share antar device/user, gunakan fitur Share URL atau Export/Import JSON. |
31 | 63 |
|
32 | | -## Deploy on Vercel |
| 64 | +### GitHub Ready |
| 65 | +- CI GitHub Actions tersedia di `.github/workflows/ci.yml` (lint, test, build). |
| 66 | +- Issue template tersedia di `.github/ISSUE_TEMPLATE/`. |
| 67 | +- PR template tersedia di `.github/pull_request_template.md`. |
| 68 | +- Template environment tersedia di `.env.example`. |
33 | 69 |
|
34 | | -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
| 70 | +### Kontribusi |
| 71 | +1. Fork repository |
| 72 | +2. Buat branch fitur/perbaikan |
| 73 | +3. Pastikan `npm run lint`, `npm test`, dan `npm run build` lolos |
| 74 | +4. Buat Pull Request |
35 | 75 |
|
36 | | -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
|
0 commit comments