Build a full-stack web application using Next.js App Router (app directory), PostgreSQL with Drizzle ORM, and Tailwind CSS. The application should help users manage and optimize inherited funds for income generation. It needs to be a multi-page application with robust CRUD operations for user data, investment strategies, and portfolio tracking. The core functionality includes user profiling, automated strategy generation, and portfolio comparison.
**Project Structure:**
- Use `app/` directory for routing.
- Separate pages into their own directories (e.g., `app/profile`, `app/strategies`, `app/portfolio`).
- Create `api/` routes for backend logic (e.g., `api/users`, `api/strategies`).
- Implement a clear component structure (`components/` directory).
**Database Schema (Drizzle ORM):**
Create tables for:
- `users`: id, name, email, password (hashed), risk_tolerance (enum: low, medium, high), income_goal (decimal), inherited_amount (decimal)
- `investment_strategies`: id, user_id (foreign key to users), name, description, asset_type (enum: HYSA, ETF, BOND, STOCK, REAL_ESTATE), allocation_percentage (decimal), projected_yield (decimal)
- `user_portfolios`: id, user_id (foreign key to users), strategy_id (foreign key to investment_strategies), current_value (decimal), last_updated (timestamp)
**Backend (API Routes):**
- Implement full CRUD API endpoints for `users`, `investment_strategies`, and `user_portfolios` using Drizzle ORM.
- For `investment_strategies`, create a service function that, given a user's profile (inherited_amount, risk_tolerance, income_goal), generates a personalized list of recommended strategies with allocation percentages and projected yields. This should simulate basic financial advisor logic. For MVP, define a few pre-set strategy templates based on risk profiles.
- Include authentication (e.g., NextAuth.js) for user management.
**Frontend (Next.js App Router):**
- **Authentication Pages:** Login, Signup, Password Reset.
- **Profile Page (`app/profile`):** Allow users to view and edit their profile information (name, risk tolerance, income goal, inherited amount).
- **Strategy Generation Page (`app/strategies`):** Trigger the backend API to generate personalized investment strategies based on the user's profile. Display the generated strategies with details (asset type, allocation, projected yield).
- **Portfolio Management Page (`app/portfolio`):** Allow users to view their current portfolio, manually add/edit/delete holdings, and see the performance based on `user_portfolios` data. Display a comparison between the user's current portfolio and the recommended strategies.
- **Educational Content:** Integrate a simple page (`app/learn`) with basic articles or links about financial concepts relevant to managing windfalls.
- Use Tailwind CSS for styling, ensuring a clean and responsive UI.
- Implement client-side and server-side data fetching appropriately.
- Ensure all forms handle input validation and error handling gracefully.
- The `api/strategies` route should return a JSON array of `investment_strategies` objects for the current user, calculated by the backend logic.