Comments (39)
@acidlake if you have anything to share in a fork please share , it will be really appreciated - thank you
from svelte-commerce.
@acidlake Please do the PR. I will try to merge it as fast as possible, we are looking for such contribution towards medusajs integration. With litekart backend svelte-commerce is working excellent. Our next target is to finish up MedusaJs.
from svelte-commerce.
@itswadesh o thanks a lot, my bad, dint't notice that you are the creator of the repo, il do the PR once im done!!, very great product!
from svelte-commerce.
@acidlake Can you please share?
from svelte-commerce.
@acidlake if you can share we can try to give a hand there
from svelte-commerce.
Hello guys, sorry for the time, at first i as doing the changes for my project, however i did a lot of changes to the project that break the other integrations, such as woocomerce, bigcommerce etc, my suggesstion is to create some sort of adapters, that we can plug in for medusaje, woocomerce, bigcommerce etc, we may need to abstract and refactor the project, so the storefront should work with any adapter that we add, again, the modifications that i made as for my project, and since i was just using medusajs, it broke the other integrations, so an adaptar should work. or separate the project for medusajs only but that would created more work
from svelte-commerce.
@tsemachh @acidlake Merged the pull request to the master. I had to take down 1-2 commits just the keep the dev experience upto the mark.
from svelte-commerce.
Can you please screenshot or video for that issue?
from svelte-commerce.
from svelte-commerce.
I have the same error
from svelte-commerce.
EDIT: Looks like this was made for an old version of Medusajs or is not finish the implementation
Found the error, going to add a try catch on utils/server.ts ,Here are some pictures, looks like it needs some modification for medusajs @StevenChege take a look to this,
from svelte-commerce.
Thanks @acidlake, but i still can't make it work. I found the issue stems from my medusa server, with ProductCategory
id
missing or mismatch . What ProductCategory schema is compatible?
Here is a screenshot.
from svelte-commerce.
@StevenChege i'm doing modifications to the source code for medusa, since it looks like its using an older version, for the categories id it should be something like: pcat_shirts, also add http://localhost:3000 to your medusa backend store cors, i manage to show some products, but still lot of work to do, i'm changing the code to take into consideration the current medusa version, at least you can login, logout, singup, but still needs to change more stuff
from svelte-commerce.
@StevenChege this is an screen from my medusa server
from svelte-commerce.
@acidlake The categories from medusa server looks fine. Is svelte-commerce working fine your side?
from svelte-commerce.
@itswadesh so far is a mixbag, but i manage to successfully connect, i'm doing changes on svelte-commerce source code to make it work as expected, search don't work, homepage don't show anything, categories are working, but product details is not, still lot of things to fix, once im done il see if i can do a PR, and check if the owner of svelte-commerce accept it, if no il share a repo
from svelte-commerce.
Ok guys, quick update, so far good progress, here is how the product page looks, i also created a basic image gallery for the product detail page, so far working great with medusa, il continue with the other fixes.
from svelte-commerce.
Hi, thanks for the update. Can you please push it to a different branch, so that we can have a look and make necessary changes to keep other services working and eventually merge it into master.
We though of making a adaptor for each of those services, where as it would make the developer experience difficult, like F12 key won't work to navigate to the exact method.
Ideas are welcome.
from svelte-commerce.
Thank you @acidlake and congrats for the new member.
As for the right way to decouple , I think we will be smarter once we see the actual changes.
As long as we stick with having all adaptors in same repo and uncommenting the implementation we want
, the files navigation works on both IJ and Code.
If we keep it all in monorepo with dependencies to the adaptors it may help with the navigation issue , and maybe in general will be good evolution.
from svelte-commerce.
@acidlake and @itswadesh
I started reviewing the current Medusa APIs , most of them are not working as expected ,
While medusa BE expects mainly Ids , APIs are working with slug(Or handle in mesua terms)
There's a need to call other APIs to accomplish that.
(Sometimes more than one , unless we change the call to pass both slug and Id)
Also I noticed that APIs called are not calling the exact API needed for example getting category products returns all products.
I guess there are more to follow.
One more thing , sometimes the APIs are called from the UI , sometimes from from the server.js ,
I would expect some consistency , as my knowledge in sveltekit preparing the data to the page should be in server.js
(This alone can solve CORS issue we may have with the BE)
@acidlake if you can make the branch I think I can take it from there
Tsemach
from svelte-commerce.
Thank you @acidlake and congrats for the new member. As for the right way to decouple , I think we will be smarter once we see the actual changes. As long as we stick with having all adaptors in same repo and uncommenting the implementation we want , the files navigation works on both IJ and Code. If we keep it all in monorepo with dependencies to the adaptors it may help with the navigation issue , and maybe in general will be good evolution.
@tsemachh thank you so much for taking time studying the under laying structure and the suggestion. If it solves the file navigations issue, surely mono repo will be a good idea. Would it be possible to setup the file structure, while @acidlake push the changes to a new branch or raise a pull request.
from svelte-commerce.
@itswadesh I do prefer to get @acidlake PR first so I will have full view of the changes made .
What I can say in general 2 things:
- In some point if this project evolves to something big it's better to have API and Themes available as plugins
- As for APIs - APIs called to prepare the page should be in the relevant server.js/ts calls , other APIs can be either invoked from the page itself or call API end points on the server which will perform the actual call.
In other project I did I also had the retrieve APIs using API endpoints , this really helped when I used partial SSG for the API calls
in our case , categories and product pages data can be pre generated as an API and updated on changes
from svelte-commerce.
@tsemachh This is interesting, and will give a lot of performance improvements. However I have following questions.
- Do we need to rebuild the repo each time the category or product info changes
- What if I have a million products, will it be a good idea?
from svelte-commerce.
Basically in order to support incremental SSG there's a case opened ,
And Vercel has support for it if you run there - https://vercel.com/docs/concepts/incremental-static-regeneration.
Since this is the case , what I did in other project is to generate just the changes and deploy them into the site.
You can define when you generate the changes which routes to re-generate , this way you can have better control of what's generated without waiting for case resolution.
BTW: I did saw that the project does not support product variants which is basic for our case in MedusaJs so we may choose another StoreFront (Unless @acidlake provided decent support for it)
from svelte-commerce.
Hello Guys, i'm working on the PR at this moment, since originally i fixing the project for my own storefront with different requirements etc, and i was removing everything related to the other backends, since i was keeping medusajs, i created a new fork, and im uploading my changes.
from svelte-commerce.
from svelte-commerce.
Ok guys quick update, there's still a lot of work todo, but at least now the products are being show, categories, product detail page. so you guys can take a look tot he PR, download the branch and take a look.
from svelte-commerce.
Started looking into all the pull requests. Let's connect on discord before merging so that we can discuss all the aspects to it
I will be available 11:00-19:00 GMT
from svelte-commerce.
i see some comments regardles break of SaaS, when i checked this project i was testing medusajs, but since the storefront needs a loot of work and medusajs still lacks some features, i switched to Saleor, but i decided to create a storefront from scratch, that's why i took to long to upload the changes, since i was already finish with the testings in this project and medusa and i deleted that repo, but didn't know that this project was part of a SaaS, my suggest is to focus on one storefront at the time, for example, i see the project is very harcoded to support litekart, which i asume is your SaaS, in order to support more backends and have better customization, better DX, is better to create a generic solution, with adapters, or services that can be easy switch, and customized for that spesific project, i added an option to switch from one service to other very easy, but like i say, the project is too heavy on litekart, so it would be better to drop the support for medusajs, and be focus on litekart
from svelte-commerce.
We are committed to integrate as many storefronts we can, and this repo has that capability.
Medusa is still under heavy development. To make the storefront fully functional we 1st tried to integrate with Litekart which is working 100%. Next step is to integrate Medusajs.
Regarding SaaS compatibility, there is only 1 line that has to be changed.
Regarding Medusajs compatibility we are also working on it in sync with Medusa development, and have completed a lot of integration, its just matter of cleanup and some branch merger.
We are keeping it all together just for simplicity and developer experience.
@acidlake if you can create a pull request on the feat/medusajs-api-integration branch instead of master, I will have a look how can we make it compatible with both the ecommerce platforms.
from svelte-commerce.
Got it, i switched the pr to the feat/medusajs-api-integration branch
@itswadesh
from svelte-commerce.
@itswadesh
From my experience it's very hard to maintain customizable UI.
If you want to make it work with various APIs , you need maybe in UI/Store level to control display of elements on the store.
I agree the storefront can be used with various APIs but there's still work need to be done.
I would start with:
- Going other all places which swallow exceptions and at least console.error them
- Having some config for the storefront of which functionalities are relevant , because even in store level you may take some of the extensions
In general it looks like a project with great potential and integration with medusajs is blessed.
from svelte-commerce.
@tsemachh Thank you so much for your insights.
I am trying my best to accommodate different store api without breaking each other.
from svelte-commerce.
nice, should we close this issue, since the Unhandled promise rejection get solved with the PR merged to master
from svelte-commerce.
@itswadesh and @acidlake - thank you very much for pushing it forward.
@itswadesh is there any branch which has medusajs API changes ? we still see gaps and would like to add our insights there.
from svelte-commerce.
@tsemachh Medusa is merged into master, can be activated from services/index.ts
file.
Can you please specify the exact error
from svelte-commerce.
Many of the APIs are not functioning properly:
- Getting products of category - brings all products
- The search products API is not written in the right way should pass query in the body of the post API
- Adding product to cart produces Undefined , something is not correlated to the right structure
- Price is not coming the right way , should be processed
- No dedicated code for Variants and their options
We didn't check all APIs but I think besides not failing , the basic should integrated with seeded medusa BE
from svelte-commerce.
Thanks @tsemachh for letting us know, the issues are fixed now
- Products of categories
- Search products api
- Add to cart
- Price coming now
- Variants introduced
- Basic checkout flow is working.
from svelte-commerce.
Thank you @itswadesh it looks better from first view I still see the API:
fetchProductsOfCategory
res = await getMedusajsApi(products?category_id[]=${categorySlug}
)
category_id != categorySlug
You will need to get the id first and then use it in the API
Good luck though
from svelte-commerce.
Related Issues (20)
- Display server errors HOT 2
- Add a security policy HOT 1
- Migrate to SvelteKit HOT 3
- [filtering page] APPLY button is not shown at the bottom of a screen on an Android phone HOT 4
- npm i (8.19.1) not able to run dev HOT 1
- Err at Hooks... TypeError: Cannot read properties of undefined (reading '_id') HOT 1
- api structure document HOT 1
- Link to documentation HOT 2
- What is the docker compose.yaml HOT 4
- Fix reel video page HOT 8
- Error 500 when deployed to vercel/netlify HOT 2
- Make documentations on how to change part of the project
- Add theming feature HOT 1
- WooCommerce 'undefned' error HOT 1
- Documentation or Guide for integration with Medusa HOT 3
- .prettierrc missing plugins key, uses deprecated option HOT 1
- Documentation for Woocommerce HOT 1
- Deployment to netlify is broken HOT 2
- Getting store not found error HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svelte-commerce.