shipd 0.1.4 → 0.2.0

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.
@@ -253,3 +253,77 @@ This module works independently and doesn't require other modules. However, it c
253
253
  ✅ **Well Documented** - Comprehensive integration guide
254
254
  ✅ **Smart Deduplication** - Won't overwrite existing components
255
255
 
256
+ ---
257
+
258
+ ## AI Integration Prompt
259
+
260
+ **For AI Assistants:** Use this prompt to understand and integrate the Documentation Pages module into an existing Next.js application.
261
+
262
+ ```
263
+ The Documentation Pages module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
264
+
265
+ **Installed Packages:**
266
+ - @radix-ui/react-slot@^1.1.0 - UI component primitives
267
+ - @radix-ui/react-dialog@^1.1.0 - Dialog component
268
+ - class-variance-authority@^0.7.0 - Component variant utilities
269
+ - clsx@^2.1.1 - Conditional class names
270
+ - tailwind-merge@^2.5.4 - Tailwind class merging
271
+ - lucide-react@^0.469.0 - Icon library
272
+ - react-markdown@^10.1.0 - Markdown rendering
273
+ - remark-gfm@^4.0.1 - GitHub Flavored Markdown support
274
+
275
+ **Files Added:**
276
+ - app/docs/page.tsx - Documentation home page
277
+ - app/docs/layout.tsx - Documentation layout with sidebar
278
+ - app/docs/[slug]/page.tsx - Category documentation pages
279
+ - app/docs/[slug]/[subslug]/page.tsx - Subcategory documentation pages
280
+ - app/docs/api/page.tsx - API documentation page
281
+ - app/docs/documentation/page.tsx - General documentation page
282
+ - components/docs/docs-sidebar.tsx - Documentation sidebar navigation
283
+ - components/docs/docs-header.tsx - Documentation page header
284
+ - components/docs/docs-toc.tsx - Table of contents component
285
+ - components/docs/docs-category-page.tsx - Category page layout
286
+ - components/docs/docs-code-card.tsx - Code example card component
287
+ - components/docs/docs-nav.ts - Navigation data structure
288
+ - components/ui/* - UI components (button, card, badge, sheet) if not exist
289
+ - lib/utils.ts - Utility functions (cn helper) if not exist
290
+
291
+ **Environment Variables Required:**
292
+ - None (module is self-contained)
293
+
294
+ **Integration Steps:**
295
+ 1. Verify app/docs/ directory exists with all page files
296
+ 2. Check that components/docs/ directory exists with all docs components
297
+ 3. Verify components/ui/ directory has required UI components (button, card, badge, sheet)
298
+ 4. Check that lib/utils.ts exists with cn() function
299
+ 5. Verify components/docs/docs-nav.ts has navigation structure
300
+ 6. Test docs pages: Visit /docs, /docs/api, /docs/[category], etc.
301
+ 7. Check sidebar navigation works and highlights current page
302
+
303
+ **Key Integration Points:**
304
+ - Navigation: components/docs/docs-nav.ts defines the documentation structure
305
+ - Layout: app/docs/layout.tsx provides sidebar and page structure
306
+ - Routing: Uses Next.js dynamic routes [slug] and [subslug] for nested pages
307
+ - Markdown: Pages can use react-markdown for content rendering
308
+ - Sidebar: components/docs/docs-sidebar.tsx reads from docs-nav.ts
309
+ - TOC: components/docs/docs-toc.tsx generates table of contents from headings
310
+ - Smart deduplication: UI components won't overwrite if they already exist
311
+
312
+ **Dependencies:**
313
+ - No dependencies on other Shipd modules
314
+ - Can be installed standalone
315
+
316
+ **Common Issues to Check:**
317
+ - If docs pages show 404: Verify app/docs/ directory structure and page.tsx files exist
318
+ - If UI components not found: Check components/ui/ directory, install missing dependencies
319
+ - If navigation not showing: Verify docs-nav.ts structure and sidebar imports
320
+ - If markdown not rendering: Ensure react-markdown and remark-gfm are installed
321
+
322
+ **Next Steps After Integration:**
323
+ - Customize navigation structure in components/docs/docs-nav.ts
324
+ - Update documentation content in app/docs/ pages
325
+ - Add your own documentation pages following the [slug]/[subslug] pattern
326
+ - Customize sidebar styling in docs-sidebar.tsx
327
+ - Update header content in docs-header.tsx
328
+ - Add code examples using docs-code-card.tsx component
329
+ ```
@@ -256,3 +256,61 @@ This module works well with:
256
256
  ✅ **Web Search** - Includes web search preview tool
257
257
  ✅ **Well Documented** - Comprehensive integration guide
258
258
 
259
+ ---
260
+
261
+ ## AI Integration Prompt
262
+
263
+ **For AI Assistants:** Use this prompt to understand and integrate the AI Chat module into an existing Next.js application.
264
+
265
+ ```
266
+ The AI Chat module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
267
+
268
+ **Installed Packages:**
269
+ - ai@^4.3.16 - Vercel AI SDK for streaming responses
270
+ - @ai-sdk/openai@^1.3.22 - OpenAI provider for AI SDK
271
+ - react-markdown@^10.1.0 - Markdown rendering for chat messages
272
+ - remark-gfm@^4.0.1 - GitHub Flavored Markdown support
273
+
274
+ **Files Added:**
275
+ - app/api/chat/route.ts - API route for streaming chat responses (POST handler)
276
+ - app/dashboard/chat/page.tsx - Full chat interface page with message history
277
+ - app/dashboard/_components/chatbot.tsx - Reusable chatbot widget component
278
+
279
+ **Environment Variables Required:**
280
+ - OPENAI_API_KEY - OpenAI API key (get from platform.openai.com)
281
+
282
+ **Integration Steps:**
283
+ 1. Verify app/api/chat/route.ts exists and exports POST handler
284
+ 2. Check that chat page exists: app/dashboard/chat/page.tsx
285
+ 3. Verify chatbot component exists: app/dashboard/_components/chatbot.tsx
286
+ 4. Ensure OPENAI_API_KEY is set in .env.local
287
+ 5. Test chat API: POST to /api/chat with messages array
288
+ 6. Test chat page: Visit /dashboard/chat
289
+ 7. If auth module installed: Verify chat routes are protected
290
+
291
+ **Key Integration Points:**
292
+ - API route: app/api/chat/route.ts uses streamText from ai SDK with OpenAI provider
293
+ - Streaming: Responses use toDataStreamResponse() for real-time streaming
294
+ - Chat UI: Uses useChat hook from ai/react for message management
295
+ - Markdown: Chat messages are rendered with react-markdown and remark-gfm
296
+ - Web search: Includes openai.tools.webSearchPreview() by default
297
+ - Model: Uses gpt-4o by default (configurable in route.ts)
298
+
299
+ **Dependencies:**
300
+ - OPTIONAL: Auth module (for protecting chat routes)
301
+ - No hard dependencies on other Shipd modules
302
+
303
+ **Common Issues to Check:**
304
+ - If "OPENAI_API_KEY is not defined": Add API key to .env.local
305
+ - If streaming not working: Check API route returns toDataStreamResponse()
306
+ - If markdown not rendering: Ensure react-markdown and remark-gfm are installed
307
+ - If chat not responding: Verify OpenAI API key is valid and has credits
308
+
309
+ **Next Steps After Integration:**
310
+ - Get OpenAI API key from platform.openai.com
311
+ - Add OPENAI_API_KEY to .env.local
312
+ - Test chat interface at /dashboard/chat
313
+ - Customize model in app/api/chat/route.ts (default: gpt-4o)
314
+ - Add chatbot widget to other pages if desired
315
+ - Configure rate limiting for production
316
+ ```
@@ -306,3 +306,59 @@ This module works well with:
306
306
  ✅ **User Analytics** - User identification and tracking
307
307
  ✅ **Well Documented** - Comprehensive integration guide
308
308
 
309
+ ---
310
+
311
+ ## AI Integration Prompt
312
+
313
+ **For AI Assistants:** Use this prompt to understand and integrate the Analytics module into an existing Next.js application.
314
+
315
+ ```
316
+ The Analytics module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
317
+
318
+ **Installed Packages:**
319
+ - posthog-js@^1.248.1 - PostHog client-side SDK
320
+ - posthog-node@^4.18.0 - PostHog server-side SDK
321
+
322
+ **Files Added:**
323
+ - lib/posthog.ts - PostHog initialization and provider wrapper
324
+
325
+ **Environment Variables Required:**
326
+ - NEXT_PUBLIC_POSTHOG_KEY - PostHog project API key
327
+ - NEXT_PUBLIC_POSTHOG_HOST - PostHog host (default: https://app.posthog.com)
328
+
329
+ **Integration Steps:**
330
+ 1. Verify lib/posthog.ts exists with PostHogProviderWrapper component
331
+ 2. Check that PostHogProviderWrapper is added to app/layout.tsx
332
+ 3. Ensure NEXT_PUBLIC_POSTHOG_KEY is set in .env.local
333
+ 4. Verify PostHog is initialized in lib/posthog.ts
334
+ 5. Test pageview tracking: Visit pages and check PostHog dashboard
335
+ 6. Test custom events: Use usePostHog hook to capture events
336
+ 7. If auth module installed: Identify users when they sign in
337
+
338
+ **Key Integration Points:**
339
+ - Provider wrapper: PostHogProviderWrapper must wrap app in app/layout.tsx
340
+ - Client-side: Use usePostHog hook from 'posthog-js/react' in client components
341
+ - Server-side: Import PostHog from 'posthog-node' for server-side tracking
342
+ - User identification: Call posthog.identify(userId, properties) when user signs in
343
+ - Feature flags: Use posthog.isFeatureEnabled('flag-name') to check flags
344
+ - Automatic tracking: Pageviews are tracked automatically
345
+
346
+ **Dependencies:**
347
+ - OPTIONAL: Auth module (for user identification)
348
+ - No hard dependencies on other Shipd modules
349
+
350
+ **Common Issues to Check:**
351
+ - If "NEXT_PUBLIC_POSTHOG_KEY is not defined": Add API key to .env.local (must start with NEXT_PUBLIC_)
352
+ - If events not showing: Verify PostHog provider is in root layout, check browser console
353
+ - If feature flags not working: Ensure flags are enabled in PostHog dashboard, identify users first
354
+ - If server-side tracking fails: Check posthog-node is imported correctly
355
+
356
+ **Next Steps After Integration:**
357
+ - Get PostHog API key from posthog.com
358
+ - Add NEXT_PUBLIC_POSTHOG_KEY to .env.local
359
+ - Wrap app with PostHogProviderWrapper in app/layout.tsx
360
+ - Test pageview tracking
361
+ - Identify users when they sign in (if auth module installed)
362
+ - Set up feature flags in PostHog dashboard
363
+ - Track custom events throughout your app
364
+ ```
@@ -334,3 +334,76 @@ This module works well with:
334
334
  ✅ **UI Components** - Uses base package components
335
335
  ✅ **Well Documented** - Comprehensive integration guide
336
336
 
337
+ ---
338
+
339
+ ## AI Integration Prompt
340
+
341
+ **For AI Assistants:** Use this prompt to understand and integrate the Authentication module into an existing Next.js application.
342
+
343
+ ```
344
+ The Authentication module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
345
+
346
+ **Installed Packages:**
347
+ - better-auth@^1.0.0 - Modern authentication library
348
+ - @polar-sh/better-auth@^1.0.0 - Polar.sh integration for Better Auth
349
+ - sonner@^1.7.0 - Toast notifications (for auth feedback)
350
+
351
+ **Files Added:**
352
+ - app/api/auth/[...all]/route.ts - Auth API route handler (catch-all)
353
+ - app/sign-in/page.tsx - Sign-in page with email/password and Google OAuth
354
+ - app/sign-up/page.tsx - Sign-up page with email/password and Google OAuth
355
+ - app/dashboard/page.tsx - Basic dashboard page (protected route example)
356
+ - app/dashboard/layout.tsx - Dashboard layout wrapper
357
+ - lib/auth.ts - Better Auth server configuration
358
+ - lib/auth-client.ts - Client-side auth utilities
359
+ - auth-schema.ts - Drizzle schema definitions (user, session, account, verification tables)
360
+ - middleware.patch.ts - Middleware logic for route protection
361
+
362
+ **Schema Tables Added to db/schema.ts:**
363
+ - user - User accounts
364
+ - session - Active user sessions
365
+ - account - OAuth account links
366
+ - verification - Email verification tokens
367
+
368
+ **Environment Variables Required:**
369
+ - BETTER_AUTH_SECRET - Secret key for auth (generate with: openssl rand -base64 32)
370
+ - GOOGLE_CLIENT_ID - Google OAuth client ID
371
+ - GOOGLE_CLIENT_SECRET - Google OAuth client secret
372
+ - NEXT_PUBLIC_APP_URL - Application URL (e.g., http://localhost:3000)
373
+ - DATABASE_URL - Required (from database module)
374
+
375
+ **Integration Steps:**
376
+ 1. Verify database module is installed. Auth requires database for user/session storage.
377
+ 2. Check that auth tables (user, session, account, verification) were merged into db/schema.ts
378
+ 3. Verify middleware.ts includes auth protection logic (import getSessionCookie, protect routes)
379
+ 4. Ensure lib/auth.ts imports subscription table dynamically (only if payments module installed)
380
+ 5. Check that app/api/auth/[...all]/route.ts exports GET and POST handlers
381
+ 6. Verify environment variables are set in .env.local
382
+ 7. Run database migrations: npm run db:push (to create auth tables)
383
+
384
+ **Key Integration Points:**
385
+ - Middleware protection: middleware.ts must import getSessionCookie from "better-auth/cookies"
386
+ - Protected routes are defined in middleware.ts (default: /dashboard/*)
387
+ - Server-side auth: import { auth } from "@/lib/auth", then await auth() to get session
388
+ - Client-side auth: import { authClient } from "@/lib/auth-client" for client components
389
+ - Schema merging: auth-schema.ts tables are automatically merged into db/schema.ts during append
390
+ - Email stubs: lib/email.ts contains stubs; full email module replaces these with real functions
391
+
392
+ **Dependencies:**
393
+ - REQUIRES: Database module (for user/session storage)
394
+ - OPTIONAL: Email module (for password reset emails)
395
+ - OPTIONAL: Payments module (for subscription-based access)
396
+
397
+ **Common Issues to Check:**
398
+ - If "getSessionCookie is not defined" error: middleware.ts needs import from "better-auth/cookies"
399
+ - If "subscription is not exported" error: This is normal if payments module not installed (auth handles this)
400
+ - If Google OAuth fails: Check redirect URI matches in Google Cloud Console
401
+ - If database errors: Ensure DATABASE_URL is set and migrations are run
402
+
403
+ **Next Steps After Integration:**
404
+ - Test sign-up flow: Visit /sign-up and create an account
405
+ - Test sign-in flow: Visit /sign-in and authenticate
406
+ - Test protected routes: Visit /dashboard (should redirect if not authenticated)
407
+ - If email module installed: Password reset emails will work automatically
408
+ - If payments module installed: Subscription webhooks will integrate with auth
409
+ ```
@@ -254,3 +254,59 @@ This module works well with:
254
254
  ✅ **Ready to Use** - Works immediately after append
