Develop a comprehensive full-stack MVP application using Next.js 14+ with the App Router, TypeScript, Tailwind CSS for styling, Drizzle ORM for database interactions (PostgreSQL), and NextAuth.js for authentication. The application, 'ClearPrice', should help businesses create simplified, high-converting pricing pages by avoiding decision paralysis caused by overly complex feature comparison tables.
**Core Functionality:**
1. **User Authentication:** Implement full signup, login, and logout functionality using NextAuth.js. Users should be able to create an account and manage their pricing pages.
2. **Pricing Page Management (CRUD):**
* Users can create new pricing pages, providing a title, a unique slug for the public URL, and a status (draft/published).
* Users can view a list of their existing pricing pages in a dashboard.
* Users can edit an existing pricing page's details.
* Users can delete a pricing page.
3. **Pricing Plan Management (CRUD):**
* For each pricing page, users can add multiple pricing plans.
* Each plan must include a name, price, and a concise 2-3 sentence description (to avoid feature overload).
* Users can reorder plans, edit plan details, and delete plans.
4. **Public Pricing Page Rendering:**
* A dynamic public page route (`/[slug]`) that renders the simplified pricing page based on the `slug` provided by the user. This page should display the plans with their names, prices, and short descriptions clearly, without feature tables.
* A discreet link at the bottom of the public page, e.g., 'See full feature details', which the user can configure (e.g., link to their existing feature comparison page).
5. **Analytics Dashboard:**
* For each pricing page, display basic analytics: total views, clicks on 'Sign Up' buttons (or equivalent call-to-action), and clicks on 'See full feature details' link.
* Implement an analytics tracking mechanism on the public facing pricing page.
6. **Integration/Embedding:**
* Provide a basic JavaScript snippet or iframe code that users can embed on their websites to display the ClearPrice generated pricing page.
**Technical Requirements:**
* **Frontend:** Next.js 14+ (App Router), TypeScript, React Server Components (RSC) where appropriate, React Client Components for interactive UI, Tailwind CSS for styling.
* **Backend:** Next.js API Routes for all CRUD operations and analytics tracking.
* **Database:** PostgreSQL (with Drizzle ORM). Define a Drizzle schema including:
* `users`: id (PK), email (unique), passwordHash, createdAt, updatedAt
* `pricingPages`: id (PK), userId (FK to users), title, slug (unique), status ('draft' | 'published'), fullFeatureLink (optional URL), createdAt, updatedAt
* `pricingPlans`: id (PK), pricingPageId (FK to pricingPages), name, price (decimal), descriptionShort (text), order (integer), createdAt, updatedAt
* `analyticsEvents`: id (PK), pricingPageId (FK to pricingPages), eventType ('view' | 'signup_click' | 'feature_link_click'), timestamp, userIp (optional), createdAt
* **Project Structure:** Organize the project logically within the `app/` directory (e.g., `app/dashboard`, `app/auth`, `app/[slug]`, `app/api`).
**AI Output:** Provide a fully functional Next.js project boilerplate with:
* All necessary Next.js configuration.
* Drizzle schema definition and migrations (if applicable).
* Full NextAuth.js setup.
* Placeholder UI components for all specified pages and dashboard views (e.g., `app/dashboard/pricing-pages/page.tsx`, `app/dashboard/pricing-pages/[id]/edit/page.tsx`, `app/[slug]/page.tsx`).
* API routes (`app/api/...`) for user authentication, pricing page CRUD, pricing plan CRUD, and analytics event logging.
* Basic styling using Tailwind CSS for a clean and modern appearance.
* Example usage of RSC and Client Components.