Medusa Eats ia a fullstack food delivery platform, inspired by Uber Eats, running on Medusa 2.0 and Next.js 14.
Medusa Eats is built with:
Features include:
- Restaurant storefront
- Realtime order status dashboards
- Driver and restaurant dashboards
- User roles
- Authentication
- Medusa Workflows
- Realtime Server Sent Event
The project consists of two main directories:
/backend
contains the Medusa 2.0 project with all the customizations.- This handles core functionalities, including user authentication, order management, and more.
/frontend
contains the Next.js project.- This handles the user interface, restaruant storefronts, dashboards, and more.
Use Yarn to install dependencies in both directories.
In /frontend
run:
yarn
In /backend
run:
yarn
The project comes with .env.template
files to quickly set up your environment variables. Copy them to a .env
file by running the following commands:
In /frontend
run:
cp .env.template .env
In /backend
run:
cp .env.template .env
Create a Postgres database called medusa-eats
.
The repo contains a setup script to build the project, run migrations and seed dummy data.
Make sure your local Postgres server is running.
In /backend
run:
yarn setup-db
This will also create an admin user with the following credentials:
email: [email protected]
pasword: supersecret
You are now ready to start up your project.
Start Medusa dev server
Make sure that Redis and Postgres servers are running locally on their default ports.
In /backend
run:
yarn dev
The Medusa server is now running on http://localhost:9000.
Start Next.js dev server
In a separate terminal, cd to /frontend
and run:
yarn dev
The Next.js frontend is now running on http://localhost:3000.
We're gonna create a restaurant admin and driver account so we'll have access to both sides of the platform.
Create restaurant admin account
- Go to http://localhost:3000/signup.
- Select 'I'm a restaurant'.
- Select the restaurant you want to create an admin for.
- Fill out the remaining form fields and click 'Create account'.
- You can now log in as a restaurant admin and access the restaurant dashboard at http://localhost:3000/dashboard/restaurant.
Create driver account
- Repeat above steps, but this time select 'I'm a driver'.
- You can now log in as a driver and access the driver dashboard at http://localhost:3000/dashboard/driver.
To go through the entire delivery workflow in realtime, you'll need to log into both a restaurant and a driver account. To do so, use an icognito window or second browser.
- Go to the storefront at http://localhost:3000/.
- Select a restaurant from the list.
- Add menu items to you delivery by clicking the + buttons.
- Click the shopping bag button on the top right.
- Click 'Go to checkout'.
- Complete the form and place you order. A live order status dashboard will show up.
- In a new tab, go to http://localhost:3000/dashboard/restaurant and log in as an admin for the restaurant you just placed an order at.
- Your order should be visible in the "Incoming orders" column. Click the button to accept the incoming order.
- In an incognito window, go to http://localhost:3000/dashboard/driver and log in as a driver.
- The accepted order will show up on your dashboard. Click the button to claim it.
- The order will go through the different stages on all dashboards in realtime. You can progress the order by marking each stage as complete on the relevant dashboard.
We happily welcome contributions to this project!
Note: Please review the source code and ensure you have a thorough understanding of it before making any changes
Follow the steps below to contribute to this project:
- Start by forking the repository to create your own copy.
- Head over to the Issues tab to view open issues.
- If you find an issue you want to work on, leave a comment to request being assigned to it.
- If you find a bug or have a feature idea that isn’t already listed, open a new issue.
- In your issue, provide a clear description and reasoning behind the bug or idea.
- After being assigned an issue, clone your forked repository to your local machine.
- Create a new branch for your changes, using a descriptive name.
- Make sure your changes don't conflict with existing functionalities
- Push your changes to your forked repository and raise a pull request to the original repository