255
255
  ✅ **Well Documented** - Comprehensive integration guide
256
256
 
257
+ ---
258
+
259
+ ## AI Integration Prompt
260
+
261
+ **For AI Assistants:** Use this prompt to understand and integrate the Database module into an existing Next.js application.
262
+
263
+ ```
264
+ The Database module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
265
+
266
+ **Installed Packages:**
267
+ - postgres@^3.4.4 - PostgreSQL client library
268
+ - drizzle-orm@^0.41.0 - TypeScript ORM for PostgreSQL
269
+ - drizzle-kit@^0.31.0 (dev) - Migration and database management tools
270
+
271
+ **Files Added:**
272
+ - drizzle.config.ts - Drizzle Kit configuration for migrations
273
+ - db/drizzle.ts - Database connection setup with lazy initialization
274
+ - db/schema.ts - Base schema file (currently empty, ready for modules to add tables)
275
+ - db/migrations/ - Directory for database migration files
276
+
277
+ **Package Scripts Added:**
278
+ - npm run db:push - Push schema changes directly to database (development)
279
+ - npm run db:generate - Generate migration files from schema changes
280
+ - npm run db:migrate - Run pending migrations
281
+ - npm run db:studio - Open Drizzle Studio GUI at http://localhost:4983
282
+
283
+ **Environment Variables Required:**
284
+ - DATABASE_URL - PostgreSQL connection string (format: postgresql://user:password@host:port/database)
285
+
286
+ **Integration Steps:**
287
+ 1. Verify DATABASE_URL is set in .env.local. If missing, prompt user to add it.
288
+ 2. Check that db/drizzle.ts uses lazy connection pattern (allows app to run without DATABASE_URL configured).
289
+ 3. Verify db/schema.ts exists and is empty (other modules will add tables here).
290
+ 4. Ensure drizzle.config.ts points to correct schema path: "./db/schema.ts"
291
+ 5. Test database connection by running: npm run db:studio (if DATABASE_URL is set)
292
+
293
+ **Key Integration Points:**
294
+ - The database connection in db/drizzle.ts uses a Proxy pattern for lazy initialization
295
+ - Other modules (auth, payments) will automatically merge their tables into db/schema.ts
296
+ - The schema file should be imported as: import * as schema from "@/db/schema"
297
+ - Database queries use Drizzle ORM syntax: db.select().from(table).where(eq(table.id, value))
298
+
299
+ **Dependencies:**
300
+ - This module has no dependencies on other Shipd modules
301
+ - Other modules (auth, payments) require this module to be installed first
302
+
303
+ **Common Issues to Check:**
304
+ - If DATABASE_URL is missing, the app should still run (lazy connection), but database operations will fail
305
+ - For Supabase compatibility, connection uses { prepare: false } option
306
+ - Migration files are generated in db/migrations/ directory
307
+
308
+ **Next Steps After Integration:**
309
+ - If auth module is installed, it will add user/session/account/verification tables to schema
310
+ - If payments module is installed, it will add subscription table to schema
311
+ - After other modules add tables, run: npm run db:push to create tables in database
312
+ ```
@@ -280,3 +280,62 @@ This module works well with:
280
280
  ✅ **Ready to Use** - Works immediately after append
281
281
  ✅ **Well Documented** - Comprehensive integration guide
282
282
 
283
+ ---
284
+
285
+ ## AI Integration Prompt
286
+
287
+ **For AI Assistants:** Use this prompt to understand and integrate the Email module into an existing Next.js application.
288
+
289
+ ```
290
+ The Email module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
291
+
292
+ **Installed Packages:**
293
+ - resend@^6.6.0 - Resend email service SDK
294
+ - @react-email/components@^1.0.2 - React components for email templates
295
+ - @react-email/render@^2.0.0 - Render React components to HTML
296
+
297
+ **Files Added:**
298
+ - lib/email.ts - Email sending utilities with Resend integration
299
+ - emails/welcome.tsx - Welcome email template
300
+ - emails/password-reset.tsx - Password reset email template
301
+ - emails/subscription-confirmation.tsx - Subscription confirmation email template
302
+ - emails/payment-failed.tsx - Payment failed email template
303
+ - emails/components/layout.tsx - Shared email layout component
304
+
305
+ **Environment Variables Required:**
306
+ - RESEND_API_KEY - Resend API key (get from resend.com)
307
+ - EMAIL_FROM - Sender email address (e.g., "Your App <noreply@yourdomain.com>")
308
+
309
+ **Integration Steps:**
310
+ 1. Verify lib/email.ts exists and exports sendEmail, sendPasswordResetEmail, etc.
311
+ 2. Check that email templates exist in emails/ directory
312
+ 3. If auth module installed: lib/auth.ts should import email functions (auto-replaces stubs)
313
+ 4. If payments module installed: Subscription emails will work automatically
314
+ 5. Verify environment variables are set in .env.local
315
+ 6. Test email sending with a simple function call
316
+
317
+ **Key Integration Points:**
318
+ - Automatic replacement: Email module replaces auth module's email stubs automatically
319
+ - Template system: All emails use React Email components for consistent styling
320
+ - Email layout: emails/components/layout.tsx provides shared header/footer
321
+ - Function exports: lib/email.ts exports all email functions used by auth/payments
322
+ - Graceful fallback: If RESEND_API_KEY not set, emails log to console instead of failing
323
+
324
+ **Dependencies:**
325
+ - OPTIONAL: Auth module (for password reset emails)
326
+ - OPTIONAL: Payments module (for subscription/payment emails)
327
+ - No hard dependencies - can be installed standalone
328
+
329
+ **Common Issues to Check:**
330
+ - If emails not sending: Check RESEND_API_KEY is set and valid
331
+ - If "Invalid API key" error: Verify API key in Resend dashboard
332
+ - If emails not received: Check Resend dashboard for delivery status, verify sender domain
333
+ - If template errors: Ensure @react-email/components is installed
334
+
335
+ **Next Steps After Integration:**
336
+ - Get Resend API key from resend.com
337
+ - Add RESEND_API_KEY and EMAIL_FROM to .env.local
338
+ - Test email sending (password reset, welcome email, etc.)
339
+ - Customize email templates to match your brand
340
+ - Verify sender domain in Resend dashboard for production
341
+ ```
@@ -269,3 +269,61 @@ This module works well with:
269
269
  ✅ **Image Preview** - Gallery of uploaded images
270
270
  ✅ **Well Documented** - Comprehensive integration guide
271
271
 
