Skip to content

feat(showroom): add public showroom route with username and isPublic …#115

Open
Yuva-Deekshitha-N wants to merge 2 commits into
rushikesh-bobade:mainfrom
Yuva-Deekshitha-N:feature/public-showroom
Open

feat(showroom): add public showroom route with username and isPublic …#115
Yuva-Deekshitha-N wants to merge 2 commits into
rushikesh-bobade:mainfrom
Yuva-Deekshitha-N:feature/public-showroom

Conversation

@Yuva-Deekshitha-N

Copy link
Copy Markdown
Contributor

…schema fields

Description

Adds the backend groundwork for the Public Showroom feature, allowing resellers to share a public-facing page of their listed inventory at /.

Schema changes:

-> Added username String? @unique to the User model — enables vanity URL routing
-> Added isPublic Boolean @default(false) to InventoryItem — per-item opt-in visibility control

New route (/:username):

-> Resolves the username to a user, returns 404 if not found
-> Fetches only items where isPublic: true using Prisma select — sensitive fields (purchasePrice, purchaseDate, userId, notes) are never sent to the client
-> Converts askingPrice Decimal to Number before serialization to prevent hydration issues
-> Renders a responsive card grid with item name, brand, size, and asking price

Related Issues

Closes#91

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Screenshots (if applicable)

No UI changes.

@vercel

vercel Bot commented Jul 5, 2026

Copy link
Copy Markdown

@Yuva-Deekshitha-N is attempting to deploy a commit to the participationcorner2025-8967's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added the ECSoC26 Required label for ECSOC Sentinel scoring label Jul 5, 2026
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown

📝 Summary

The provided pull request introduces a new route for user profiles, allowing users to view their public inventory items. The changes include updates to the Prisma schema, adding a username field to the User model and an isPublic field to the InventoryItem model. A new route, /:username, is added to handle requests for user profiles.

📂 Files Changed

  • app/routes.ts: Added a new route for user profiles.
  • app/routes/$username.tsx: Created a new file for the user profile route, including a loader function and a React component.
  • prisma/migrations/20260701_add_username_and_ispublic/migration.sql: Added a new migration to update the database schema.
  • prisma/schema.prisma: Updated the Prisma schema to include the new fields.
  • package-lock.json: Updated the package lock file.

🎭 Code Poem

Users can now view their items with ease,
Public profiles are available, if you please.
The Prisma schema's been updated with care,
And the new route's ready, with data to share.

🚨 Bugs & Architectural Violations * The `PublicShowroom` component is not placed in the `app/blocks/` directory, which is the required location for UI components. It should be moved to `app/blocks/__global/PublicShowroom`. * The component uses inline styles, which is not recommended. Instead, it should use Vanilla CSS Modules (`.module.css`) for styling. * The `loader` function does not handle errors properly. It should be updated to handle potential errors when fetching data from the database. * The `PublicShowroom` component does not include any accessibility features, such as `aria-hidden` or `role` attributes. These should be added to ensure the component is accessible. * The component uses `var(--color-border)` and `var(--color-text-muted)`, which are not defined in the provided code. These variables should be defined in a CSS file or replaced with actual color values.
💡 Suggestions & Best Practices * Consider adding a `defer` function to the `loader` function to improve performance. * Use `transform` or `opacity` for CSS animations instead of triggering main-thread repaints. * Add a `key` prop to the `img` element to ensure it is properly updated when the image URL changes. * Consider adding a loading indicator or a skeleton component to display while the data is being fetched. * Use a more robust error handling mechanism, such as a try-catch block, to handle potential errors when fetching data from the database. * Consider adding a `meta` tag to the `head` of the HTML document to provide metadata about the user profile page.

@Yuva-Deekshitha-N

Copy link
Copy Markdown
Contributor Author

Hi! I hope you're doing well.

I just wanted to follow up on my pull request. I noticed it has been open for a few days, so I was wondering if you've had a chance to review it.

If there are any issues or changes needed from my side, please let me know. I'd be happy to make the necessary updates.

Thank you for your time!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26 Required label for ECSOC Sentinel scoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant