Create a full-stack web application using Next.js App Router, PostgreSQL with Drizzle ORM, and Tailwind CSS. The application will be a 'Family Finance Compass' designed to help individuals manage their finances while planning for potential support of aging parents. The MVP should include user authentication, multi-page navigation, and robust CRUD operations for managing financial data for both the user and their parents.
**Project Structure:**
- Use the `app/` directory for routing and page components.
- Create separate layouts and pages for different sections.
- Implement API routes in `app/api/` for backend logic.
**Features:**
1. **User Authentication:** Implement secure user registration, login, and logout using NextAuth.js or a similar library.
2. **User Profile Management:** Allow users to create and update their personal financial profile (income, expenses, debts, existing savings, retirement contributions).
3. **Parental Financial Profile:** Allow users to create and manage profiles for their parents, including their financial situation (income, savings, expenses, property ownership).
4. **Financial Scenario Planner:** Develop a tool that allows users to simulate different financial support scenarios for their parents (e.g., monthly contributions, emergency fund allocation, housing support). This tool should provide visual outputs (charts/graphs) of the impact on the user's own financial goals.
5. **Communication Guide:** Integrate a section with pre-written templates and advice on how to have difficult conversations with parents about financial matters, focusing on setting boundaries and managing expectations.
6. **Financial Goal Tracker:** Enable users to set and track their personal financial goals (e.g., emergency fund target, retirement savings goal, debt payoff). The dashboard should visualize progress towards these goals.
**Database Schema (Drizzle ORM):**
- **`users` table:** `id` (UUID, PK), `email` (text, unique), `name` (text), `password` (text), `createdAt` (timestamp), `updatedAt` (timestamp)
- **`userProfiles` table:** `id` (UUID, PK), `userId` (UUID, FK to users), `income` (numeric), `monthlyExpenses` (numeric), `debtAmount` (numeric), `emergencyFund` (numeric), `rothIraBalance` (numeric), `401kBalance` (numeric), `retirementContributionRate` (numeric), `carPayment` (numeric, optional), `carPaymentMonthsLeft` (integer, optional), `createdAt` (timestamp), `updatedAt` (timestamp)
- **`parentProfiles` table:** `id` (UUID, PK), `userId` (UUID, FK to users), `parentName` (text), `income` (numeric), `savingsAccountBalance` (numeric), `monthlyExpenses` (numeric), `propertyOwned` (boolean), `createdAt` (timestamp), `updatedAt` (timestamp)
- **`financialGoals` table:** `id` (UUID, PK), `userId` (UUID, FK to users), `goalName` (text), `targetAmount` (numeric), `currentAmount` (numeric), `deadline` (date, optional), `createdAt` (timestamp), `updatedAt` (timestamp)
**API Routes (CRUD):**
- Implement API routes for all CRUD operations for `userProfiles`, `parentProfiles`, and `financialGoals`.
- Example: `POST /api/user-profile` to create, `GET /api/user-profile/:id` to read, `PUT /api/user-profile/:id` to update, `DELETE /api/user-profile/:id` to delete.
- Secure all API routes that modify data.
**UI/UX:**
- Use Tailwind CSS for styling.
- Ensure a responsive and intuitive user interface.
- Implement clear visual feedback for user actions.
- Design an informative dashboard summarizing the user's financial health and progress towards goals.
**Development Stack:**
- **Frontend:** Next.js (App Router), React, Tailwind CSS
- **Backend:** Next.js API Routes
- **Database:** PostgreSQL
- **ORM:** Drizzle ORM
- **Authentication:** NextAuth.js