@donotdev/cli 0.0.13 → 0.0.15
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/dependencies-matrix.json +357 -89
- package/dist/bin/commands/agent-setup.d.ts +6 -0
- package/dist/bin/commands/agent-setup.d.ts.map +1 -0
- package/dist/bin/commands/agent-setup.js +629 -0
- package/dist/bin/commands/agent-setup.js.map +1 -0
- package/dist/bin/commands/build.js +131 -50
- package/dist/bin/commands/bump.js +137 -49
- package/dist/bin/commands/cacheout.js +50 -21
- package/dist/bin/commands/create-app.js +270 -261
- package/dist/bin/commands/create-project.js +418 -197
- package/dist/bin/commands/deploy.js +1752 -712
- package/dist/bin/commands/dev.js +151 -35
- package/dist/bin/commands/emu.js +228 -70
- package/dist/bin/commands/format.js +50 -21
- package/dist/bin/commands/lint.js +50 -21
- package/dist/bin/commands/preview.js +155 -35
- package/dist/bin/commands/supabase-setup.d.ts +6 -0
- package/dist/bin/commands/supabase-setup.d.ts.map +1 -0
- package/dist/bin/commands/supabase-setup.js +7 -0
- package/dist/bin/commands/supabase-setup.js.map +1 -0
- package/dist/bin/commands/sync-secrets.js +224 -46
- package/dist/bin/commands/type-check.d.ts +14 -0
- package/dist/bin/commands/type-check.d.ts.map +1 -0
- package/dist/bin/commands/type-check.js +314 -0
- package/dist/bin/commands/type-check.js.map +1 -0
- package/dist/bin/commands/wai.js +7399 -11
- package/dist/bin/dndev.js +27 -2
- package/dist/bin/donotdev.js +27 -2
- package/dist/index.js +3960 -2996
- package/package.json +2 -2
- package/templates/app-demo/src/App.tsx.example +1 -0
- package/templates/app-demo/src/pages/FullPage.tsx.example +2 -2
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +2 -2
- package/templates/app-demo/src/themes.css.example +5 -12
- package/templates/app-expo/.env.example +64 -0
- package/templates/app-expo/.expo/README.md.example +5 -0
- package/templates/app-expo/.gitignore.example +36 -0
- package/templates/app-expo/README.md.example +58 -0
- package/templates/app-expo/app/.gitkeep +2 -0
- package/templates/app-expo/app/_layout.tsx.example +41 -0
- package/templates/app-expo/app/form.tsx.example +52 -0
- package/templates/app-expo/app/index.tsx.example +89 -0
- package/templates/app-expo/app/list.tsx.example +32 -0
- package/templates/app-expo/app/profile.tsx.example +76 -0
- package/templates/app-expo/app/signin.tsx.example +53 -0
- package/templates/app-expo/app.json.example +39 -0
- package/templates/app-expo/babel.config.js.example +10 -0
- package/templates/app-expo/eas.json.example +20 -0
- package/templates/app-expo/expo-env.d.ts.example +4 -0
- package/templates/app-expo/metro.config.js.example +20 -0
- package/templates/app-expo/service-account-key.json.example +12 -0
- package/templates/app-expo/tsconfig.json.example +19 -0
- package/templates/app-next/.env.example +4 -33
- package/templates/app-next/src/app/ClientLayout.tsx.example +2 -0
- package/templates/app-next/src/app/layout.tsx.example +7 -6
- package/templates/app-next/src/globals.css.example +2 -11
- package/templates/app-next/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-next/src/themes.css.example +10 -13
- package/templates/app-vite/.env.example +3 -32
- package/templates/app-vite/index.html.example +2 -24
- package/templates/app-vite/src/App.tsx.example +2 -0
- package/templates/app-vite/src/globals.css.example +2 -12
- package/templates/app-vite/src/pages/FormPageExample.tsx.example +1 -2
- package/templates/app-vite/src/pages/HomePage.tsx.example +1 -1
- package/templates/app-vite/src/themes.css.example +109 -79
- package/templates/app-vite/vercel.json.example +11 -0
- package/templates/functions-firebase/build.mjs.example +2 -72
- package/templates/functions-firebase/functions-firebase/.env.example.example +23 -25
- package/templates/functions-firebase/functions-firebase/build.mjs.example +2 -72
- package/templates/functions-firebase/functions-firebase/tsconfig.json.example +1 -1
- package/templates/functions-supabase/supabase/functions/cancel-subscription/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/change-plan/index.ts.example +11 -0
- package/templates/functions-supabase/supabase/functions/create-checkout-session/index.ts.example +11 -0
- package/templates/functions-supabase/supabase/functions/create-customer-portal/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/crud/index.ts.example +16 -0
- package/templates/functions-supabase/supabase/functions/delete-account/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-user-auth-status/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/refresh-subscription-status/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/remove-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/set-custom-claims/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +24 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +22 -0
- package/templates/functions-supabase/supabase/migrations/20250101000002_cleanup_jobs.sql +28 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +28 -0
- package/templates/functions-vercel/functions-vercel/tsconfig.json.example +1 -1
- package/templates/functions-vercel/functions-vercel/vercel.json.example +1 -1
- package/templates/functions-vercel/vercel.json.example +1 -1
- package/templates/github/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/github/workflows/firebase-deploy.yml.example +1 -1
- package/templates/overlay-firebase/env.fragment.example +34 -0
- package/templates/overlay-firebase/env.fragment.expo.example +34 -0
- package/templates/overlay-firebase/env.fragment.nextjs.example +34 -0
- package/templates/overlay-firebase/src/config/providers.expo.ts.example +49 -0
- package/templates/overlay-firebase/src/config/providers.ts.example +23 -0
- package/templates/overlay-supabase/env.fragment.example +7 -0
- package/templates/overlay-supabase/env.fragment.expo.example +7 -0
- package/templates/overlay-supabase/env.fragment.nextjs.example +7 -0
- package/templates/overlay-supabase/src/config/providers.expo.ts.example +35 -0
- package/templates/overlay-supabase/src/config/providers.ts.example +33 -0
- package/templates/overlay-supabase/vercel.headers.example +23 -0
- package/templates/overlay-supabase/vercel.json.example +22 -0
- package/templates/overlay-vercel/env.fragment.example +34 -0
- package/templates/overlay-vercel/env.fragment.nextjs.example +34 -0
- package/templates/overlay-vercel/src/config/providers.ts.example +24 -0
- package/templates/root-consumer/.claude/agents/architect.md.example +2 -310
- package/templates/root-consumer/.claude/agents/builder.md.example +2 -326
- package/templates/root-consumer/.claude/agents/coder.md.example +2 -83
- package/templates/root-consumer/.claude/agents/extractor.md.example +2 -231
- package/templates/root-consumer/.claude/agents/polisher.md.example +2 -132
- package/templates/root-consumer/.claude/agents/prompt-engineer.md.example +2 -81
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +1 -1
- package/templates/root-consumer/.claude/commands/build.md.example +1 -1
- package/templates/root-consumer/.claude/commands/design.md.example +1 -1
- package/templates/root-consumer/.claude/commands/grill.md.example +30 -0
- package/templates/root-consumer/.claude/commands/polish.md.example +1 -1
- package/templates/root-consumer/.claude/commands/techdebt.md.example +28 -0
- package/templates/root-consumer/.clinerules.example +1 -0
- package/templates/root-consumer/.cursor/rules/no-docs.mdc.example +15 -0
- package/templates/root-consumer/.cursorrules.example +1 -0
- package/templates/root-consumer/.dndev/args.json.example +6 -0
- package/templates/root-consumer/.gemini/settings.json.example +2 -2
- package/templates/root-consumer/.github/copilot-instructions.md.example +1 -0
- package/templates/root-consumer/.windsurfrules.example +1 -0
- package/templates/root-consumer/AI.md.example +25 -108
- package/templates/root-consumer/CLAUDE.md.example +1 -128
- package/templates/root-consumer/CONVENTIONS.md.example +1 -0
- package/templates/root-consumer/GEMINI.md.example +1 -0
- package/templates/root-consumer/firebase.json.example +1 -1
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +54 -0
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +0 -18
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +1 -1
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +99 -30
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +186 -0
- package/templates/root-consumer/guides/dndev/INDEX.md.example +4 -1
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +143 -12
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +9 -3
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +12 -7
- package/templates/root-consumer/guides/dndev/SETUP_SOC2.md.example +234 -0
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +124 -0
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +6 -2
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +176 -0
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +5 -9
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +174 -0
- package/templates/root-consumer/guides/wai-way/agents/builder.md.example +10 -0
- package/templates/root-consumer/guides/wai-way/agents/extractor.md.example +25 -5
- package/templates/root-consumer/guides/wai-way/agents/polisher.md.example +13 -2
- package/templates/root-consumer/guides/wai-way/blueprints/0_brainstorm.md.example +2 -2
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +47 -11
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +15 -4
- package/templates/root-consumer/guides/wai-way/spec_template.md.example +7 -6
- package/templates/app-payload/.env.example +0 -28
- package/templates/app-payload/README.md.example +0 -233
- package/templates/app-payload/collections/Company.ts.example +0 -125
- package/templates/app-payload/collections/Hero.ts.example +0 -62
- package/templates/app-payload/collections/Media.ts.example +0 -41
- package/templates/app-payload/collections/Products.ts.example +0 -115
- package/templates/app-payload/collections/Services.ts.example +0 -104
- package/templates/app-payload/collections/Testimonials.ts.example +0 -92
- package/templates/app-payload/collections/Users.ts.example +0 -35
- package/templates/app-payload/src/server.ts.example +0 -79
- package/templates/app-payload/tsconfig.json.example +0 -24
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
| **Primary User** | _(Who uses this daily?)_ |
|
|
15
15
|
| **Secondary Users** | _(Who else interacts?)_ |
|
|
16
16
|
| **Core Value** | _(What problem does it solve?)_ |
|
|
17
|
+
| **Aesthetic Essence** | SaaS (Default) / Luxury / Brutalist / Custom |
|
|
17
18
|
|
|
18
19
|
---
|
|
19
20
|
|
|
@@ -275,13 +276,13 @@ _(Copy entity template for each entity)_
|
|
|
275
276
|
|
|
276
277
|
---
|
|
277
278
|
|
|
278
|
-
## 11.
|
|
279
|
+
## 11. Design Decisions & Overrides
|
|
280
|
+
> **CRITICAL:** These are intentional deviations from framework UX heuristics (e.g., 3-click rule, 70/30 hierarchy).
|
|
281
|
+
> **FOR AGENTS:** If a layout choice is documented here, do NOT challenge or flag it during the Build or Polish phases.
|
|
279
282
|
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
- [ ]
|
|
284
|
-
- [ ]
|
|
283
|
+
| Target (Page/Feature) | Override Description | Rationale |
|
|
284
|
+
|-----------------------|----------------------|-----------|
|
|
285
|
+
| | | |
|
|
285
286
|
|
|
286
287
|
---
|
|
287
288
|
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
# Payload CMS Configuration
|
|
2
|
-
PAYLOAD_SECRET=your-super-secret-key-here
|
|
3
|
-
PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3001
|
|
4
|
-
|
|
5
|
-
# Database Configuration (MongoDB)
|
|
6
|
-
MONGODB_URI=mongodb://localhost:27017/{{projectName}}
|
|
7
|
-
|
|
8
|
-
# For production, use MongoDB Atlas or similar
|
|
9
|
-
# MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/{{projectName}}?retryWrites=true&w=majority
|
|
10
|
-
|
|
11
|
-
# Optional: Redis for caching (recommended for production)
|
|
12
|
-
# REDIS_URL=redis://localhost:6379
|
|
13
|
-
|
|
14
|
-
# CORS Origins (comma-separated)
|
|
15
|
-
CORS_ORIGINS=http://localhost:3000,https://{{projectName}}.com,https://admin.{{projectName}}.com
|
|
16
|
-
|
|
17
|
-
# File Upload Configuration
|
|
18
|
-
PAYLOAD_PUBLIC_MAX_FILE_SIZE=5000000
|
|
19
|
-
|
|
20
|
-
# Admin Configuration
|
|
21
|
-
PAYLOAD_PUBLIC_ADMIN_EMAIL=admin@{{projectName}}.com
|
|
22
|
-
PAYLOAD_PUBLIC_ADMIN_PASSWORD=your-admin-password
|
|
23
|
-
|
|
24
|
-
# Optional: Email Configuration (for notifications)
|
|
25
|
-
# SMTP_HOST=smtp.gmail.com
|
|
26
|
-
# SMTP_PORT=587
|
|
27
|
-
# SMTP_USER=your-email@gmail.com
|
|
28
|
-
# SMTP_PASS=your-app-password
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
# {{projectName}} CMS (Payload)
|
|
2
|
-
|
|
3
|
-
This is a **Payload CMS** application that provides a professional content management system for your business website.
|
|
4
|
-
|
|
5
|
-
## 🚀 What is Payload CMS?
|
|
6
|
-
|
|
7
|
-
Payload is a **headless CMS** that gives you:
|
|
8
|
-
- **Database** - Stores all your content (text, images, etc.)
|
|
9
|
-
- **Admin Interface** - Professional web interface for editing content
|
|
10
|
-
- **API** - Your website fetches content via REST API calls
|
|
11
|
-
- **Media Library** - Upload and manage images/files
|
|
12
|
-
|
|
13
|
-
## 📁 Project Structure
|
|
14
|
-
|
|
15
|
-
```
|
|
16
|
-
{{appName}}/
|
|
17
|
-
├── collections/ # Content types (Hero, Services, Products, etc.)
|
|
18
|
-
│ ├── Users.ts # Admin users authentication
|
|
19
|
-
│ ├── Media.ts # File uploads and media management
|
|
20
|
-
│ ├── Hero.ts # Landing page hero section
|
|
21
|
-
│ ├── Services.ts # Business services
|
|
22
|
-
│ ├── Products.ts # Product offerings
|
|
23
|
-
│ ├── Testimonials.ts # Client feedback
|
|
24
|
-
│ └── Company.ts # Company information
|
|
25
|
-
├── src/
|
|
26
|
-
│ └── server.ts # Express server with Payload
|
|
27
|
-
├── payload.config.ts # Payload configuration
|
|
28
|
-
├── package.json # Dependencies and scripts
|
|
29
|
-
└── .env # Environment variables
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## 🛠️ Content Types
|
|
33
|
-
|
|
34
|
-
### 1. **Hero Section** (`/admin/collections/hero`)
|
|
35
|
-
- **Title** - Main headline
|
|
36
|
-
- **Subtitle** - Supporting text
|
|
37
|
-
- **CTA Button** - Call-to-action text and link
|
|
38
|
-
- **Background Image** - Hero background
|
|
39
|
-
|
|
40
|
-
### 2. **Services** (`/admin/collections/services`)
|
|
41
|
-
- **Name** - Service name
|
|
42
|
-
- **Description** - Detailed description
|
|
43
|
-
- **Category** - Consulting, Training, Development, Support
|
|
44
|
-
- **Features** - List of service features
|
|
45
|
-
- **Pricing** - Pricing information
|
|
46
|
-
- **Icon** - Service icon
|
|
47
|
-
|
|
48
|
-
### 3. **Products** (`/admin/collections/products`)
|
|
49
|
-
- **Name** - Product name
|
|
50
|
-
- **Description** - Product description
|
|
51
|
-
- **Category** - Framework, Tool, Platform, Service
|
|
52
|
-
- **Features** - Key product features
|
|
53
|
-
- **Demo Link** - Live demo URL
|
|
54
|
-
- **Documentation** - Documentation link
|
|
55
|
-
- **GitHub** - Repository link
|
|
56
|
-
|
|
57
|
-
### 4. **Testimonials** (`/admin/collections/testimonials`)
|
|
58
|
-
- **Client Name** - Client's name
|
|
59
|
-
- **Company** - Company name
|
|
60
|
-
- **Quote** - Testimonial text
|
|
61
|
-
- **Rating** - 1-5 star rating
|
|
62
|
-
- **Avatar** - Client photo
|
|
63
|
-
- **Project** - Related project
|
|
64
|
-
|
|
65
|
-
### 5. **Company Info** (`/admin/collections/company`)
|
|
66
|
-
- **Name** - Company name
|
|
67
|
-
- **Contact** - Email, phone, address
|
|
68
|
-
- **Social Media** - LinkedIn, Twitter, GitHub, etc.
|
|
69
|
-
- **Logo** - Company logo
|
|
70
|
-
- **Favicon** - Website favicon
|
|
71
|
-
|
|
72
|
-
## 🚀 Quick Start
|
|
73
|
-
|
|
74
|
-
### 1. Install Dependencies
|
|
75
|
-
```bash
|
|
76
|
-
bun install
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### 2. Set Up Environment
|
|
80
|
-
```bash
|
|
81
|
-
cp .env.example .env
|
|
82
|
-
# Edit .env with your configuration
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### 3. Set Up Database
|
|
86
|
-
**Option A: Local MongoDB**
|
|
87
|
-
```bash
|
|
88
|
-
# Install MongoDB locally or use Docker
|
|
89
|
-
docker run -d -p 27017:27017 --name mongodb mongo:latest
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**Option B: MongoDB Atlas (Recommended)**
|
|
93
|
-
- Create account at [MongoDB Atlas](https://www.mongodb.com/atlas)
|
|
94
|
-
- Create cluster and get connection string
|
|
95
|
-
- Update `MONGODB_URI` in `.env`
|
|
96
|
-
|
|
97
|
-
### 4. Start Development Server
|
|
98
|
-
```bash
|
|
99
|
-
bun run dev
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
### 5. Access Admin Panel
|
|
103
|
-
- **URL**: http://localhost:3001/admin
|
|
104
|
-
- **Email**: admin@{{projectName}}.com
|
|
105
|
-
- **Password**: your-admin-password (from .env)
|
|
106
|
-
|
|
107
|
-
## 🔗 API Endpoints
|
|
108
|
-
|
|
109
|
-
### Content API
|
|
110
|
-
- **Hero**: `GET /api/hero`
|
|
111
|
-
- **Services**: `GET /api/services`
|
|
112
|
-
- **Products**: `GET /api/products`
|
|
113
|
-
- **Testimonials**: `GET /api/testimonials`
|
|
114
|
-
- **Company**: `GET /api/company`
|
|
115
|
-
|
|
116
|
-
### Example API Call
|
|
117
|
-
```javascript
|
|
118
|
-
// Fetch hero content
|
|
119
|
-
const response = await fetch('http://localhost:3001/api/hero');
|
|
120
|
-
const heroData = await response.json();
|
|
121
|
-
console.log(heroData.docs[0]); // Latest hero content
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
## 🎯 How It Works
|
|
125
|
-
|
|
126
|
-
### 1. **Content Management**
|
|
127
|
-
- Login to admin panel at `/admin`
|
|
128
|
-
- Edit content using the professional interface
|
|
129
|
-
- Save changes instantly
|
|
130
|
-
|
|
131
|
-
### 2. **Content Delivery**
|
|
132
|
-
- Your website makes API calls to fetch content
|
|
133
|
-
- Content is returned as JSON
|
|
134
|
-
- Website displays the content dynamically
|
|
135
|
-
|
|
136
|
-
### 3. **Real-time Updates**
|
|
137
|
-
- Changes in admin appear immediately on website
|
|
138
|
-
- No code deployment needed
|
|
139
|
-
- Non-developers can update content
|
|
140
|
-
|
|
141
|
-
## 🔧 Configuration
|
|
142
|
-
|
|
143
|
-
### Environment Variables
|
|
144
|
-
```bash
|
|
145
|
-
# Required
|
|
146
|
-
PAYLOAD_SECRET=your-secret-key
|
|
147
|
-
MONGODB_URI=mongodb://localhost:27017/{{projectName}}
|
|
148
|
-
|
|
149
|
-
# Optional
|
|
150
|
-
PAYLOAD_PUBLIC_SERVER_URL=http://localhost:3001
|
|
151
|
-
CORS_ORIGINS=http://localhost:3000,https://{{projectName}}.com
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
### Customization
|
|
155
|
-
- **Add new content types**: Create new files in `collections/`
|
|
156
|
-
- **Modify fields**: Edit field definitions in collection files
|
|
157
|
-
- **Change admin UI**: Customize admin interface in `payload.config.ts`
|
|
158
|
-
|
|
159
|
-
## 🚀 Deployment
|
|
160
|
-
|
|
161
|
-
### Vercel Deployment
|
|
162
|
-
1. **Connect to Vercel**
|
|
163
|
-
2. **Set environment variables** in Vercel dashboard
|
|
164
|
-
3. **Deploy** - Vercel will build and deploy automatically
|
|
165
|
-
|
|
166
|
-
### Environment Variables for Production
|
|
167
|
-
```bash
|
|
168
|
-
PAYLOAD_SECRET=your-production-secret
|
|
169
|
-
MONGODB_URI=mongodb+srv://username:password@cluster.mongodb.net/{{projectName}}
|
|
170
|
-
PAYLOAD_PUBLIC_SERVER_URL=https://admin.{{projectName}}.com
|
|
171
|
-
CORS_ORIGINS=https://{{projectName}}.com,https://admin.{{projectName}}.com
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
## 📊 Admin Features
|
|
175
|
-
|
|
176
|
-
- **User Management** - Create admin users
|
|
177
|
-
- **Media Library** - Upload and organize images
|
|
178
|
-
- **Content Versioning** - Track content changes
|
|
179
|
-
- **Draft/Published** - Preview before publishing
|
|
180
|
-
- **Rich Text Editor** - Format content easily
|
|
181
|
-
- **Image Optimization** - Automatic image resizing
|
|
182
|
-
- **File Upload** - Drag & drop file uploads
|
|
183
|
-
|
|
184
|
-
## 🔒 Security
|
|
185
|
-
|
|
186
|
-
- **Authentication** - Secure admin login
|
|
187
|
-
- **CORS Protection** - Configured for your domains
|
|
188
|
-
- **File Upload Limits** - 5MB file size limit
|
|
189
|
-
- **Input Validation** - All inputs validated
|
|
190
|
-
- **HTTPS Required** - Secure in production
|
|
191
|
-
|
|
192
|
-
## 🎨 Integration with Website
|
|
193
|
-
|
|
194
|
-
Your website (Next.js/Vite) connects to this CMS:
|
|
195
|
-
|
|
196
|
-
```typescript
|
|
197
|
-
// Example: Fetch hero content
|
|
198
|
-
const { data: hero } = await fetch('/api/hero').then(r => r.json());
|
|
199
|
-
|
|
200
|
-
// Example: Fetch services
|
|
201
|
-
const { data: services } = await fetch('/api/services?where[isActive][equals]=true').then(r => r.json());
|
|
202
|
-
|
|
203
|
-
// Example: Fetch testimonials
|
|
204
|
-
const { data: testimonials } = await fetch('/api/testimonials?sort=order').then(r => r.json());
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
## 🆘 Troubleshooting
|
|
208
|
-
|
|
209
|
-
### Common Issues
|
|
210
|
-
|
|
211
|
-
**"MongoDB connection failed"**
|
|
212
|
-
- Check `MONGODB_URI` in `.env`
|
|
213
|
-
- Ensure MongoDB is running
|
|
214
|
-
- Verify network connectivity
|
|
215
|
-
|
|
216
|
-
**"Admin panel not loading"**
|
|
217
|
-
- Check `PAYLOAD_SECRET` is set
|
|
218
|
-
- Verify `PAYLOAD_PUBLIC_SERVER_URL` is correct
|
|
219
|
-
- Check browser console for errors
|
|
220
|
-
|
|
221
|
-
**"API calls failing"**
|
|
222
|
-
- Verify CORS configuration
|
|
223
|
-
- Check server is running on correct port
|
|
224
|
-
- Ensure API endpoints are accessible
|
|
225
|
-
|
|
226
|
-
### Getting Help
|
|
227
|
-
- Check [Payload Documentation](https://payloadcms.com/docs)
|
|
228
|
-
- Review server logs for error messages
|
|
229
|
-
- Verify environment variables are set correctly
|
|
230
|
-
|
|
231
|
-
---
|
|
232
|
-
|
|
233
|
-
**That's it!** You now have a professional CMS that your website can use to fetch dynamic content. No more hardcoded text - everything is manageable through the admin interface.
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
import { CollectionConfig } from 'payload/types';
|
|
2
|
-
|
|
3
|
-
export const Company: CollectionConfig = {
|
|
4
|
-
slug: 'company',
|
|
5
|
-
admin: {
|
|
6
|
-
useAsTitle: 'name',
|
|
7
|
-
defaultColumns: ['name', 'email', 'phone', 'updatedAt'],
|
|
8
|
-
},
|
|
9
|
-
access: {
|
|
10
|
-
read: () => true,
|
|
11
|
-
},
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
type: 'text',
|
|
16
|
-
required: true,
|
|
17
|
-
admin: {
|
|
18
|
-
description: 'Company name',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'tagline',
|
|
23
|
-
type: 'text',
|
|
24
|
-
admin: {
|
|
25
|
-
description: 'Company tagline or slogan',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
name: 'description',
|
|
30
|
-
type: 'textarea',
|
|
31
|
-
admin: {
|
|
32
|
-
description: 'Company description for about page',
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: 'email',
|
|
37
|
-
type: 'email',
|
|
38
|
-
required: true,
|
|
39
|
-
admin: {
|
|
40
|
-
description: 'Primary contact email',
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
name: 'phone',
|
|
45
|
-
type: 'text',
|
|
46
|
-
admin: {
|
|
47
|
-
description: 'Contact phone number',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
name: 'address',
|
|
52
|
-
type: 'group',
|
|
53
|
-
fields: [
|
|
54
|
-
{
|
|
55
|
-
name: 'street',
|
|
56
|
-
type: 'text',
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
name: 'city',
|
|
60
|
-
type: 'text',
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
name: 'state',
|
|
64
|
-
type: 'text',
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
name: 'zip',
|
|
68
|
-
type: 'text',
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
name: 'country',
|
|
72
|
-
type: 'text',
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
admin: {
|
|
76
|
-
description: 'Company address',
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'social',
|
|
81
|
-
type: 'group',
|
|
82
|
-
fields: [
|
|
83
|
-
{
|
|
84
|
-
name: 'website',
|
|
85
|
-
type: 'text',
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
name: 'linkedin',
|
|
89
|
-
type: 'text',
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
name: 'twitter',
|
|
93
|
-
type: 'text',
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
name: 'github',
|
|
97
|
-
type: 'text',
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
name: 'youtube',
|
|
101
|
-
type: 'text',
|
|
102
|
-
},
|
|
103
|
-
],
|
|
104
|
-
admin: {
|
|
105
|
-
description: 'Social media links',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
name: 'logo',
|
|
110
|
-
type: 'upload',
|
|
111
|
-
relationTo: 'media',
|
|
112
|
-
admin: {
|
|
113
|
-
description: 'Company logo',
|
|
114
|
-
},
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
name: 'favicon',
|
|
118
|
-
type: 'upload',
|
|
119
|
-
relationTo: 'media',
|
|
120
|
-
admin: {
|
|
121
|
-
description: 'Website favicon',
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
],
|
|
125
|
-
};
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { CollectionConfig } from 'payload/types';
|
|
2
|
-
|
|
3
|
-
export const Hero: CollectionConfig = {
|
|
4
|
-
slug: 'hero',
|
|
5
|
-
admin: {
|
|
6
|
-
useAsTitle: 'title',
|
|
7
|
-
defaultColumns: ['title', 'subtitle', 'updatedAt'],
|
|
8
|
-
},
|
|
9
|
-
access: {
|
|
10
|
-
read: () => true,
|
|
11
|
-
},
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: 'title',
|
|
15
|
-
type: 'text',
|
|
16
|
-
required: true,
|
|
17
|
-
admin: {
|
|
18
|
-
description: 'Main headline for the hero section',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'subtitle',
|
|
23
|
-
type: 'textarea',
|
|
24
|
-
required: true,
|
|
25
|
-
admin: {
|
|
26
|
-
description: 'Supporting text below the main headline',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'ctaText',
|
|
31
|
-
type: 'text',
|
|
32
|
-
required: true,
|
|
33
|
-
admin: {
|
|
34
|
-
description: 'Call-to-action button text',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'ctaLink',
|
|
39
|
-
type: 'text',
|
|
40
|
-
required: true,
|
|
41
|
-
admin: {
|
|
42
|
-
description: 'Where the CTA button should link to',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
name: 'backgroundImage',
|
|
47
|
-
type: 'upload',
|
|
48
|
-
relationTo: 'media',
|
|
49
|
-
admin: {
|
|
50
|
-
description: 'Background image for the hero section',
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
name: 'isActive',
|
|
55
|
-
type: 'checkbox',
|
|
56
|
-
defaultValue: true,
|
|
57
|
-
admin: {
|
|
58
|
-
description: 'Whether this hero content should be displayed',
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
};
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { CollectionConfig } from 'payload/types';
|
|
2
|
-
|
|
3
|
-
export const Media: CollectionConfig = {
|
|
4
|
-
slug: 'media',
|
|
5
|
-
upload: {
|
|
6
|
-
staticDir: '../public/media',
|
|
7
|
-
imageSizes: [
|
|
8
|
-
{
|
|
9
|
-
name: 'thumbnail',
|
|
10
|
-
width: 400,
|
|
11
|
-
height: 300,
|
|
12
|
-
position: 'centre',
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
name: 'card',
|
|
16
|
-
width: 768,
|
|
17
|
-
height: 1024,
|
|
18
|
-
position: 'centre',
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: 'hero',
|
|
22
|
-
width: 1920,
|
|
23
|
-
height: 1080,
|
|
24
|
-
position: 'centre',
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
adminThumbnail: 'thumbnail',
|
|
28
|
-
mimeTypes: ['image/*'],
|
|
29
|
-
},
|
|
30
|
-
fields: [
|
|
31
|
-
{
|
|
32
|
-
name: 'alt',
|
|
33
|
-
type: 'text',
|
|
34
|
-
required: true,
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'caption',
|
|
38
|
-
type: 'text',
|
|
39
|
-
},
|
|
40
|
-
],
|
|
41
|
-
};
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { CollectionConfig } from 'payload/types';
|
|
2
|
-
|
|
3
|
-
export const Products: CollectionConfig = {
|
|
4
|
-
slug: 'products',
|
|
5
|
-
admin: {
|
|
6
|
-
useAsTitle: 'name',
|
|
7
|
-
defaultColumns: ['name', 'category', 'isActive', 'updatedAt'],
|
|
8
|
-
},
|
|
9
|
-
access: {
|
|
10
|
-
read: () => true,
|
|
11
|
-
},
|
|
12
|
-
fields: [
|
|
13
|
-
{
|
|
14
|
-
name: 'name',
|
|
15
|
-
type: 'text',
|
|
16
|
-
required: true,
|
|
17
|
-
admin: {
|
|
18
|
-
description: 'Name of the product',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
name: 'description',
|
|
23
|
-
type: 'textarea',
|
|
24
|
-
required: true,
|
|
25
|
-
admin: {
|
|
26
|
-
description: 'Detailed description of the product',
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
name: 'shortDescription',
|
|
31
|
-
type: 'text',
|
|
32
|
-
required: true,
|
|
33
|
-
admin: {
|
|
34
|
-
description: 'Brief description for cards and previews',
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
name: 'category',
|
|
39
|
-
type: 'select',
|
|
40
|
-
required: true,
|
|
41
|
-
options: [
|
|
42
|
-
{ label: 'Framework', value: 'framework' },
|
|
43
|
-
{ label: 'Tool', value: 'tool' },
|
|
44
|
-
{ label: 'Platform', value: 'platform' },
|
|
45
|
-
{ label: 'Service', value: 'service' },
|
|
46
|
-
],
|
|
47
|
-
admin: {
|
|
48
|
-
description: 'Category of the product',
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: 'features',
|
|
53
|
-
type: 'array',
|
|
54
|
-
fields: [
|
|
55
|
-
{
|
|
56
|
-
name: 'feature',
|
|
57
|
-
type: 'text',
|
|
58
|
-
required: true,
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
name: 'description',
|
|
62
|
-
type: 'text',
|
|
63
|
-
},
|
|
64
|
-
],
|
|
65
|
-
admin: {
|
|
66
|
-
description: 'List of key features',
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
name: 'demoLink',
|
|
71
|
-
type: 'text',
|
|
72
|
-
admin: {
|
|
73
|
-
description: 'Link path live demo',
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
name: 'documentationLink',
|
|
78
|
-
type: 'text',
|
|
79
|
-
admin: {
|
|
80
|
-
description: 'Link path documentation',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
name: 'githubLink',
|
|
85
|
-
type: 'text',
|
|
86
|
-
admin: {
|
|
87
|
-
description: 'Link path GitHub repository',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: 'image',
|
|
92
|
-
type: 'upload',
|
|
93
|
-
relationTo: 'media',
|
|
94
|
-
admin: {
|
|
95
|
-
description: 'Product image or logo',
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
name: 'isActive',
|
|
100
|
-
type: 'checkbox',
|
|
101
|
-
defaultValue: true,
|
|
102
|
-
admin: {
|
|
103
|
-
description: 'Whether this product should be displayed',
|
|
104
|
-
},
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
name: 'order',
|
|
108
|
-
type: 'number',
|
|
109
|
-
defaultValue: 0,
|
|
110
|
-
admin: {
|
|
111
|
-
description: 'Display order (lower numbers appear first)',
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
],
|
|
115
|
-
};
|