create-next-mdx-blog-app 2.1.3 → 2.1.5
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 +16 -11
- package/bin/create.js +13 -9
- package/package.json +13 -2
- package/.env.example +0 -17
- package/CLAUDE.md +0 -401
- package/Dockerfile +0 -37
- package/components.json +0 -21
- package/eslint.config.mjs +0 -16
- package/mdx-components.tsx +0 -208
- package/mdx.d.ts +0 -5
- package/next.config.ts +0 -27
- package/postcss.config.mjs +0 -5
- package/public/file.svg +0 -1
- package/public/globe.svg +0 -1
- package/public/next.svg +0 -1
- package/public/vercel.svg +0 -1
- package/public/window.svg +0 -1
- package/scripts/action-script/article-manager.ts +0 -99
- package/scripts/bash/bulk-create-articles.sh +0 -26
- package/scripts/bash/bulk-s3-folder-creation.sh +0 -47
- package/scripts/bash/bulk-update-articles.sh +0 -36
- package/scripts/bash/create-missing-mdx-files.sh +0 -25
- package/scripts/bash/project_setup.sh +0 -19
- package/scripts/github-gist-fetcher/fetch-github-gist.ts +0 -72
- package/scripts/powershell/bulk-create-articles.ps1 +0 -29
- package/scripts/powershell/bulk-s3-folder-creation.ps1 +0 -47
- package/scripts/powershell/bulk-update-articles.ps1 +0 -38
- package/scripts/powershell/create-missing-mdx-files.ps1 +0 -24
- package/scripts/powershell/project_setup.ps1 +0 -18
- package/scripts/sql/DDL/alterTable.sql +0 -10
- package/scripts/sql/DDL/createTable.sql +0 -16
- package/scripts/sql/DDL/dropTable.sql +0 -3
- package/scripts/sql/DDL/truncateTable.sql +0 -2
- package/scripts/sql/DML/deleteArticle.sql +0 -6
- package/scripts/sql/DML/fetchArticle.sql +0 -15
- package/scripts/sql/DML/insertArticle.sql +0 -31
- package/scripts/sql/DML/updateArticle.sql +0 -12
- package/src/app/api/chat/route.ts +0 -85
- package/src/app/chat/page.tsx +0 -32
- package/src/app/code-sandbox/page.tsx +0 -22
- package/src/app/dynamic/[dynamic_blog_post]/error.tsx +0 -31
- package/src/app/dynamic/[dynamic_blog_post]/page.tsx +0 -40
- package/src/app/favicon.ico +0 -0
- package/src/app/globals.css +0 -224
- package/src/app/layout.tsx +0 -26
- package/src/app/not-found.tsx +0 -37
- package/src/app/page.tsx +0 -94
- package/src/app/sample-blog-post-page/page.tsx +0 -40
- package/src/components/ArticleAuthorBio.tsx +0 -27
- package/src/components/ArticleCoverImage.tsx +0 -17
- package/src/components/ArticleHeader.tsx +0 -49
- package/src/components/BackToTopButton.tsx +0 -34
- package/src/components/CodeSandboxClient.tsx +0 -107
- package/src/components/CodeSandboxFeaturesSection.tsx +0 -47
- package/src/components/CopyLinkButton.tsx +0 -38
- package/src/components/DynamicArticle.tsx +0 -35
- package/src/components/MDXRemoteArticle.tsx +0 -16
- package/src/components/ReadingProgressBar.tsx +0 -34
- package/src/components/SandpackEditor.tsx +0 -158
- package/src/components/SocialShareButtons.tsx +0 -34
- package/src/components/StaticArticle.tsx +0 -14
- package/src/components/chat/chat-input.tsx +0 -57
- package/src/components/chat/chat-interface.tsx +0 -59
- package/src/components/chat/chat-messages.tsx +0 -130
- package/src/components/chat/chat-tool-result.tsx +0 -45
- package/src/components/customMDXComponents/CodeBlock.tsx +0 -64
- package/src/components/customMDXComponents/GistCodeBlock.tsx +0 -19
- package/src/components/customMDXComponents/GistCopyButton.tsx +0 -57
- package/src/components/customMDXComponents/GitHubGist.tsx +0 -84
- package/src/components/customMDXComponents/MDXImage.tsx +0 -23
- package/src/components/ui/avatar.tsx +0 -53
- package/src/components/ui/badge.tsx +0 -46
- package/src/components/ui/button.tsx +0 -59
- package/src/components/ui/textarea.tsx +0 -21
- package/src/github_gists/9570f2405cc511f8eea0c8758fc98e89.txt +0 -34
- package/src/lib/utils.ts +0 -6
- package/src/markdown/ArticleContent.mdx +0 -107
- package/src/markdown/DynamicArticleContent.mdx +0 -58
- package/src/utils/constants/AiChatConfig.ts +0 -24
- package/src/utils/constants/ArticleAuthorInfoList.ts +0 -10
- package/src/utils/constants/ArticleHeaderInfoList.ts +0 -18
- package/src/utils/constants/GitHubGistConstants.ts +0 -77
- package/src/utils/constants/SandboxExamples.ts +0 -142
- package/src/utils/constants/SocialShareConstants.ts +0 -20
- package/src/utils/constants/ToolConfig.ts +0 -21
- package/src/utils/constants/index.ts +0 -12
- package/src/utils/functions/crud/deleteArticle.ts +0 -17
- package/src/utils/functions/crud/fetchAllArticles.ts +0 -16
- package/src/utils/functions/crud/fetchArticle.ts +0 -26
- package/src/utils/functions/crud/index.ts +0 -5
- package/src/utils/functions/crud/insertArticle.ts +0 -45
- package/src/utils/functions/crud/updateArticle.ts +0 -26
- package/src/utils/functions/index.ts +0 -2
- package/src/utils/functions/supabase_client/SupabaseClient.ts +0 -13
- package/src/utils/functions/supabase_client/index.ts +0 -1
- package/src/utils/types/ArticleAuthorInfoType.ts +0 -6
- package/src/utils/types/ArticleCoverImageType.ts +0 -4
- package/src/utils/types/ArticleHeaderInfoType.ts +0 -13
- package/src/utils/types/ChatInputType.ts +0 -5
- package/src/utils/types/ChatInterfaceType.ts +0 -4
- package/src/utils/types/ChatMessagesType.ts +0 -8
- package/src/utils/types/GitHubGistType.ts +0 -5
- package/src/utils/types/MDXImageType.ts +0 -8
- package/src/utils/types/SandboxExampleType.ts +0 -5
- package/src/utils/types/SocialShareButtonsType.ts +0 -13
- package/src/utils/types/ToolConfigType.ts +0 -8
- package/src/utils/types/ToolInvocationPartType.ts +0 -9
- package/src/utils/types/index.ts +0 -12
- package/tsconfig.json +0 -49
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ This starter kit is built with **Static Site Generation (SSG)** compliance at it
|
|
|
16
16
|
## ⚙️ Project Setup
|
|
17
17
|
|
|
18
18
|
### Prerequisites
|
|
19
|
-
- **Node.js**: Ensure you have Node.js installed (version
|
|
19
|
+
- **Node.js**: Ensure you have Node.js installed (version 18.17.0 or later).
|
|
20
20
|
- **NPM**: Node Package Manager comes with Node.js.
|
|
21
21
|
|
|
22
22
|
### Installation
|
|
@@ -31,7 +31,13 @@ This starter kit is built with **Static Site Generation (SSG)** compliance at it
|
|
|
31
31
|
npm install
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
3.
|
|
34
|
+
3. Configure environment variables:
|
|
35
|
+
```bash
|
|
36
|
+
cp .env.example .env.local
|
|
37
|
+
# Fill in SUPABASE_URL, SUPABASE_ANON_KEY, ANTHROPIC_API_KEY, and others in .env.local
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
4. Start the development server:
|
|
35
41
|
```bash
|
|
36
42
|
npm run dev
|
|
37
43
|
```
|
|
@@ -40,17 +46,13 @@ If you want, you can also run this project using the following command:
|
|
|
40
46
|
```bash
|
|
41
47
|
npx create-next-mdx-blog-app .
|
|
42
48
|
```
|
|
43
|
-
This will
|
|
49
|
+
This will clone the repository, install dependencies, and guide you through environment setup automatically.
|
|
44
50
|
|
|
45
51
|
##  Package
|
|
46
52
|
|
|
47
|
-
###
|
|
53
|
+
### Quick Start
|
|
48
54
|
|
|
49
|
-
|
|
50
|
-
npm install create-next-mdx-blog-app
|
|
51
|
-
```
|
|
52
|
-
|
|
53
|
-
### Quick Start with NPX
|
|
55
|
+
**`npx create-next-mdx-blog-app .`**
|
|
54
56
|
|
|
55
57
|
```bash
|
|
56
58
|
npx create-next-mdx-blog-app .
|
|
@@ -59,7 +61,7 @@ npx create-next-mdx-blog-app .
|
|
|
59
61
|
### Package Information
|
|
60
62
|
|
|
61
63
|
- **Package Name**: `create-next-mdx-blog-app`
|
|
62
|
-
- **Version**: `2.1.
|
|
64
|
+
- **Version**: `2.1.5`
|
|
63
65
|
- **License**: MIT
|
|
64
66
|
- **Homepage**: [https://www.npmjs.com/package/create-next-mdx-blog-app](https://www.npmjs.com/package/create-next-mdx-blog-app/)
|
|
65
67
|
|
|
@@ -170,6 +172,9 @@ A thin green bar (`src/components/ReadingProgressBar.tsx`) is fixed to the top o
|
|
|
170
172
|
### Back to Top Button
|
|
171
173
|
A floating circular button (`src/components/BackToTopButton.tsx`) appears in the bottom-right corner of the screen once the reader has scrolled more than 400px down the page. Clicking it smoothly scrolls back to the top. The button is hidden when not needed and matches the green colour scheme of the rest of the UI.
|
|
172
174
|
|
|
175
|
+
### View Counter
|
|
176
|
+
Each article page displays a live view count stored in a dedicated `view_counts` Supabase table, incremented atomically via the `increment_view_count` RPC function. Dynamic pages increment server-side at render time; static pages use a `ViewCounter` client component that calls the `/api/views/[slug]` Route Handler after hydration.
|
|
177
|
+
|
|
173
178
|
## 🖥️ Code Sandbox
|
|
174
179
|
The project includes an interactive in-browser code execution environment powered by **Sandpack** (<b>route</b>: `/code-sandbox`).
|
|
175
180
|
|
|
@@ -266,7 +271,7 @@ docker run -e SUPABASE_URL=your_supabase_url \ -e SUPABASE_ANON_KEY=your_supabas
|
|
|
266
271
|
``
|
|
267
272
|
|
|
268
273
|
## 🔄 CRUD Operations and Supabase Actions
|
|
269
|
-
Implementation of the CRUD operation functions is stored in the `/src/utils/functions/crud` directory. This includes functions for creating, reading, updating, and deleting articles in the Supabase database.
|
|
274
|
+
Implementation of the CRUD operation functions is stored in the `/src/utils/functions/crud` directory. This includes functions for creating, reading, updating, and deleting articles in the Supabase database. Supabase RPC functions (such as `incrementViewCount`) are kept separately in `/src/utils/functions/rpc`.
|
|
270
275
|
|
|
271
276
|
The `article-manager.ts` file utilizes these CRUD functions to successfully perform the desired actions.
|
|
272
277
|
|
package/bin/create.js
CHANGED
|
@@ -38,21 +38,25 @@ async function setup() {
|
|
|
38
38
|
|
|
39
39
|
try {
|
|
40
40
|
// Use degit to clone the repository into the current directory
|
|
41
|
+
console.log('Cloning repository...');
|
|
41
42
|
const emitter = degit(repoUrl, { cache: false, force: true });
|
|
42
43
|
await emitter.clone(cwd);
|
|
43
44
|
|
|
44
|
-
//
|
|
45
|
-
if (!hasPackageJson) {
|
|
46
|
-
console.log('Initializing npm project...');
|
|
47
|
-
await execa('npm', ['init', '-y'], { stdio: 'inherit' }); // Initialize package.json with default values
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Install dependencies
|
|
45
|
+
// Install dependencies inside the cloned app subdirectory
|
|
51
46
|
console.log('Installing dependencies...');
|
|
52
|
-
await execa('npm', ['install'], {
|
|
47
|
+
await execa('npm', ['install'], {
|
|
48
|
+
stdio: 'inherit',
|
|
49
|
+
cwd: path.join(cwd, 'mdx-medium-blog-post-provider')
|
|
50
|
+
});
|
|
53
51
|
|
|
54
52
|
console.log('Next.js MDX Blog setup completed!');
|
|
55
|
-
console.log('
|
|
53
|
+
console.log('');
|
|
54
|
+
console.log('Before starting the app, configure your environment variables:');
|
|
55
|
+
console.log(' cd mdx-medium-blog-post-provider');
|
|
56
|
+
console.log(' cp .env.example .env.local');
|
|
57
|
+
console.log(' # Fill in SUPABASE_URL, SUPABASE_ANON_KEY, ANTHROPIC_API_KEY, and others in .env.local');
|
|
58
|
+
console.log('');
|
|
59
|
+
console.log('Then start the development server:');
|
|
56
60
|
console.log(' npm run dev');
|
|
57
61
|
}
|
|
58
62
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-next-mdx-blog-app",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.5",
|
|
4
|
+
"description": "A production-ready technical blog starter kit built with Next.js, MDX, Supabase, and TypeScript.",
|
|
5
|
+
"author": {
|
|
6
|
+
"name": "Abdullah Muhammad",
|
|
7
|
+
"url": "https://github.com/CodingAbdullah"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/"
|
|
11
|
+
],
|
|
4
12
|
"bin": {
|
|
5
13
|
"create-next-mdx-blog-app": "./bin/create.js"
|
|
6
14
|
},
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18.17.0"
|
|
17
|
+
},
|
|
7
18
|
"homepage": "https://next-mdx-blog-starter-sigma.vercel.app/",
|
|
8
19
|
"repository": {
|
|
9
20
|
"type": "git",
|
|
@@ -21,7 +32,7 @@
|
|
|
21
32
|
"supabase",
|
|
22
33
|
"typescript"
|
|
23
34
|
],
|
|
24
|
-
"license": "MIT
|
|
35
|
+
"license": "MIT",
|
|
25
36
|
"scripts": {
|
|
26
37
|
"dev": "next dev",
|
|
27
38
|
"build": "next build",
|
package/.env.example
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
# Supabase — required for dynamic blog post fetching
|
|
2
|
-
SUPABASE_URL=
|
|
3
|
-
SUPABASE_ANON_KEY=
|
|
4
|
-
|
|
5
|
-
# Anthropic — required for the Blog Assistant chat feature
|
|
6
|
-
ANTHROPIC_API_KEY=
|
|
7
|
-
|
|
8
|
-
# GitHub — optional but recommended for the <GitHubGist> component
|
|
9
|
-
# Without a token, the GitHub API allows 60 requests/hr per IP.
|
|
10
|
-
# With a token (read-only gist scope), the limit rises to 5,000 requests/hr.
|
|
11
|
-
GITHUB_TOKEN=
|
|
12
|
-
|
|
13
|
-
# GitHub username used to construct mdxgists.net URLs (defaults to CodingAbdullah)
|
|
14
|
-
GITHUB_USERNAME=
|
|
15
|
-
|
|
16
|
-
# Base URL for mdxgists.net links (defaults to https://mdxgists.net)
|
|
17
|
-
GIST_BASE_URL=
|
package/CLAUDE.md
DELETED
|
@@ -1,401 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
Production Configuration File
|
|
3
|
-
Project: Next-MDX-Blog-Starter
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# PROJECT PURPOSE
|
|
8
|
-
|
|
9
|
-
This repository is a production-grade Next.js App Router blog starter kit built using MDX, Supabase, AWS S3, and TypeScript strict mode.
|
|
10
|
-
|
|
11
|
-
This project follows a Static Site Generation (SSG-first) architecture and is optimized for performance, SEO, maintainability, and production deployment.
|
|
12
|
-
|
|
13
|
-
Claude Sonnet 4 is the primary coding model used to develop and maintain this project.
|
|
14
|
-
|
|
15
|
-
Claude acts as a senior production engineer responsible for generating safe, correct, production-ready code.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
# CORE STACK
|
|
20
|
-
|
|
21
|
-
Framework
|
|
22
|
-
• Next.js (App Router only)
|
|
23
|
-
• React
|
|
24
|
-
• TypeScript (strict mode mandatory)
|
|
25
|
-
|
|
26
|
-
Content
|
|
27
|
-
• MDX
|
|
28
|
-
• gray-matter
|
|
29
|
-
• next-mdx-remote
|
|
30
|
-
|
|
31
|
-
Database
|
|
32
|
-
• Supabase (direct integration via Server Components)
|
|
33
|
-
|
|
34
|
-
Storage
|
|
35
|
-
• AWS S3 (image storage)
|
|
36
|
-
|
|
37
|
-
UI
|
|
38
|
-
• shadcn/ui
|
|
39
|
-
• lucide-react
|
|
40
|
-
|
|
41
|
-
Other
|
|
42
|
-
• Docker
|
|
43
|
-
• Vercel Analytics
|
|
44
|
-
|
|
45
|
-
---
|
|
46
|
-
|
|
47
|
-
# ARCHITECTURE RULES
|
|
48
|
-
|
|
49
|
-
This project is SSG-first.
|
|
50
|
-
|
|
51
|
-
Claude must always prefer Static Site Generation over dynamic rendering.
|
|
52
|
-
|
|
53
|
-
Use dynamic rendering ONLY when explicitly required.
|
|
54
|
-
|
|
55
|
-
All blog posts must be statically generated when possible.
|
|
56
|
-
|
|
57
|
-
Use generateStaticParams when applicable.
|
|
58
|
-
|
|
59
|
-
Avoid unnecessary client-side rendering.
|
|
60
|
-
|
|
61
|
-
Prefer Server Components over Client Components.
|
|
62
|
-
|
|
63
|
-
Never introduce performance regressions.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
# TYPESCRIPT REQUIREMENTS (MANDATORY)
|
|
68
|
-
|
|
69
|
-
All generated code must:
|
|
70
|
-
|
|
71
|
-
• use strict mode
|
|
72
|
-
• never use any
|
|
73
|
-
• include explicit types
|
|
74
|
-
• include proper return types
|
|
75
|
-
• include proper interfaces
|
|
76
|
-
• include proper error handling
|
|
77
|
-
• be production-ready
|
|
78
|
-
• be compile-ready immediately
|
|
79
|
-
|
|
80
|
-
Never generate placeholder code.
|
|
81
|
-
Never generate incomplete code.
|
|
82
|
-
Never generate mock implementations.
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
# PROJECT STRUCTURE RULES
|
|
87
|
-
|
|
88
|
-
Claude must respect existing project structure.
|
|
89
|
-
|
|
90
|
-
Key directories:
|
|
91
|
-
|
|
92
|
-
/app
|
|
93
|
-
/src/markdown
|
|
94
|
-
/src/utils
|
|
95
|
-
/src/utils/functions
|
|
96
|
-
/src/utils/functions/crud
|
|
97
|
-
/src/utils/functions/supabase_client
|
|
98
|
-
/components
|
|
99
|
-
/components/customMDXComponents
|
|
100
|
-
/scripts
|
|
101
|
-
|
|
102
|
-
Never restructure folders unless explicitly instructed.
|
|
103
|
-
|
|
104
|
-
Never break import paths.
|
|
105
|
-
|
|
106
|
-
---
|
|
107
|
-
|
|
108
|
-
# MDX SYSTEM RULES
|
|
109
|
-
|
|
110
|
-
Static MDX:
|
|
111
|
-
|
|
112
|
-
• Must be statically generated at build time
|
|
113
|
-
• Must use gray-matter for frontmatter parsing
|
|
114
|
-
• Must support metadata generation
|
|
115
|
-
|
|
116
|
-
Dynamic MDX:
|
|
117
|
-
|
|
118
|
-
• Must use next-mdx-remote
|
|
119
|
-
• Must render server-side only
|
|
120
|
-
• Must never expose raw MDX to client
|
|
121
|
-
|
|
122
|
-
Frontmatter must include:
|
|
123
|
-
|
|
124
|
-
---
|
|
125
|
-
title: string
|
|
126
|
-
description: string
|
|
127
|
-
publishedAt: string
|
|
128
|
-
author: string
|
|
129
|
-
tags: string[]
|
|
130
|
-
image: string
|
|
131
|
-
---
|
|
132
|
-
|
|
133
|
-
Claude must validate frontmatter when generating MDX logic.
|
|
134
|
-
|
|
135
|
-
---
|
|
136
|
-
|
|
137
|
-
# MDX COMPONENT RULES
|
|
138
|
-
|
|
139
|
-
File: mdx-components.tsx
|
|
140
|
-
|
|
141
|
-
Must override:
|
|
142
|
-
|
|
143
|
-
• img → Next Image
|
|
144
|
-
• a → Next Link
|
|
145
|
-
|
|
146
|
-
Must maintain accessibility.
|
|
147
|
-
|
|
148
|
-
Custom MDX components must live inside:
|
|
149
|
-
|
|
150
|
-
/components/customMDXComponents
|
|
151
|
-
|
|
152
|
-
Examples:
|
|
153
|
-
|
|
154
|
-
• CodeBlock
|
|
155
|
-
• MDXImage
|
|
156
|
-
• GitHubGist
|
|
157
|
-
|
|
158
|
-
All components must be fully typed.
|
|
159
|
-
|
|
160
|
-
---
|
|
161
|
-
|
|
162
|
-
# SUPABASE RULES
|
|
163
|
-
|
|
164
|
-
Supabase is integrated directly.
|
|
165
|
-
|
|
166
|
-
Claude must NOT create custom backend APIs unless explicitly instructed.
|
|
167
|
-
|
|
168
|
-
Supabase client location:
|
|
169
|
-
|
|
170
|
-
/src/utils/functions/supabase_client
|
|
171
|
-
|
|
172
|
-
CRUD functions location:
|
|
173
|
-
|
|
174
|
-
/src/utils/functions/crud
|
|
175
|
-
|
|
176
|
-
Rules:
|
|
177
|
-
|
|
178
|
-
• Never expose secrets
|
|
179
|
-
• Never expose service role key
|
|
180
|
-
• Use environment variables
|
|
181
|
-
• Use server-side access
|
|
182
|
-
• Respect Row Level Security
|
|
183
|
-
|
|
184
|
-
Environment variables allowed:
|
|
185
|
-
|
|
186
|
-
SUPABASE_URL
|
|
187
|
-
SUPABASE_ANON_KEY
|
|
188
|
-
|
|
189
|
-
Never commit .env files.
|
|
190
|
-
|
|
191
|
-
---
|
|
192
|
-
|
|
193
|
-
# AWS S3 RULES
|
|
194
|
-
|
|
195
|
-
AWS S3 is used for image storage.
|
|
196
|
-
|
|
197
|
-
Claude must:
|
|
198
|
-
|
|
199
|
-
• Use public image URLs
|
|
200
|
-
• Use Next Image component
|
|
201
|
-
• Never expose credentials
|
|
202
|
-
• Never embed secrets
|
|
203
|
-
|
|
204
|
-
S3 domain configuration exists in next.config.ts
|
|
205
|
-
|
|
206
|
-
---
|
|
207
|
-
|
|
208
|
-
# DOCKER RULES
|
|
209
|
-
|
|
210
|
-
Docker must:
|
|
211
|
-
|
|
212
|
-
• Use multi-stage builds
|
|
213
|
-
• Use production Node runtime
|
|
214
|
-
• Exclude dev dependencies
|
|
215
|
-
• Inject environment variables at runtime
|
|
216
|
-
• Expose port 3000
|
|
217
|
-
|
|
218
|
-
Claude must generate production-ready Docker configurations only.
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
# ANALYTICS RULES
|
|
223
|
-
|
|
224
|
-
Vercel Analytics is used.
|
|
225
|
-
|
|
226
|
-
Claude must:
|
|
227
|
-
|
|
228
|
-
• Keep analytics lightweight
|
|
229
|
-
• Avoid blocking rendering
|
|
230
|
-
• Avoid performance regressions
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
# ARTICLE MANAGER SCRIPT RULES
|
|
235
|
-
|
|
236
|
-
File:
|
|
237
|
-
|
|
238
|
-
/scripts/action-script/article-manager.ts
|
|
239
|
-
|
|
240
|
-
Commands supported:
|
|
241
|
-
|
|
242
|
-
insert
|
|
243
|
-
delete
|
|
244
|
-
update
|
|
245
|
-
fetch
|
|
246
|
-
fetchAll
|
|
247
|
-
|
|
248
|
-
Claude must:
|
|
249
|
-
|
|
250
|
-
• Maintain CLI interface
|
|
251
|
-
• Validate arguments
|
|
252
|
-
• Provide proper error handling
|
|
253
|
-
• Provide proper exit codes
|
|
254
|
-
• Maintain strict typing
|
|
255
|
-
|
|
256
|
-
Never break script interface.
|
|
257
|
-
|
|
258
|
-
---
|
|
259
|
-
|
|
260
|
-
# PERFORMANCE RULES
|
|
261
|
-
|
|
262
|
-
Claude must:
|
|
263
|
-
|
|
264
|
-
• Prefer Server Components
|
|
265
|
-
• Avoid unnecessary Client Components
|
|
266
|
-
• Avoid hydration mismatches
|
|
267
|
-
• Avoid blocking rendering
|
|
268
|
-
• Optimize images
|
|
269
|
-
• Optimize imports
|
|
270
|
-
• Avoid unnecessary JS
|
|
271
|
-
|
|
272
|
-
---
|
|
273
|
-
|
|
274
|
-
# SECURITY RULES
|
|
275
|
-
|
|
276
|
-
Claude must never:
|
|
277
|
-
|
|
278
|
-
• expose secrets
|
|
279
|
-
• expose environment variables
|
|
280
|
-
• leak Supabase credentials
|
|
281
|
-
• introduce unsafe eval
|
|
282
|
-
• introduce vulnerabilities
|
|
283
|
-
|
|
284
|
-
All input must be validated.
|
|
285
|
-
|
|
286
|
-
---
|
|
287
|
-
|
|
288
|
-
# GIT WORKFLOW RULES (CRITICAL)
|
|
289
|
-
|
|
290
|
-
Claude must NEVER commit automatically.
|
|
291
|
-
|
|
292
|
-
Claude must NEVER commit after generating code.
|
|
293
|
-
|
|
294
|
-
Claude must NEVER create commits unless explicitly instructed.
|
|
295
|
-
|
|
296
|
-
Claude must ONLY commit when the user explicitly writes:
|
|
297
|
-
|
|
298
|
-
commit changes
|
|
299
|
-
create commit
|
|
300
|
-
commit this feature
|
|
301
|
-
|
|
302
|
-
Without explicit commit instruction, Claude must NOT commit.
|
|
303
|
-
|
|
304
|
-
All commits must be batch commits.
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
# BRANCH WORKFLOW RULES (CRITICAL)
|
|
309
|
-
|
|
310
|
-
Claude must NEVER create branches automatically.
|
|
311
|
-
|
|
312
|
-
Claude must NEVER invent branch names.
|
|
313
|
-
|
|
314
|
-
Branches may ONLY be created when explicitly instructed.
|
|
315
|
-
|
|
316
|
-
Allowed prefixes:
|
|
317
|
-
|
|
318
|
-
dev/
|
|
319
|
-
fix/
|
|
320
|
-
|
|
321
|
-
Claude must NEVER commit directly to main or master.
|
|
322
|
-
|
|
323
|
-
Claude must NEVER switch branches automatically.
|
|
324
|
-
|
|
325
|
-
---
|
|
326
|
-
|
|
327
|
-
# COMMIT SAFETY RULES
|
|
328
|
-
|
|
329
|
-
When committing, Claude must ensure:
|
|
330
|
-
|
|
331
|
-
• only relevant files included
|
|
332
|
-
• no unrelated files included
|
|
333
|
-
• no secrets included
|
|
334
|
-
• code compiles
|
|
335
|
-
• strict TypeScript passes
|
|
336
|
-
• commit is atomic
|
|
337
|
-
|
|
338
|
-
Commit messages must be clear and professional.
|
|
339
|
-
|
|
340
|
-
---
|
|
341
|
-
|
|
342
|
-
# CODE GENERATION REQUIREMENTS
|
|
343
|
-
|
|
344
|
-
All generated code must:
|
|
345
|
-
|
|
346
|
-
• be production-ready
|
|
347
|
-
• be fully typed
|
|
348
|
-
• include error handling
|
|
349
|
-
• follow modern best practices
|
|
350
|
-
• follow Next.js App Router patterns
|
|
351
|
-
• be modular
|
|
352
|
-
• be maintainable
|
|
353
|
-
|
|
354
|
-
Claude must never generate placeholder implementations.
|
|
355
|
-
|
|
356
|
-
Claude must never generate incomplete logic.
|
|
357
|
-
|
|
358
|
-
Claude must never generate fake implementations.
|
|
359
|
-
|
|
360
|
-
---
|
|
361
|
-
|
|
362
|
-
# DEPLOYMENT TARGETS
|
|
363
|
-
|
|
364
|
-
Project must remain compatible with:
|
|
365
|
-
|
|
366
|
-
• Vercel
|
|
367
|
-
• Docker deployment
|
|
368
|
-
• Static hosting (SSG mode)
|
|
369
|
-
|
|
370
|
-
Claude must preserve deployment compatibility.
|
|
371
|
-
|
|
372
|
-
---
|
|
373
|
-
|
|
374
|
-
# DEFAULT BEHAVIOR
|
|
375
|
-
|
|
376
|
-
Unless explicitly instructed otherwise, Claude must assume:
|
|
377
|
-
|
|
378
|
-
• production environment
|
|
379
|
-
• strict TypeScript required
|
|
380
|
-
• Supabase integration active
|
|
381
|
-
• AWS S3 active
|
|
382
|
-
• SSG preferred
|
|
383
|
-
|
|
384
|
-
Claude must behave as a senior production engineer.
|
|
385
|
-
|
|
386
|
-
---
|
|
387
|
-
|
|
388
|
-
# PRIORITY ORDER
|
|
389
|
-
|
|
390
|
-
Claude must prioritize in this order:
|
|
391
|
-
|
|
392
|
-
1 Security
|
|
393
|
-
2 Type safety
|
|
394
|
-
3 Performance
|
|
395
|
-
4 Maintainability
|
|
396
|
-
5 SEO
|
|
397
|
-
6 Developer experience
|
|
398
|
-
|
|
399
|
-
---
|
|
400
|
-
|
|
401
|
-
END OF FILE
|
package/Dockerfile
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
# Dockerize the Next.js application and run a production version in a container using this Dockerfile
|
|
2
|
-
# Build stage
|
|
3
|
-
FROM node:20-alpine AS builder
|
|
4
|
-
|
|
5
|
-
WORKDIR /app
|
|
6
|
-
|
|
7
|
-
# Copy package files
|
|
8
|
-
COPY package*.json ./
|
|
9
|
-
|
|
10
|
-
# Install dependencies
|
|
11
|
-
RUN npm ci
|
|
12
|
-
|
|
13
|
-
# Copy the rest of the application
|
|
14
|
-
COPY . .
|
|
15
|
-
|
|
16
|
-
# Build the application
|
|
17
|
-
RUN npm run build
|
|
18
|
-
|
|
19
|
-
# Production stage
|
|
20
|
-
FROM node:20-alpine AS runner
|
|
21
|
-
|
|
22
|
-
WORKDIR /app
|
|
23
|
-
|
|
24
|
-
# Set environment variables
|
|
25
|
-
ENV NODE_ENV=production
|
|
26
|
-
|
|
27
|
-
# Copy necessary files from builder
|
|
28
|
-
COPY --from=builder /app/next.config.ts ./
|
|
29
|
-
COPY --from=builder /app/public ./public
|
|
30
|
-
COPY --from=builder /app/.next/standalone ./
|
|
31
|
-
COPY --from=builder /app/.next/static ./.next/static
|
|
32
|
-
|
|
33
|
-
# Expose the port the app runs on
|
|
34
|
-
EXPOSE 3000
|
|
35
|
-
|
|
36
|
-
# Command to run the application
|
|
37
|
-
CMD ["node", "server.js"]
|
package/components.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://ui.shadcn.com/schema.json",
|
|
3
|
-
"style": "new-york",
|
|
4
|
-
"rsc": true,
|
|
5
|
-
"tsx": true,
|
|
6
|
-
"tailwind": {
|
|
7
|
-
"config": "",
|
|
8
|
-
"css": "src/app/globals.css",
|
|
9
|
-
"baseColor": "neutral",
|
|
10
|
-
"cssVariables": true,
|
|
11
|
-
"prefix": ""
|
|
12
|
-
},
|
|
13
|
-
"aliases": {
|
|
14
|
-
"components": "@/components",
|
|
15
|
-
"utils": "@/lib/utils",
|
|
16
|
-
"ui": "@/components/ui",
|
|
17
|
-
"lib": "@/lib",
|
|
18
|
-
"hooks": "@/hooks"
|
|
19
|
-
},
|
|
20
|
-
"iconLibrary": "lucide"
|
|
21
|
-
}
|
package/eslint.config.mjs
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { dirname } from "path";
|
|
2
|
-
import { fileURLToPath } from "url";
|
|
3
|
-
import { FlatCompat } from "@eslint/eslintrc";
|
|
4
|
-
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = dirname(__filename);
|
|
7
|
-
|
|
8
|
-
const compat = new FlatCompat({
|
|
9
|
-
baseDirectory: __dirname,
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
const eslintConfig = [
|
|
13
|
-
...compat.extends("next/core-web-vitals", "next/typescript"),
|
|
14
|
-
];
|
|
15
|
-
|
|
16
|
-
export default eslintConfig;
|