nextjs-hackathon-stack 0.1.27 → 0.1.28
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 +24 -35
- package/package.json +1 -1
- package/template/README.md +23 -17
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# nextjs-hackathon-stack
|
|
2
2
|
|
|
3
|
-
> Scaffold a full-stack Next.js
|
|
3
|
+
> Scaffold a full-stack Next.js hackathon starter in one command.
|
|
4
4
|
|
|
5
5
|
```bash
|
|
6
6
|
npx nextjs-hackathon-stack my-app
|
|
@@ -10,68 +10,57 @@ npx nextjs-hackathon-stack my-app
|
|
|
10
10
|
|
|
11
11
|
| Layer | Tool |
|
|
12
12
|
|---|---|
|
|
13
|
-
| Framework | Next.js
|
|
13
|
+
| Framework | Next.js 16 + App Router |
|
|
14
14
|
| Database | Supabase (PostgreSQL) |
|
|
15
15
|
| Auth | Supabase Auth (`@supabase/ssr`) |
|
|
16
16
|
| ORM | Drizzle + drizzle-zod (schema + migrations) |
|
|
17
17
|
| Runtime Queries | supabase-js (RLS active) |
|
|
18
18
|
| Client State | TanStack Query v5 |
|
|
19
|
-
| Validation | Zod (auto-generated via drizzle-zod) |
|
|
20
19
|
| Forms | React Hook Form + Zod resolver |
|
|
21
20
|
| UI | shadcn/ui + Tailwind CSS v4 |
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
21
|
+
| Testing | Vitest + Playwright (100% coverage enforced) |
|
|
22
|
+
| Code Quality | ESLint 9 + Husky + lint-staged |
|
|
23
|
+
| AI Tooling | Cursor rules/agents/skills + Claude Code instructions |
|
|
25
24
|
|
|
26
25
|
## Quick start
|
|
27
26
|
|
|
28
27
|
```bash
|
|
29
|
-
# Create project
|
|
30
28
|
npx nextjs-hackathon-stack my-app
|
|
31
29
|
cd my-app
|
|
32
30
|
|
|
33
|
-
# .env.local
|
|
31
|
+
# Fill in .env.local (created automatically):
|
|
34
32
|
# NEXT_PUBLIC_SUPABASE_URL → supabase.com > Project Settings > API
|
|
35
33
|
# NEXT_PUBLIC_SUPABASE_ANON_KEY → supabase.com > Project Settings > API
|
|
36
34
|
# DATABASE_URL → supabase.com > Project Settings > Database
|
|
37
|
-
# AI_GATEWAY_URL → vercel.com > AI > Gateways
|
|
38
35
|
|
|
39
|
-
|
|
36
|
+
pnpm db:migrate
|
|
37
|
+
pnpm dev
|
|
40
38
|
```
|
|
41
39
|
|
|
42
40
|
## Options
|
|
43
41
|
|
|
44
|
-
|
|
45
|
-
npx nextjs-hackathon-stack my-app --skip-install
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
| Flag | Description |
|
|
42
|
+
| Argument / Flag | Description |
|
|
49
43
|
|---|---|
|
|
50
|
-
|
|
|
44
|
+
| `[project-name]` | Directory name for the new project |
|
|
45
|
+
| `--skip-install` | Skip `pnpm install` and `shadcn/ui` init |
|
|
51
46
|
|
|
52
|
-
##
|
|
47
|
+
## What the CLI does
|
|
53
48
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
49
|
+
1. Copies the template into `[project-name]/`
|
|
50
|
+
2. Replaces `{{projectName}}` placeholders with the actual project name
|
|
51
|
+
3. Installs dependencies with `pnpm`
|
|
52
|
+
4. Initialises shadcn/ui components
|
|
53
|
+
5. Sets up a git repo with Husky pre-commit hooks
|
|
58
54
|
|
|
59
|
-
##
|
|
55
|
+
## Requirements
|
|
60
56
|
|
|
61
|
-
|
|
57
|
+
- Node >= 22
|
|
58
|
+
- pnpm
|
|
62
59
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
│ ├── auth/ # Login form, server actions, session hook
|
|
68
|
-
│ └── chat/ # AI chat (streaming)
|
|
69
|
-
├── shared/
|
|
70
|
-
│ ├── lib/ # Supabase clients, AI
|
|
71
|
-
│ ├── db/ # Drizzle schema + migrations
|
|
72
|
-
│ └── components/# Providers + shadcn/ui
|
|
73
|
-
└── e2e/ # Playwright e2e tests
|
|
74
|
-
```
|
|
60
|
+
## Pre-built features
|
|
61
|
+
|
|
62
|
+
- **Auth** — Email/password login, logout, `useSession` hook, protected routes
|
|
63
|
+
- **Todos** — Full CRUD with server actions, add form, todo list
|
|
75
64
|
|
|
76
65
|
## License
|
|
77
66
|
|
package/package.json
CHANGED
package/template/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# {{projectName}}
|
|
2
2
|
|
|
3
|
-
Full-stack Next.js 16 hackathon starter.
|
|
3
|
+
Full-stack Next.js 16 hackathon starter with pre-built auth and todos.
|
|
4
4
|
|
|
5
5
|
## Stack
|
|
6
6
|
|
|
@@ -14,8 +14,8 @@ Full-stack Next.js 16 hackathon starter.
|
|
|
14
14
|
| State | TanStack Query v5 |
|
|
15
15
|
| Forms | React Hook Form + Zod |
|
|
16
16
|
| UI | shadcn/ui + Tailwind CSS v4 |
|
|
17
|
-
| AI | Vercel AI SDK + MiniMax M2.1 |
|
|
18
17
|
| Testing | Vitest + Playwright |
|
|
18
|
+
| Code Quality | ESLint 9 + Husky + lint-staged |
|
|
19
19
|
|
|
20
20
|
## Getting Started
|
|
21
21
|
|
|
@@ -28,17 +28,12 @@ Full-stack Next.js 16 hackathon starter.
|
|
|
28
28
|
NEXT_PUBLIC_SUPABASE_URL=https://your-project-id.supabase.co
|
|
29
29
|
NEXT_PUBLIC_SUPABASE_ANON_KEY=your-anon-key
|
|
30
30
|
DATABASE_URL=postgresql://postgres.your-project-id:[password]@aws-0-[region].pooler.supabase.com:6543/postgres
|
|
31
|
-
|
|
32
|
-
# AI — Vercel AI Gateway (default: MiniMax M2.1)
|
|
33
|
-
# Create gateway at: https://vercel.com > AI > Gateways
|
|
34
|
-
AI_GATEWAY_URL=https://gateway.ai.vercel.app/v1/your-team-id/your-gateway-id
|
|
35
|
-
AI_API_KEY=
|
|
36
31
|
```
|
|
37
32
|
|
|
38
33
|
### 2. Apply database migrations
|
|
39
34
|
|
|
40
35
|
```bash
|
|
41
|
-
pnpm db:migrate
|
|
36
|
+
pnpm db:migrate
|
|
42
37
|
```
|
|
43
38
|
|
|
44
39
|
### 3. Run the dev server
|
|
@@ -53,12 +48,18 @@ pnpm dev
|
|
|
53
48
|
pnpm dev # Start dev server
|
|
54
49
|
pnpm build # Production build
|
|
55
50
|
pnpm lint # Lint (0 warnings allowed)
|
|
51
|
+
pnpm lint:fix # Lint and auto-fix
|
|
56
52
|
pnpm typecheck # TypeScript check
|
|
57
53
|
pnpm test # Unit tests
|
|
54
|
+
pnpm test:unit # Unit tests (verbose)
|
|
55
|
+
pnpm test:watch # Watch mode
|
|
58
56
|
pnpm test:coverage # Tests with coverage (100% required)
|
|
59
57
|
pnpm test:e2e # Playwright e2e tests
|
|
60
|
-
pnpm db:generate # Generate Drizzle migrations
|
|
61
|
-
pnpm db:migrate # Apply migrations
|
|
58
|
+
pnpm db:generate # Generate Drizzle migrations from schema
|
|
59
|
+
pnpm db:migrate # Apply migrations to database
|
|
60
|
+
pnpm db:pull # Introspect DB and generate schema
|
|
61
|
+
pnpm db:push # Push schema directly (dev only)
|
|
62
|
+
pnpm db:studio # Open Drizzle Studio GUI
|
|
62
63
|
```
|
|
63
64
|
|
|
64
65
|
## Environment Variables
|
|
@@ -68,8 +69,6 @@ pnpm db:migrate # Apply migrations
|
|
|
68
69
|
| `NEXT_PUBLIC_SUPABASE_URL` | Supabase > Project Settings > API |
|
|
69
70
|
| `NEXT_PUBLIC_SUPABASE_ANON_KEY` | Supabase > Project Settings > API |
|
|
70
71
|
| `DATABASE_URL` | Supabase > Project Settings > Database > Connection string > Session mode |
|
|
71
|
-
| `AI_GATEWAY_URL` | Vercel > AI > Gateways |
|
|
72
|
-
| `AI_API_KEY` | Your AI provider API key |
|
|
73
72
|
| `NEXT_PUBLIC_APP_URL` | Your deployment URL (default: `http://localhost:3000`) |
|
|
74
73
|
|
|
75
74
|
See `.env.example` for all required variables with comments.
|
|
@@ -77,20 +76,27 @@ See `.env.example` for all required variables with comments.
|
|
|
77
76
|
## Architecture
|
|
78
77
|
|
|
79
78
|
Feature-based structure:
|
|
79
|
+
|
|
80
80
|
```
|
|
81
81
|
src/
|
|
82
82
|
├── app/ # Next.js routing + layouts
|
|
83
|
-
├── features/
|
|
83
|
+
├── features/
|
|
84
|
+
│ ├── auth/ # Email+password login, logout, session hook, protected routes
|
|
85
|
+
│ └── todos/ # CRUD server actions, add form, todo list
|
|
84
86
|
├── shared/ # lib | db | components/ui
|
|
85
87
|
└── e2e/ # Playwright tests
|
|
86
88
|
```
|
|
87
89
|
|
|
88
90
|
Dependency direction: `features/* → shared/*` (never reverse).
|
|
89
91
|
|
|
92
|
+
## Pre-commit Hooks
|
|
93
|
+
|
|
94
|
+
Husky runs `vitest --coverage` on every commit. The commit is blocked if coverage drops below 100%.
|
|
95
|
+
|
|
90
96
|
## Cursor AI Setup
|
|
91
97
|
|
|
92
|
-
Cursor rules, agents, and skills are preconfigured in `.cursor
|
|
98
|
+
Cursor rules, agents, and skills are preconfigured in `.cursor/`:
|
|
93
99
|
|
|
94
|
-
- **Rules
|
|
95
|
-
- **Agents
|
|
96
|
-
- **Skills
|
|
100
|
+
- **Rules** (11): always-on guardrails for coding standards, architecture, security, and more
|
|
101
|
+
- **Agents** (7): specialized roles (technical-lead, frontend, backend, test-qa, etc.)
|
|
102
|
+
- **Skills** (4): repeatable workflows (`/create-feature`, `/create-api-route`, `/review-branch`, `/security-audit`)
|