Create a comprehensive Minimum Viable Product (MVP) for a Next.js application called 'International Debt Manager'. The application should help US citizens manage debts incurred in foreign countries they no longer reside in. The tech stack should include Next.js App Router (using the 'app/' directory), Drizzle ORM for database interactions with PostgreSQL, and Tailwind CSS for styling.
**Core Functionalities:**
1. **User Authentication:** Implement secure user registration and login using Clerk or NextAuth.js. Users should be able to manage their profiles.
2. **Debt Management Module:**
* **Create Debt:** Allow users to add new debts, specifying details such as creditor name, original amount, currency, current outstanding balance, interest rate, loan type (e.g., credit card, personal loan), and the country of the debt.
* **Read Debts:** Display a list of all added debts, with sorting and filtering options (by country, currency, amount).
* **Update Debt:** Allow users to edit existing debt details, including updating the outstanding balance periodically.
* **Delete Debt:** Enable users to remove a debt record.
3. **Payment Planning Module:**
* **Generate Payment Plan:** Based on user-defined monthly payment capacity and debt details, generate a potential debt payoff schedule. This should consider prioritization strategies (e.g., snowball, avalanche, or user-defined).
* **Track Payments:** Allow users to log payments made towards specific debts.
* **Payment Reminders:** Implement a system to remind users of upcoming payment due dates.
4. **Cross-Border Impact Analysis (MVP Lite):**
* **Currency Conversion:** Basic conversion of foreign currency debts to USD for reporting purposes (using a placeholder or a simple API if feasible).
* **Score Impact Simulation (Conceptual):** A placeholder or basic explanation of how non-payment in foreign countries *could* potentially affect US credit scores or lead to international legal actions (without providing legal advice). This should be clearly marked as informational and not legal guidance.
5. **Creditor Communication Templates:** Provide pre-written, customizable email/letter templates for users to initiate contact with creditors regarding payment plans, settlement offers, or information requests. Users should be able to fill in specific details and send these out (the app itself won't send, but provide the text).
**Technical Requirements:**
* **Next.js App Router:** Structure the application using the 'app/' directory for routing.
* **Database:** Use PostgreSQL with Drizzle ORM for schema definition and type-safe database interactions.
* **API Routes:** Implement API routes within the 'app/api/' directory for all CRUD operations and other backend logic.
* **Drizzle Schema:** Define clear Drizzle schemas for users, debts, payment plans, and payment logs.
* **UI:** Use Tailwind CSS for a clean and responsive user interface. Ensure the design is intuitive and user-friendly.
* **State Management:** Utilize React hooks and Context API or a lightweight state management library if necessary.
* **Error Handling:** Implement robust error handling for API requests and user inputs.
* **Security:** Ensure secure handling of user data and API requests. Avoid storing sensitive financial information directly unless absolutely necessary and properly encrypted.
**MVP Scope Limitation:**
* No direct integration with banks or financial institutions for automatic data fetching.
* No live currency exchange rate API integration for the initial MVP; use static or manually updated rates for conversion if needed for reports.
* The 'Score Impact Simulation' is for informational purposes only and does not provide financial or legal advice. This should be explicitly stated to the user.