You are an expert full-stack developer tasked with building a Minimum Viable Product (MVP) for 'My Business Buddy' (İş Ortağım), a SaaS application designed to combat loneliness and isolation for solo entrepreneurs. The application should provide a virtual support community and business development tools.
Build a multi-page Next.js application using the App Router (app/ directory). Ensure a robust backend with a PostgreSQL database managed by Drizzle ORM.
The application must include the following core features:
1. **User Authentication and Profiles:**
* Secure user registration and login using Clerk or NextAuth.js.
* User profiles with fields for name, business type, current stage, and personal goals.
* Ability for users to update their profile information.
2. **Community Forums (Support Groups):**
* Create 'Forum' and 'Post' tables in Drizzle.
* Users can create new forum threads (posts) related to specific business challenges (e.g., 'Marketing', 'Funding', 'Operations', 'Mental Well-being').
* Users can view existing posts, read comments, and add new comments to posts.
* Implement full CRUD operations for posts and comments via API routes.
* A dedicated API route for fetching posts and comments, with filtering and sorting capabilities.
3. **Goal Setting and Tracking:**
* Create a 'Goal' table in Drizzle, linked to users.
* Users can define daily or weekly business goals (e.g., 'Reach out to 5 potential clients', 'Spend 2 hours on product development').
* Users can mark goals as completed.
* Implement CRUD operations for goals via API routes.
4. **Motivational Content Feed:**
* Create a 'Motivation' table in Drizzle (optional for MVP, can be hardcoded initially if needed).
* Display daily motivational quotes, tips, or short success stories.
* This should be a read-only feature for the user in the MVP.
5. **Basic Business Tools (e.g., Business Plan Template):**
* Create a 'BusinessPlan' table in Drizzle, linked to users.
* Users can start creating a basic business plan by filling out sections (e.g., Executive Summary, Market Analysis, Marketing Strategy).
* Implement CRUD operations for business plan sections via API routes.
**Technical Stack Requirements:**
* **Framework:** Next.js (App Router - app/ directory)
* **Database:** PostgreSQL
* **ORM:** Drizzle ORM for type-safe database interactions.
* **Authentication:** Clerk or NextAuth.js
* **Styling:** Tailwind CSS (or a similar utility-first CSS framework)
* **Language:** TypeScript
**Project Structure:**
* Organize code logically within the `app/` directory for pages and layouts.
* Create a `lib/` or `server/` directory for database schema (Drizzle), API routes, and utility functions.
* Implement API routes under `app/api/` for all data operations.
**Development Workflow:**
1. Set up the Next.js project with TypeScript.
2. Configure PostgreSQL and Drizzle ORM.
3. Implement user authentication.
4. Define Drizzle schema for all required tables (Users, Forums, Posts, Comments, Goals, BusinessPlans).
5. Create API routes for CRUD operations for each feature.
6. Build the UI components and pages, integrating with the API routes.
7. Ensure responsiveness and good user experience.
**Deliverables:**
A complete, runnable MVP codebase that demonstrates all the specified features with full CRUD functionality where applicable. The application should be deployable.