AU Trades Sprint Requirements
Okay, let's break down these client requirements step by step to help you resolve them in your React/TypeScript project with Supabase as the backend. I'll provide guidance on how to approach each issue:
1. Pricing and Checkout Issues
Plan Display Error:
Problem: User sees the starter plan displayed instead of the pro plan.
Solution:
Frontend (React/TypeScript): Verify the user's subscription status from the backend upon login or account page load. Ensure that the correct plan details are displayed based on the user's subscription level.
Backend (Supabase): Implement a reliable way to store and retrieve user subscription data. Ensure the data is consistent and accurate.
Manage Subscription Error:
Problem: "Manage Subscription" link is broken.
Solution:
Identify the root cause: Is the link pointing to the correct URL? Is there a CORS issue?
Frontend: Ensure the link navigates to the correct management portal URL provided by your subscription service (e.g., Stripe, Paddle). Handle any potential errors gracefully.
Plan Highlighting:
Problem: Both starter and pro plans are highlighted as "most popular."
Solution:
Frontend: Implement conditional logic to highlight only the pro plan when the user is signed out. Use local storage or cookies to remember the user's preference.
Plan Requirements (Job Applications):
Problem: Enforcing limits based on the plan (Free: 2, Starter: 10, Pro: Unlimited).
Solution:
Backend (Supabase): Implement logic to track the number of job applications made by each user within the current billing cycle. Store this data in the Supabase database.
Frontend: Before allowing a user to apply for a job, check their plan and the number of applications they've made. Display appropriate messages if they exceed their limit.
2. Account Settings
Settings Tab:
Solution:
Frontend: Add a "Settings" tab to the account dropdown.
Display the subscribed plan banner within this tab.
Implement functionality for users to delete their accounts and modify settings.
3. Notifications System
Notification Redirection:
Problem: Notifications don't redirect to the specific chat message.
Solution:
Backend: Ensure each notification includes a reference to the specific message ID.
Frontend: When a user clicks a notification, use the message ID to redirect them to the correct message within the chat interface.
Real-time Chat Updates:
Solution:
Implement WebSockets or use Supabase's real-time capabilities to push new messages to the client in real-time.
Use libraries like
socket.ioorpusher-js.
Job Application Notifications:
Solution:
Backend: Trigger a notification when a user's job receives an application.
Frontend: Display the notification to the user.
Duplicate Notifications:
Solution:
Backend: Investigate the code that triggers the notifications. Ensure notifications are not being triggered multiple times for the same event. Add checks to prevent duplicates.
Notification Clearing:
Solution:
Frontend: When a user clears notifications, send a request to the backend to mark them as read in the database.
Backend: Update the notification status in the Supabase database.
Access Granted Notifications:
Solution:
Backend: When access is granted, create a notification with the relevant file information.
Frontend: Display the notification with the correct message.
Proposal Submission Notifications:
Solution:
Backend: Create a notification when a proposal is submitted.
Frontend: Display the notification.
4. User Signup and Profile
Email Confirmation Redirect:
Problem: Redirects to
localhostinstead of the live website.Solution:
Supabase Settings: Update the email confirmation redirect URL in your Supabase project settings to the live website URL.
Automatic Name Population:
Solution:
Frontend: On signup, extract the name from the input field and store it in the user's profile.
Backend: Ensure the name is saved in the Supabase user table.
5. Job Posting
Contact Phone Number:
Solution:
Frontend: Add an optional phone number field to the job posting form.
Backend: Store the phone number in the Supabase database.
Project Value:
Solution:
Frontend: Add a "Don't include project value" button.
Backend: If the user selects this, don't require the project value.
Project Files:
Solution:
Remove the requirement to upload project files.
N/A Display:
Solution:
Frontend: Display "N/A" in the project overview if the user doesn't include a phone number or project value.
Display "This project has no attached files" if no files are added.
Unlocking Project Files:
Solution:
Frontend: Implement a checkbox to allow users to unlock project files.
Backend: Ensure all applicants can access the files if the box