Individual Borrowers Loan Alert via Email (AWS, Lambda, DynamoDB, TypeScript, etc. )

Job ID: 38407771

Budget: $30 – $250 AUD

I'm looking for an Email notification system that alerts individual borrowers about their loans. The system should be able to send timely and relevant updates to help borrowers manage their loans effectively.

Ideal Skills:
- Email system setup and management
- Understanding of loan processes
- Experience in designing user-friendly alert systems

Please note, the specific details of the loan alert emails have not been determined yet. A degree of flexibility and creativity will be appreciated.

### Detailed Specification for Loan Alerts Feature

#### Database Schema

**1. users**
- `user_id` (Primary Key)
- `email`
- `name`
- Other user details

**2. loan_alerts**
- `loan_id` (Primary Key)
- `user_id` (Foreign Key)
- `current_interest_rate`
- `loan_amount`
- `loan_tenure`
- `loan_purpose`
- `loan_type`
- `preferred_reminder_date`
- `created_at`
- `updated_at`
- `loan_product_id`

**3. user_subscription_preferences**
- `user_id` (Primary Key, Foreign Key)
- `email_notifications` (boolean)
- `web_notifications` (boolean)
- `alert_types` (list: Rate Drop, Loan Review Reminder, etc.)

### Detailed Scope for Freelancers

#### Frontend Developer

**Frameworks and Technologies:**
- **Next.js** for the application framework.
- **Material-UI (MUI)** for UI components.
- **TypeScript** for type safety and scalability.

**Tasks:**

1. **User Interface for Setting Up Alerts**
- **Design the Alert Setup Form:**
- Fields:
- `loan_type` (dropdown: Home, Personal, Business, etc.)
- `current_interest_rate` (number)
- `loan_amount` (number)
- `loan_tenure` (number)
- `loan_purpose` (text)
- `preferred_reminder_date` (date picker)
- `alert_type` (checkboxes: Rate Drop, Loan Review Reminder)
- Notification preferences (checkboxes: Email, Web Notifications)
- Submit button to save the alert setup.

- **Develop the Form Using MUI and Next.js:**
- Create a form using MUI components within a Next.js framework.
- Validate inputs (e.g., ensure interest rates are valid numbers).
- Handle form submission to the backend API.

2. **User Interface for Viewing and Managing Alerts**
- **Design the Alert Management Page:**
- List all active alerts with details.
- Provide options to edit or delete alerts.

- **Develop the Management Page Using MUI and Next.js:**
- Fetch the user's alerts from the backend and display them.
- Implement functionality to edit and delete alerts.
- Ensure changes are persisted in the backend.

3. **Notification Preferences**
- **UI for Notification Settings:**
- Allow users to choose their preferred notification method (email, web notifications).

- **Integrate Notification Preferences:**
- Save preferences in the backend during the alert setup.

#### Backend Developer

**Frameworks and Technologies:**
- **AWS Lambda** for serverless functions.
- **DynamoDB** for database storage.
- **TypeScript** for type safety and scalability.

**Tasks:**

1. **Database Setup**
- **Tables:**
- `users`
- `user_id` (Primary Key)
- `email`
- `name`
- Other user details
- `loan_alerts`
- `loan_id` (Primary Key)
- `user_id` (Foreign Key)
- `current_interest_rate`
- `loan_amount`
- `loan_tenure`
- `loan_purpose`
- `loan_type`
- `preferred_reminder_date`
- `created_at`
- `updated_at`
- `loan_product_id`
- `user_subscription_preferences`
- `user_id` (Primary Key, Foreign Key)
- `email_notifications` (boolean)
- `web_notifications` (boolean)
- `alert_types` (list: Rate Drop, Loan Review Reminder, etc.)

2. **API Development**
- **Endpoints:**
- `POST /api/alerts` - Create a new alert.
- `GET /api/alerts` - Fetch all alerts for a user.
- `PUT /api/alerts/{alert_id}` - Update an alert.
- `DELETE /api/alerts/{alert_id}` - Delete an alert.

- **Lambda Functions Using TypeScript:**
- Create Lambda functions to handle the above endpoints.
- Use DynamoDB for storing and retrieving alert data.

3. **Notification Service**
- **Interest Rate Monitoring:**
- Set up a scheduled Lambda function to check current interest rates.
- Fetch data from `brands` and `products` tables to compare current rates with users' desired rates stored in DynamoDB.
- Logic:
1. Fetch all active alerts from `loan_alerts` table.
2. For each alert, query `products` table to find products matching the `loan_type` with an interest rate lower than the `desired_interest_rate`.
3. If a matching product is found, trigger a notification to the user.

- **Sending Notifications:**
- Use AWS SES to send email notifications.
- Use AWS SNS for web notifications.
- Ensure notifications are sent according to user preferences and alert types.

4. **Data Validation and Security**
- Validate incoming data for alerts (e.g., valid interest rates).
- Ensure secure handling of user data and preferences.

### Deliverables

#### Frontend
- Alert setup form.
- Alert management page.
- Notification preferences UI.
- Integration with backend APIs.

#### Backend
- DynamoDB table setup.
- API endpoints for alert management.
- Lambda functions for API handling and interest rate monitoring.
- Notification service using AWS SES and SNS.

### Development and Deployment

- **AWS Account Access:**
- Both freelancers will be provided access to the AWS account to deliver the project securely following best industry standards.

- **Deployment:**
- Ensure all code is deployed using industry best practices for security and scalability.
- Use CI/CD pipelines for deployment (e.g., AWS CodePipeline).

This detailed specification should provide a clear and comprehensive guide for both freelancers to deliver the loan alerts feature effectively.