weakky / prisma-ecommerce Goto Github PK
View Code? Open in Web Editor NEW💰A graphql e-commerce real-world fullstack example (backoffice included)
💰A graphql e-commerce real-world fullstack example (backoffice included)
There are no payment view yet. This view would appear after the "Summary" step.
Integrating such a lib would be extremely sick https://github.com/sbycrosz/react-native-credit-card-input 🌮
Using graphql-shield
or https://blog.graph.cool/graphql-directive-permissions-authorization-made-easy-54c076b5368e
Step1. Allow only users with role ADMIN
to perform those mutations:
# Upsert mutations
upsertBrand(brandId: ID, categoryId: ID!, name: String!): Brand
upsertAttribute(attributeId: ID, categoryId: ID!, value: String!): Attribute
upsertCategory(categoryId: ID, name: String!): Category
upsertOption(optionId: ID, name: String!, values: [OptionValueInput!]!, categoryId: ID!): Option
upsertProduct(
productId: ID,
name: String!,
categoryId: ID!,
brandId: ID!,
available: Boolean!,
optionIds: [ID!]!,
variants: [ProductVariantInput!]!,
attributesIds: [ID!]!,
unavailableOptionsValuesIds: [ID!]!,
displayPrice: Float!,
imageUrl: String
): Product
#Upsert Shop metadata
upsertBestSalesProducts(shopMetadataId: ID, bestSalesProducts: [OrderableProductInput!]!): ShopMetadata!
upsertNewProducts(shopMetadataId: ID, newProducts: [OrderableProductInput!]!): ShopMetadata!
upsertMOTD(shopMetadataId: ID, MOTD: String!): ShopMetadata!
# Delete mutations
deleteProduct(productId: ID!): Product
deleteOption(optionId: ID!): Option
deleteBrand(brandId: ID!): Brand
deleteAttribute(attributeId: ID!): Attribute
deleteCategory(categoryId: ID!): Category
#Order mutations
setOrderAsPrepared(orderId: ID!): Order #Can be updated only by admins (eg: to set order as prepared)
And those queries:
allCustomers: [User!]!
Send a query when clicking on the "Continue" button on the cart view, to perform a global check on all the items present on the user cart, to make sure every items are still available nor deleted.
Result should probably not be cached. Use fetchPolicy: 'network-only'
here.
The MOTD field is already present in the datamodel.
Everything still needs to be done though, on Prisma (building the resolver), on the backoffice (creating the view to be able to update it), and on the mobile app (to query and display the MOTD)
The current UI's for those are really prototypes so that I could continue the RN app. They definitely needs to be done in a better way, mostly in terms of UI. The UX is already kind of good.
Provide a way to go back to the product list
They're just not present at all yet.
On the prisma side, an empty string is set for now.
When a client submit an order:
For the seller:
Allow the developer to...
Although there's already some pagination handled by react-table
(UI wise), we're querying all the products at once, which will lead to really slow performance in the future.
I need this file to test with data, but I can't find it anywhere.
Find a way to build cleaner and more maintainable forms for every models that are CRUD using the backoffice
Hint: This might be an option https://github.com/Volst/graphql-form-helpers
The button is present, but nothing is done yet.
react-native-picker
should be used, just like on the <Product />
view.
Bonjour Flavian, je suis très intéressé par ce repo et le code que tu développes, moi même je travaille avec Prisma,
Je t'ai contacté sur twitter récemment, pourrai-tu m'appeler sur mon tel au 0675505209?. Je cherche quelqu'un comme toi.
Tu peux fermer cette issue après l'avoir lue
Inline-styles should be put in their respectives .styles.js files.
Using styled-components
could be an option as well
As the app will solely be used as a "drive" e-commerce system, we need a way to be able to see incoming orders easily.
An iPad app sticked to a wall, plugged to the prisma API with subscriptions to get in-real incoming orders would be the perfect option.
This app would allow the shop owner to:
All the views are made, but the mutation is not yet sent to the server.
When a product is deleted from the backoffice, we delete all cart items that had this product in it.
When the user logs in again, we should warn him we an Alert.alert()
that some products of his cart were deleted.
We could simply save in AsyncStorage
the number of item in his cart, then compare it when fetching his cart from the server.
If localCartItemsLength < serverCartItemLengths
then Alert.alert()
the user.
An example of a problem: select a product on the home page, then once on the product sheet, and go back.
The last tab on the RN app will be dedicated to user's account, allowing him to manage all kind of stuff.
ShopMetadata
model)Users are redirected to home view right away after successful payment.
There should be an intermediate view confirming that his payment was successful.
Provide a way for users to be able to reset their passwords.
An email should be sent.
As of now, when adding options to a product, you're forced to use ALL the linked options values. There should be a way to only add SOME of the values.
eg: A t-shirt can only exist in Color blue
, and black
, even though the Color option has the color value yellow
. In this case, admin should be able to disabled option value yellow
.
I'm currently working on your project.
did update apollo and code relative to work with last version.
app working with last apollo2 now.
I already setup the Facebook login with prisma in my repo, i can add it here too
Only the name of the product is shown for the moment.
We could only show the optionValues.
t-shirt x 2 (XL, Blue)
Prevent submitting forms when required fields are not fullfilled.
(Especially the product creation/edition form)
When a product was put in an order, it cannot be deleted.
GraphQL error: The change you are trying to make would violate the required relation '_OrderLineItemToVariant' between OrderLineItem and Variant
PREPARED
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.