Create a full-stack web application using Next.js App Router (app/ directory), TypeScript, Drizzle ORM with PostgreSQL, and Tailwind CSS. The application should serve as a comprehensive tenant assistance platform to help users manage rent increases and find housing solutions.
**Core Features:**
1. **User Authentication:** Implement secure user signup, login, and logout using NextAuth.js (or similar). Users should have profiles to store their housing details.
2. **Rent Analysis Module:**
* **Schema:** `rents` table (id, userId, currentRent, newRent, increaseAmount, percentageIncrease, effectiveDate, createdAt, updatedAt).
* **CRUD:** Allow users to input their current rent, the new proposed rent, and the effective date. The system should automatically calculate the increase amount and percentage.
* **API Routes:** `/api/rents` (POST for creation, GET for listing user's rents).
3. **Alternative Housing Search:**
* **Schema:** `housingOptions` table (id, userId, location, rentAmount, url, notes, createdAt, updatedAt).
* **CRUD:** Users can manually input details of alternative listings they find or potentially integrate a basic external API if feasible for MVP (focus on manual input for now). Calculate estimated moving costs (deposit, first month, movers) based on user input or predefined averages.
* **API Routes:** `/api/housing` (POST for creation, GET for listing user's found options).
4. **Negotiation Assistant:**
* **Schema:** `negotiations` table (id, userId, rentOptionId, landlordName, landlordContact, negotiationStrategy, proposedRent, communicationLog, status, createdAt, updatedAt).
* **Functionality:** Provide pre-written negotiation templates based on user's rent analysis data and housing situation. Allow users to log communication with their landlord.
* **API Routes:** `/api/negotiations` (POST for creation, GET for listing, PUT for update).
5. **Budget Planner:**
* **Schema:** `budgets` table (id, userId, income, essentialExpenses, discretionarySpending, savingsGoal, rentIncreaseMitigationPlan, createdAt, updatedAt).
* **Functionality:** Based on user's income and the calculated rent increase, help users create a realistic budget to accommodate the new rent or relocation costs. Suggest areas for potential savings.
* **API Routes:** `/api/budgets` (POST for creation, GET for listing, PUT for update).
**Technical Requirements:**
* **Project Setup:** Use `create-next-app` with TypeScript and Tailwind CSS.
* **Database:** Integrate Drizzle ORM with PostgreSQL (using Vercel Postgres or a local setup).
* **File Structure:** Organize the application within the `app/` directory using Next.js App Router conventions (layout.tsx, page.tsx, loading.tsx, etc. for multi-page structure).
* **API Layer:** Implement all data operations via API routes (`app/api/...`) following RESTful principles for CRUD operations.
* **UI/UX:** Design a clean, intuitive, and responsive user interface using Tailwind CSS. Ensure a smooth user experience for data input and result visualization.
* **Error Handling:** Implement robust error handling for API requests and user inputs.
* **State Management:** Use React Context API or Zustand for client-side state management where necessary.
* **Deployment:** Assume deployment on Vercel.
**Prompt Constraints:**
* Do NOT generate a single-page application (SPA) or just a landing page.
* Ensure a multi-page structure is evident using the App Router.
* Implement full CRUD functionality for all core data models.
* The database schema should be clearly defined and integrated using Drizzle ORM.