-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature: Next.js e-commerce template #292
base: main
Are you sure you want to change the base?
Conversation
# vercel | ||
.vercel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# vercel | |
.vercel |
} | ||
} | ||
|
||
query GetOrdersByCustomerId($customerId: String!) @auth(level: PUBLIC) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we lock this down by auth.id? Same with getorder
) | ||
} | ||
|
||
mutation CreateOrder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
create and update order need to be authenticated
@@ -0,0 +1,114 @@ | |||
mutation UpsertCustomer( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auth plz
const cookieStore = await cookies() | ||
const session = cookieStore.get('__session')?.value | ||
|
||
if (session) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should do real auth here, you can see the latest on how to accomplish this in nextjs in the updates I made to our codelab https://github.com/firebase/friendlyeats-web/blob/bffaeae7647f7ea61b4a369a9567881cb8183e8c/nextjs-end/src/components/Header.jsx#L12
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main feedback here is that we actually need to do real authn/z as people will actually go to production with our starter templates.
Add Next.js E-commerce Template
Description
This PR adds a new
nextjs/firebase-ecommerce
template to demonstrate building a full-featured e-commerce application using Next.js and Firebase services. This template showcases real-world implementation patterns and Firebase integration best practices.Key Features
Firebase Services Utilized
Implementation Details:
The template follows the same structure as our existing basic Next.js starter (referenced in
starters/nextjs/basic
) but adds e-commerce specific features and Firebase service integrations. It maintains compatibility with Firebase App Hosting's configuration-free deployment process.Testing