272
+ ---
273
+
274
+ ## AI Integration Prompt
275
+
276
+ **For AI Assistants:** Use this prompt to understand and integrate the File Upload module into an existing Next.js application.
277
+
278
+ ```
279
+ The File Upload module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
280
+
281
+ **Installed Packages:**
282
+ - @aws-sdk/client-s3@^3.800.0 - AWS SDK for S3-compatible storage (Cloudflare R2)
283
+
284
+ **Files Added:**
285
+ - app/api/upload-image/route.ts - API route for handling image uploads (POST handler)
286
+ - app/dashboard/upload/page.tsx - File upload interface with drag-and-drop
287
+ - lib/upload-image.ts - R2 upload utility functions
288
+
289
+ **Environment Variables Required:**
290
+ - R2_UPLOAD_IMAGE_ACCESS_KEY_ID - Cloudflare R2 access key ID
291
+ - R2_UPLOAD_IMAGE_SECRET_ACCESS_KEY - Cloudflare R2 secret access key
292
+ - CLOUDFLARE_ACCOUNT_ID - Cloudflare account ID
293
+ - R2_UPLOAD_IMAGE_BUCKET_NAME - R2 bucket name
294
+
295
+ **Integration Steps:**
296
+ 1. Verify app/api/upload-image/route.ts exists and exports POST handler
297
+ 2. Check that upload page exists: app/dashboard/upload/page.tsx
298
+ 3. Verify upload utility exists: lib/upload-image.ts
299
+ 4. Ensure all R2 environment variables are set in .env.local
300
+ 5. Test upload API: POST multipart/form-data with file to /api/upload-image
301
+ 6. Test upload page: Visit /dashboard/upload
302
+ 7. If auth module installed: Verify upload routes are protected
303
+
304
+ **Key Integration Points:**
305
+ - API route: Handles multipart/form-data, validates file type/size, uploads to R2
306
+ - File validation: Checks MIME type (image/jpeg, image/png, image/webp) and size (max 10MB)
307
+ - R2 client: Uses S3Client from @aws-sdk/client-s3 with R2 endpoint
308
+ - Public URLs: Generates public URLs for uploaded images (requires R2 public domain)
309
+ - Upload UI: Drag-and-drop interface with progress tracking and image preview gallery
310
+
311
+ **Dependencies:**
312
+ - OPTIONAL: Auth module (for protecting upload routes)
313
+ - No hard dependencies on other Shipd modules
314
+
315
+ **Common Issues to Check:**
316
+ - If "R2_UPLOAD_IMAGE_ACCESS_KEY_ID is not defined": Add all R2 env vars to .env.local
317
+ - If upload fails with "Access Denied": Verify R2 API tokens have correct permissions
318
+ - If public URLs not working: Configure public domain for R2 bucket and update lib/upload-image.ts
319
+ - If "File too large" error: Check file size limits in route.ts (default: 10MB)
320
+
321
+ **Next Steps After Integration:**
322
+ - Set up Cloudflare R2 bucket
323
+ - Generate R2 API tokens with read/write permissions
324
+ - Add all R2 environment variables to .env.local
325
+ - Configure public domain for bucket in Cloudflare dashboard
326
+ - Update public URL domain in lib/upload-image.ts
327
+ - Test upload functionality at /dashboard/upload
328
+ - Add authentication checks if needed
329
+ ```
@@ -264,3 +264,70 @@ This module works well with:
264
264
  ✅ **Ready to Use** - Works immediately after append
265
265
  ✅ **Well Documented** - Comprehensive integration guide
266
266
  ✅ **Smart Deduplication** - Won't overwrite existing `app/page.tsx`
267
+
268
+ ---
269
+
270
+ ## AI Integration Prompt
271
+
272
+ **For AI Assistants:** Use this prompt to understand and integrate the Marketing Landing Page module into an existing Next.js application.
273
+
274
+ ```
275
+ The Marketing Landing Page module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
276
+
277
+ **Installed Packages:**
278
+ - No additional packages (uses base package dependencies: @radix-ui components, lucide-react, tailwindcss)
279
+
280
+ **Files Added:**
281
+ - app/page.tsx - Full marketing landing page (replaces base page.tsx)
282
+ - components/homepage/hero-section.tsx - Hero section with CTA buttons
283
+ - components/homepage/navigation.tsx - Site navigation header
284
+ - components/homepage/features-section.tsx - Features table/grid
285
+ - components/homepage/cli-workflow-section.tsx - CLI workflow demonstration
286
+ - components/homepage/testimonials-section.tsx - Stats/testimonials section
287
+ - components/homepage/integrations.tsx - Technology logos/integrations
288
+ - components/homepage/news-section.tsx - Blog/news preview section
289
+ - components/homepage/pricing-section.tsx - Pricing section (if not using payments module)
290
+ - components/homepage/footer.tsx - Site footer
291
+ - components/logos/*.tsx - Technology logo components (BetterAuth, Next.js, Polar, etc.)
292
+
293
+ **Environment Variables Required:**
294
+ - None (module is self-contained)
295
+
296
+ **Integration Steps:**
297
+ 1. Verify app/page.tsx exists and imports all homepage components
298
+ 2. Check that components/homepage/ directory exists with all section components
299
+ 3. Verify components/logos/ directory exists with logo components
300
+ 4. Check that navigation links point to correct routes (/sign-up, /sign-in, /docs, etc.)
301
+ 5. Test landing page: Visit / (root route)
302
+ 6. If auth module installed: Verify sign-in/sign-up links work
303
+ 7. If payments module installed: Replace static pricing with dynamic pricing component
304
+
305
+ **Key Integration Points:**
306
+ - Homepage: app/page.tsx is the main landing page (replaces base minimal page)
307
+ - Navigation: components/homepage/navigation.tsx should link to /sign-up, /sign-in, /docs, etc.
308
+ - CTA buttons: Hero section links to /sign-up and #cli-workflow
309
+ - Smart deduplication: If app/page.tsx already exists, it won't be overwritten (manual merge needed)
310
+ - Logo components: Technology logos are in components/logos/ directory
311
+ - Styling: Uses Tailwind CSS with sunset orange (#ff5722) color scheme
312
+
313
+ **Dependencies:**
314
+ - OPTIONAL: Auth module (for sign-in/sign-up links in navigation)
315
+ - OPTIONAL: Payments module (for dynamic pricing section)
316
+ - OPTIONAL: Docs module (for documentation link in navigation)
317
+ - No hard dependencies - works standalone
318
+
319
+ **Common Issues to Check:**
320
+ - If homepage not showing: Check app/page.tsx exists and imports components correctly
321
+ - If components not found: Verify components/homepage/ directory structure
322
+ - If navigation links broken: Update href attributes in navigation.tsx
323
+ - If styling broken: Ensure Tailwind CSS is configured and base package components exist
324
+
325
+ **Next Steps After Integration:**
326
+ - Customize hero text and CTA buttons in hero-section.tsx
327
+ - Update navigation links in navigation.tsx
328
+ - Customize features list in features-section.tsx
329
+ - Update testimonials/stats in testimonials-section.tsx
330
+ - Replace logo components with your own if needed
331
+ - Add links to auth pages if auth module installed
332
+ - Integrate dynamic pricing if payments module installed
333
+ ```
@@ -304,3 +304,72 @@ This module works well with:
304
304
  ✅ **Webhook Integration** - Works with auth module's webhook handler
305
305
  ✅ **Well Documented** - Comprehensive integration guide
306
306
 
307
+ ---
308
+
309
+ ## AI Integration Prompt
310
+
311
+ **For AI Assistants:** Use this prompt to understand and integrate the Payments module into an existing Next.js application.
312
+
313
+ ```
314
+ The Payments module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
315
+
316
+ **Installed Packages:**
317
+ - @polar-sh/sdk@^0.42.1 - Polar.sh SDK for subscription management
318
+
319
+ **Files Added:**
320
+ - app/dashboard/payment/page.tsx - Subscription management page
321
+ - app/dashboard/payment/_components/manage-subscription.tsx - Subscription management component
322
+ - app/success/page.tsx - Checkout success page
323
+ - app/api/subscription/route.ts - API route for fetching subscription details
324
+ - lib/subscription.ts - Utilities for subscription operations
325
+ - lib/polar-products.ts - Utilities for fetching Polar products
326
+ - payments-schema.ts - Drizzle schema for subscription table
327
+
328
+ **Schema Table Added to db/schema.ts:**
329
+ - subscription - Subscription records with status, billing info, and user linkage
330
+
331
+ **Environment Variables Required:**
332
+ - POLAR_ACCESS_TOKEN - Polar.sh API access token
333
+ - POLAR_SUCCESS_URL - Success page path (e.g., "success")
334
+ - POLAR_WEBHOOK_SECRET - Webhook secret for verifying Polar webhooks
335
+ - NEXT_PUBLIC_STARTER_TIER - Polar product ID for starter tier
336
+ - NEXT_PUBLIC_STARTER_SLUG - Polar organization slug
337
+ - NEXT_PUBLIC_APP_URL - Application URL (e.g., http://localhost:3000)
338
+ - DATABASE_URL - Required (from database module)
339
+ - BETTER_AUTH_SECRET - Required (from auth module)
340
+
341
+ **Integration Steps:**
342
+ 1. Verify auth and database modules are installed (payments requires both)
343
+ 2. Check that subscription table was merged into db/schema.ts
344
+ 3. Verify lib/auth.ts has webhook handler for Polar subscription events
345
+ 4. Ensure app/api/subscription/route.ts is protected (requires authentication)
346
+ 5. Check that app/success/page.tsx exists for checkout redirects
347
+ 6. Verify environment variables are set in .env.local
348
+ 7. Run database migrations: npm run db:push (to create subscription table)
349
+
350
+ **Key Integration Points:**
351
+ - Webhook handling: lib/auth.ts contains onWebhook handler for Polar subscription events
352
+ - Subscription table: Automatically merged into db/schema.ts during append
353
+ - User linkage: subscription.userId references user.id from auth module
354
+ - API routes: app/api/subscription/route.ts fetches subscription for authenticated user
355
+ - Checkout flow: Users redirected to /success after successful checkout
356
+ - Dynamic imports: auth.ts dynamically imports subscription table (only if payments installed)
357
+
358
+ **Dependencies:**
359
+ - REQUIRES: Auth module (for user authentication and webhook handling)
360
+ - REQUIRES: Database module (for subscription storage)
361
+ - OPTIONAL: Email module (for subscription confirmation emails)
362
+
363
+ **Common Issues to Check:**
364
+ - If "subscription is not exported" error: Check that subscription table was merged into db/schema.ts
365
+ - If webhooks not working: Verify POLAR_WEBHOOK_SECRET matches Polar dashboard
366
+ - If checkout fails: Check NEXT_PUBLIC_STARTER_TIER and NEXT_PUBLIC_STARTER_SLUG are correct
367
+ - If subscription not showing: Ensure user is authenticated and subscription exists in database
368
+
369
+ **Next Steps After Integration:**
370
+ - Set up Polar.sh account and create products
371
+ - Configure webhook URL in Polar dashboard: https://yourdomain.com/api/auth/callback/polar
372
+ - Test checkout flow: Visit /dashboard/payment and subscribe
373
+ - Verify webhook events are received and subscription table is updated
374
+ - Customize success page at app/success/page.tsx
375
+ ```
@@ -242,3 +242,61 @@ The blog pages are fully customizable. Update:
242
242
  - Verify JSON-LD syntax is correct
243
243
  - Check that required fields are present
244
244
 
245
+ ---
246
+
247
+ ## AI Integration Prompt
248
+
249
+ **For AI Assistants:** Use this prompt to understand and integrate the SEO module into an existing Next.js application.
250
+
251
+ ```
252
+ The SEO module has been appended to this Next.js project. Your task is to ensure it's properly integrated and functional.
253
+
254
+ **Installed Packages:**
255
+ - react-markdown@^10.1.0 - Markdown rendering for blog posts
256
+ - remark-gfm@^4.0.1 - GitHub Flavored Markdown support
257
+
258
+ **Files Added:**
259
+ - app/sitemap.ts - Automated sitemap generation (Next.js MetadataRoute)
260
+ - app/robots.txt - Search engine crawler instructions
261
+ - app/blog/page.tsx - Blog listing page with example posts
262
+ - app/blog/[slug]/page.tsx - Individual blog post page with markdown support
263
+ - lib/seo-utils.ts - Structured data helpers (JSON-LD, OpenGraph, Twitter Cards)
264
+
265
+ **Environment Variables Required:**
266
+ - NEXT_PUBLIC_APP_URL - Application URL (e.g., http://localhost:3000 or https://yourdomain.com)
267
+
268
+ **Integration Steps:**
269
+ 1. Verify app/sitemap.ts exists and exports default sitemap() function
270
+ 2. Check that app/robots.txt exists (Next.js serves this automatically)
271
+ 3. Verify blog structure exists: app/blog/page.tsx and app/blog/[slug]/page.tsx
272
+ 4. Check that lib/seo-utils.ts exists with structured data helper functions
273
+ 5. Ensure NEXT_PUBLIC_APP_URL is set in .env.local
274
+ 6. Test sitemap: Visit /sitemap.xml (should return XML)
275
+ 7. Test robots.txt: Visit /robots.txt (should return text)
276
+ 8. Test blog: Visit /blog (should show blog listing)
277
+
278
+ **Key Integration Points:**
279
+ - Sitemap generation: app/sitemap.ts uses Next.js MetadataRoute.Sitemap API
280
+ - Robots.txt: Next.js automatically serves app/robots.txt at /robots.txt
281
+ - Blog structure: Example blog posts are hardcoded; replace with CMS/database in production
282
+ - Structured data: Use lib/seo-utils.ts functions to generate JSON-LD for pages
283
+ - Template variables: robots.txt uses {{APP_URL}} which gets replaced during init
284
+
285
+ **Dependencies:**
286
+ - No dependencies on other Shipd modules
287
+ - Can be installed standalone
288
+
289
+ **Common Issues to Check:**
290
+ - If sitemap not generating: Check NEXT_PUBLIC_APP_URL is set, verify app/sitemap.ts exists
291
+ - If blog posts not showing: Check blog posts array in app/blog/page.tsx is populated
292
+ - If markdown not rendering: Ensure react-markdown and remark-gfm are installed
293
+ - If structured data invalid: Use Google Rich Results Test to validate JSON-LD
294
+
295
+ **Next Steps After Integration:**
296
+ - Update sitemap.ts with all your application routes
297
+ - Customize blog posts in app/blog/page.tsx and app/blog/[slug]/page.tsx
298
+ - Add structured data to app/layout.tsx using generateWebAppStructuredData()
299
+ - Add structured data to blog posts using generateBlogPostStructuredData()
300
+ - Update robots.txt rules if needed (currently allows all, blocks /api/, /dashboard/)
301
+ - Replace hardcoded blog posts with CMS/database queries in production
302
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shipd",
3
- "version": "0.1.4",
3
+ "version": "0.2.0",
4
4
  "description": "Generate production-ready SaaS applications with authentication, billing, and more",
5
5
  "type": "module",
6
6
  "bin": {