Medusa

Medusa Next.js Starter

Medusa is an open-source headless commerce engine that enables developers to create amazing digital commerce experiences.

Medusa is released under the MIT license. PRs welcome! Discord Chat Follow @medusajs

> **Prerequisites**: To use the starter you should have a Medusa server running locally on port 9000. Check out [medusa-starter-default](https://github.com/medusajs/medusa-starter-default) for a quick setup. # Overview ![next-starter](https://user-images.githubusercontent.com/45367945/182571697-a68c502f-5844-4eea-8735-7683f775ac8b.png) The Medusa Next.js Starter is built with: - [Next.js](https://nextjs.org/) - [Tailwind CSS](https://tailwindcss.com/) - [Typescript](https://www.typescriptlang.org/) - [Medusa](https://medusajs.com/) # Quickstart ## Deploy in 5 minutes [![Deploy to Netlify](https://www.netlify.com/img/deploy/button.svg)](https://app.netlify.com/start/deploy?repository=https://github.com/medusajs/nextjs-starter-medusa) ## Setting up the environment variables Navigate into your projects directory and get your enviroment variables ready: ```shell cd nextjs-starter-medusa/ mv .env.template .env.local ``` ### Install dependencies Use Yarn to install all dependencies. ```shell yarn ``` ### Start developing You are now ready to start up your project. ```shell yarn dev ``` ### Open the code and start customizing Your site is now running at http://localhost:8000! Edit `/pages/index.tsx` to see your site update in real-time! # Payment integrations By default this starter supports the following payment integrations - [Stripe](https://stripe.com/) - [Paypal](https://www.paypal.com/) To enable the integrations you need to add the following to your `.env.local` file: ```shell MEDUSA_PAYMENT_STRIPE_PUBLIC_KEY= MEDUSA_PUBLIC_PAYPAL_CLIENT_ID= ``` You will also need to setup the integrations in your Medusa server. See the [Medusa documentation](https://docs.medusajs.com) for more information on how to configure [Stripe](https://docs.medusajs.com/add-plugins/stripe) and [PayPal](https://docs.medusajs.com/add-plugins/paypal) in your Medusa project. # Search integration This starter is configured to support using the `medusa-search-meilisearch` plugin out of the box. To enable search you will need to enable the feature flag in `./store-config.json`, which you do by changing the config to this: ```json { "features": { "search": true } } ``` Before you can search you will need to install the plugin in your Medusa server, for a written guide on how to do this – [see our documentation](https://docs.medusajs.com/add-plugins/meilisearch). The search components in this starter are developed with Algolia's `react-instant-search-hooks-web` library which should make it possible for you to seemlesly change your search provider to Algoli instead of MeiliSearch. To do this you will need to add `algoliasearch` to the project, by running ```shell yarn add algoliasearch ``` After this you will need to switch the current MeiliSearch `SearchClient` out with a Alogolia client. To do this update `@lib/search-client`. ```ts import algoliasearch from "algoliasearch/lite" const appId = process.env.NEXT_PUBLIC_SEARCH_APP_ID || "test_app_id" // You should add this to your environment variables const apiKey = process.env.NEXT_PUBLIC_SEARCH_API_KEY || "test_key" export const searchClient = algoliasearch(appId, apiKey) export const SEARCH_INDEX_NAME = process.env.NEXT_PUBLIC_INDEX_NAME || "products" ``` After this you will need to set up Algolia with your Medusa server, and then you should be good to go. For a more thorough walkthrough of using Algolia with Medusa – [see our documentation](https://docs.medusajs.com/add-plugins/algolia), and the [documentation for using `react-instantsearch-hooks-web`](https://www.algolia.com/doc/guides/building-search-ui/getting-started/react-hooks/). # Resources ## Learn more about Medusa - [Website](https://www.medusajs.com/) - [GitHub](https://github.com/medusajs) - [Documentation](https://docs.medusajs.com/) ## Learn more about Next.js - [Website](https://nextjs.org/) - [GitHub](https://github.com/vercel/next.js) - [Documentation](https://nextjs.org/docs) …or create a new repository on the command line echo "# invogwatches-frontend" >> README.md git init git add README.md git commit -m "first commit" git branch -M main git remote add origin https://github.com/Lerolldesign/invogwatches-frontend.git git push -u origin main …or push an existing repository from the command line git remote add origin https://github.com/Lerolldesign/invogwatches-frontend.git git branch -M main git push -u origin main# invogwatches-frontend