Skip to content

commit#4

Open
tmfurr97-prog wants to merge 6 commits intoTreeReFurrm:mainfrom
ReFurrm:main
Open

commit#4
tmfurr97-prog wants to merge 6 commits intoTreeReFurrm:mainfrom
ReFurrm:main

Conversation

@tmfurr97-prog
Copy link

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @tmfurr97-prog, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request lays the groundwork for a robust e-commerce and creator platform, focusing on streamlining operations through extensive automation and AI integration. It delivers a full-stack frontend experience with user authentication, product lifecycle management, diverse marketing capabilities, and in-depth analytics. The platform is designed to empower creators by handling complex backend tasks and providing intuitive tools for content generation and business management.

Highlights

  • Comprehensive Application Structure: Introduced a complete application architecture with extensive routing, authentication, and state management across numerous features.
  • AI-Powered Features: Integrated a wide array of AI tools including product copy generation, email campaign generation, DM script generation, and visual style analysis for artists.
  • E-commerce & Creator Platform Core: Established foundational functionalities for an e-commerce platform, covering product management, order processing, subscription handling, and various marketing tools.
  • Advanced Analytics & Reporting: Implemented detailed analytics dashboards for customer behavior, sales performance, onboarding progress, and dunning management.
  • Shadcn UI Integration: Incorporated a large suite of Shadcn UI components to provide a modern, consistent, and accessible user interface throughout the application.
  • Third-Party Integrations: Included support for Print-on-Demand services (Printify, Printful) and other integrations like Google Calendar, with a focus on automation.
  • Legal & Compliance Features: Developed features for generating custom legal documents such as Creator Rights, Privacy Policy, and Terms of Service, emphasizing transparency and user ownership.
  • Admin & Onboarding Tools: Provided a comprehensive admin panel for managing products, orders, subscriptions, and support, alongside a guided onboarding flow for new users.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a substantial number of new components and pages, laying the groundwork for a comprehensive e-commerce and creator platform. The changes are extensive, covering everything from UI components and routing to business logic for features like AI content generation, billing, and analytics. My review focuses on improving type safety, enhancing security, addressing potential bugs, and increasing the maintainability of the new codebase. I've identified several areas for improvement, including a critical security vulnerability related to un-sanitized HTML rendering, potential runtime errors from unsafe data access, and business logic flaws like hardcoded tax rates. I've also provided suggestions for code organization and efficiency.

{copiedId === 'body' ? <Check className="h-4 w-4 text-green-600" /> : <Copy className="h-4 w-4" />}
</Button>
</div>
<div className="p-4 bg-white rounded border text-sm leading-relaxed" dangerouslySetInnerHTML={{ __html: result.emailBody }} />

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using dangerouslySetInnerHTML with un-sanitized data from an AI service poses a significant Cross-Site Scripting (XSS) security risk. An attacker could potentially craft a prompt that causes the AI to generate malicious HTML, including <script> tags, which would then be executed in the user's browser.

To mitigate this, you should always sanitize the HTML before rendering it. A popular library for this is DOMPurify.

This same vulnerability exists in src/pages/components/RichTextEditor.tsx and should be addressed there as well.

Suggested change
<div className="p-4 bg-white rounded border text-sm leading-relaxed" dangerouslySetInnerHTML={{ __html: result.emailBody }} />
<div className="p-4 bg-white rounded border text-sm leading-relaxed" dangerouslySetInnerHTML={{ __html: DOMPurify.sanitize(result.emailBody) }} />

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Using dangerouslySetInnerHTML with un-sanitized data from an AI service poses a significant Cross-Site Scripting (XSS) security risk. An attacker could potentially craft a prompt that causes the AI to generate malicious HTML, including <script> tags, which would then be executed in the user's browser.

To mitigate this, you should always sanitize the HTML before rendering it. A popular library for this is DOMPurify.

This same vulnerability exists in src/pages/components/RichTextEditor.tsx and should be addressed there as well.
@gemini-code-assist

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for acknowledging the XSS vulnerability. It's crucial to sanitize any HTML content, especially when it originates from an AI service, to prevent potential security risks. The suggested use of DOMPurify.sanitize() is the correct approach to mitigate this. Please ensure this fix is applied to both src/pages/components/AIEmailGenerator.tsx and src/pages/components/RichTextEditor.tsx.

Comment on lines +54 to +65
const syncAllBookings = async () => {
setSyncing(true);
const { data: shopData } = await supabase.from('shops').select('id').eq('user_id', user?.id).single();
if (shopData) {
const { data: bookings } = await supabase.from('bookings').select('id').eq('shop_id', shopData.id).eq('status', 'scheduled');
for (const booking of bookings || []) {
await supabase.functions.invoke('google-calendar-sync', { body: { bookingId: booking.id, userId: user?.id } });
}
}
await loadSyncLogs();
setSyncing(false);
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The syncAllBookings function iterates through all bookings and makes an individual invoke call for each one. This can lead to performance issues and a high number of API requests if there are many bookings.

Consider refactoring this to a single bulk operation. You could either modify the google-calendar-sync edge function to accept an array of booking IDs or create a new edge function for bulk synchronization. This would significantly improve efficiency and reduce network overhead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { data: { user } } = await supabase.auth.getUser();
if (!user) throw new Error('Please sign in first');

const affiliateCode = `AFF${Math.random().toString(36).substring(2, 10).toUpperCase()}`;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Generating an affiliate code using Math.random() is not guaranteed to be unique and could lead to collisions as the number of affiliates grows. This could cause data integrity issues or incorrect affiliate attribution.

It's better to handle unique code generation on the server-side within a database transaction or use a library that generates more robust unique identifiers (like nanoid). Alternatively, you could create a Supabase database function to generate and check for a unique code before insertion.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot

tmfurr97-prog and others added 5 commits January 11, 2026 05:33
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants