@vatvaghool/create-ipl-dashboard 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  Scaffold a full-featured IPL fantasy cricket dashboard in seconds.
4
4
 
5
5
  ```bash
6
- npx create-ipl-dashboard my-league
6
+ npx @vatvaghool/create-ipl-dashboard my-league
7
7
  ```
8
8
 
9
9
  Follow the prompts to enter your MongoDB URI, fantasy league URL, and team names — then get a ready-to-run Next.js dashboard with standings charts, performance trackers, AI roasts, and more.
@@ -11,7 +11,7 @@ Follow the prompts to enter your MongoDB URI, fantasy league URL, and team names
11
11
  ## Usage
12
12
 
13
13
  ```bash
14
- npx create-ipl-dashboard [project-name] [options]
14
+ npx @vatvaghool/create-ipl-dashboard [project-name] [options]
15
15
  ```
16
16
 
17
17
  ### Options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vatvaghool/create-ipl-dashboard",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Scaffold an IPL fantasy cricket dashboard project",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,4 +1,4 @@
1
- import { cp, readFile, writeFile, mkdir } from "node:fs/promises";
1
+ import { cp, mkdir } from "node:fs/promises";
2
2
  import { existsSync } from "node:fs";
3
3
  import { join, dirname, relative } from "node:path";
4
4
  import { fileURLToPath } from "node:url";
@@ -23,17 +23,28 @@ const SKIP_PATTERNS = [
23
23
  "tsconfig.tsbuildinfo",
24
24
  ];
25
25
 
26
-
27
26
  async function getAllFiles(dir) {
28
27
  const entries = [];
28
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
29
29
  const { readdir, stat } = await import("node:fs/promises");
30
30
  async function walk(current) {
31
31
  const items = await readdir(current, { withFileTypes: true });
32
32
  for (const item of items) {
33
33
  const full = join(current, item.name);
34
34
  const rel = relative(MONOREPO_ROOT, full);
35
- if (SKIP_PATTERNS.some((p) => rel === p || rel.startsWith(p + "/") || item.name === p)) continue;
36
- if (item.name.startsWith(".") && item.name !== ".env.example" && item.name !== ".dockerignore" && item.name !== ".gitignore") continue;
35
+ if (
36
+ SKIP_PATTERNS.some(
37
+ (p) => rel === p || rel.startsWith(p + "/") || item.name === p,
38
+ )
39
+ )
40
+ continue;
41
+ if (
42
+ item.name.startsWith(".") &&
43
+ item.name !== ".env.example" &&
44
+ item.name !== ".dockerignore" &&
45
+ item.name !== ".gitignore"
46
+ )
47
+ continue;
37
48
  if (item.isDirectory()) {
38
49
  await walk(full);
39
50
  } else {
@@ -2,26 +2,13 @@
2
2
 
3
3
  Private Next.js dashboard for an IPL fantasy league. Combines seeded match history with live leaderboard snapshots to show standings, match-by-match movement, captain picks, cumulative trends, and league insights in one place.
4
4
 
5
- ## Screenshots
6
-
7
- <!-- TODO: Add screenshots -->
8
- | Dashboard Overview | Performance Tracker |
9
- |:---:|:---:|
10
- | ![](./screenshots/dashboard-overview.png) | ![](./screenshots/performance-tracker.png) |
11
-
12
- | Captain Board | Ledger Table |
13
- |:---:|:---:|
14
- | ![](./screenshots/captain-board.png) | ![](./screenshots/ledger-table.png) |
15
-
16
- | Match Scrubber | AI Roasting |
17
- |:---:|:---:|
18
- | ![](./screenshots/match-scrubber.png) | ![](./screenshots/ai-roasting.png) |
19
-
20
- ---
21
-
22
5
  ## Quick Start
23
6
 
24
7
  ```bash
8
+ # Scaffold a new project
9
+ npx @vatvaghool/create-ipl-dashboard my-league
10
+
11
+ # Or from source:
25
12
  npm install
26
13
  ```
27
14
 
@@ -43,6 +30,22 @@ Open http://localhost:3000
43
30
 
44
31
  ---
45
32
 
33
+ ## Screenshots
34
+
35
+ | Dashboard Overview | Performance Tracker |
36
+ |:---:|:---:|
37
+ | ![](./screenshots/dashboard-overview.png) | ![](./screenshots/performance-tracker.png) |
38
+
39
+ | Captain Board | Ledger Table |
40
+ |:---:|:---:|
41
+ | ![](./screenshots/captain-board.png) | ![](./screenshots/ledger-table.png) |
42
+
43
+ | Match Scrubber | AI Roasting |
44
+ |:---:|:---:|
45
+ | ![](./screenshots/match-scrubber.png) | ![](./screenshots/ai-roasting.png) |
46
+
47
+ ---
48
+
46
49
  ## Components
47
50
 
48
51
  ### Dashboard Sections
@@ -147,6 +150,54 @@ Also supports a browser bookmarklet — visit `/api/ipl/bookmarklet` while the a
147
150
 
148
151
  ---
149
152
 
153
+ ## Deployment
154
+
155
+ ### Deploy to Vercel (recommended)
156
+
157
+ ```bash
158
+ # Build the app
159
+ npm run build
160
+
161
+ # Deploy to Vercel
162
+ npx vercel --prod
163
+ ```
164
+
165
+ Set these environment variables in your Vercel project dashboard:
166
+
167
+ | Variable | Required | Description |
168
+ |----------|----------|-------------|
169
+ | `MONGODB_URI` | Yes | MongoDB connection string |
170
+ | `IPL_POST_SECRET` | Yes | Bearer token protecting write endpoints |
171
+ | `IPL_LEAGUE_URL` | Yes | Your fantasy league page URL |
172
+ | `IPL_DASHBOARD_STALE_MINUTES` | No | Staleness threshold for health checks (default: `20`) |
173
+ | `IPL_TRANSFERS_STALE_MINUTES` | No | Transfer staleness threshold (default: `720`) |
174
+
175
+ After deployment:
176
+
177
+ 1. Verify the app is healthy — visit `https://your-app.vercel.app/api/ops/status`
178
+ 2. Run the Playwright scraper (`npm run sync:cloud`) pointed at your production URL to populate live data
179
+ 3. Optionally deploy the scraper as a Cloud Run Job with `Dockerfile.sync` for automated sync every 5-10 minutes
180
+
181
+ ### Without Vercel
182
+
183
+ ```bash
184
+ # Build
185
+ npm run build
186
+
187
+ # Start production server
188
+ npm start
189
+ ```
190
+
191
+ The app runs as a standard Node.js server on `process.env.PORT` (default `3000`).
192
+
193
+ ### Production requirements
194
+
195
+ - **MongoDB** is required in production for POST endpoints (returns `503` without it)
196
+ - **IPL_POST_SECRET** should be a strong random value set in your hosting environment
197
+ - The scraper should run outside the web app (Cloud Run, GitHub Actions, cron) — never in the same process
198
+
199
+ ---
200
+
150
201
  ## Stack
151
202
 
152
203
  - **Next.js** 16 App Router