DEV Community

Nazim Boudeffa
Nazim Boudeffa

Posted on • Edited on

3

Testing Features of Medusa

I've started to code a marketplace with Next and I have started to learn some of the plugins of medusajs on my way to that objective

BTW I wish I can succeed because sometimes I just want to giveup, it's not easy but as an old gamedev I can make things be fun

So I've created a repository called nextjs-marketplace-medusa

Then npx create-next-app@latest --typescript

Then just install and configure TailWind

After that actually I use to tests some code about fetching the products

I use to code on Windows

So I have created a medusa server on an Ubuntu Desktop (actually 22.04) with VirtualBox

Installed Redis and Postgres like explained on the medusajs documentation site https://docs.medusajs.com

Image description

Image description

Image description

This server has an URL that I access from the Next app by changing the server's CORS to http://localhost:3000 even if I can just launch the Next app with changing the port to 8000, why? It's just to understand the CORS feature and let port 8000 as is for the Next Starter

I add a .env file to the app with the URL to the Ubuntu medusa server NEXT_PUBLIC_MEDUSA_BACKEND_URL="http://192.168.0.45:9000" and that's it

It works !

Image description

Next step is to separate the test that I do on the endpoint from the marketplace to a repository called nextjs-tests-medusa

This approach allows to separate the medusa server from Windows in a VirtualBox and let to install multiple ones to work on the marketplace

Sentry image

Hands-on debugging session: instrument, monitor, and fix

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

RSVP here →

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay