Create a full-stack Next.js application using the App Router (app/ directory) for a personal finance and wealth building platform called 'Generational Wealth Navigator'. The MVP should focus on helping users with a recent significant salary increase to manage their finances, plan for the future, and build generational wealth.
**Core Functionality:**
1. **User Authentication:** Secure user registration, login, and profile management. Use Clerk for authentication.
2. **Financial Dashboard:** A central hub displaying an overview of user's financial status. This includes income, expenses, assets, liabilities, and net worth. Allow manual input initially, with potential for future bank linking.
3. **Goal Setting & Planning:** Enable users to set financial goals (e.g., retirement, children's education, down payment, debt payoff, wealth accumulation). The system should help users create personalized savings and investment plans to achieve these goals.
4. **Investment Portfolio Management (Simulated/Basic):** Allow users to input their current investments (stocks, ETFs, mutual funds) and provide basic tracking. For MVP, suggest diversified, low-cost ETF portfolios based on user risk tolerance and goals. No real-time trading integration in MVP.
5. **Generational Wealth Education:** A section providing curated articles, guides, and calculators on topics like tax-efficient investing, estate planning, trusts, and long-term wealth preservation.
**Technical Requirements:**
* **Framework:** Next.js 14+ with the App Router (`app/` directory).
* **Language:** TypeScript.
* **Styling:** Tailwind CSS for rapid UI development. Use Shadcn/ui components.
* **Database:** PostgreSQL using Drizzle ORM. Define a clear database schema for users, accounts, transactions, goals, investment holdings, and educational content.
* **API Routes:** Implement RESTful API routes within the `app/api/` directory for all CRUD operations.
* **State Management:** React Context API or Zustand for client-side state management.
* **Data Fetching:** Server Components for static data and Client Components with `fetch` or SWR for dynamic data.
**Database Schema (Drizzle ORM):**
* `users` table: id, name, email, password hash, created_at, updated_at.
* `accounts` table: id, user_id, name, type (checking, savings, investment, credit card), balance, created_at, updated_at.
* `transactions` table: id, account_id, description, amount, type (income, expense), date, category, created_at, updated_at.
* `goals` table: id, user_id, name, target_amount, current_amount, target_date, created_at, updated_at.
* `investment_holdings` table: id, user_id, asset_name, symbol, quantity, purchase_price, purchase_date, current_price, created_at, updated_at.
* `educational_content` table: id, title, slug, content, category, created_at, updated_at.
**API Routes (Example):**
* `/api/users`: GET (get user profile), PUT (update user profile).
* `/api/accounts`: POST (add account), GET (list accounts), DELETE (delete account).
* `/api/transactions`: POST (add transaction), GET (list transactions for an account), PUT (update transaction), DELETE (delete transaction).
* `/api/goals`: POST (create goal), GET (list goals), PUT (update goal), DELETE (delete goal).
* `/api/investments`: POST (add holding), GET (list holdings), PUT (update holding), DELETE (delete holding).
**MVP Features Implementation Details:**
1. **Onboarding:** A multi-step form to collect initial financial data, including income sources, major expenses, existing assets (real estate, vehicles, savings), and debts. A brief questionnaire to gauge risk tolerance.
2. **Dashboard:** Visualizations (charts, graphs) for net worth trend, income vs. expenses, and progress towards goals. Display key financial ratios.
3. **Goal Planning:** Users define goals. The system calculates required savings per period and suggests asset allocation strategies (e.g., 80% stocks, 20% bonds for aggressive growth goal).
4. **Investment Suggestions:** Based on risk tolerance and goals, recommend a simple ETF portfolio (e.g., VOO, VTI, VXUS). Allow users to manually add and track these or similar investments.
5. **Education Module:** A searchable library of articles categorized by topic (e.g., "Retirement Planning", "Tax Strategies", "Estate Basics").
**AI Generation Instructions:**
* Generate all necessary React components, hooks, and utility functions.
* Implement robust error handling and loading states.
* Ensure the application is responsive and mobile-first.
* Provide seed data for educational content and example investment portfolios.
* The codebase should be well-organized, following best practices for Next.js development.
* Do NOT generate a `pages/` directory. Strictly use `app/` directory for routing.
* Do NOT generate any placeholder or landing page content. Focus on the core functional MVP.