Introduction
Important setup instructions to note before contributing to the project.
Prerequisites
Some software we need to get started developing (if you don't have them already)
NodeJS >= 18.x.x
NPM
Docker
Ngrok
Developer Setup
Please follow the following instructions to setup the environment properly for development. There will be instructions for Windows and MacOS.
Install NodeJS (at least version 18). The NPM package manager will be installed with NodeJS.
(optional) Installing a version manager (e.g. nvm, asdf) to manage multiple versions of Node. Since you will generally only be using one version, this doesn't really matter but it may be helpful.
You may also opt to use another JS runtime like Deno or Bun and another package manager like Yarn or PNPM, but we do not guarantee they work (and please do not commit any lockfiles to Git).
Install Docker. We recommend you install Docker Desktop to have the GUI.
Install Ngrok. This is solely to tunnel Shopify test requests back to localhost in development and is not used in production. You will only need to use this when testing Shopify checkout related workflows.
Running on localhost
Now we are ready to setup the codebase and run the application for the first time.
Clone the repository.
git clone https://github.com/leofuturer/eDrops3.git
cd eDrops3Then make sure you have the latest environment variables in the deploy/ folder. These should be in Google Drive for you to download. Contact a codeowner if you need assistance.
Choose a frontend to work on (main site, community site). Here we use the main site which is in the
client/folder.
cd clientInstall all packages first. This may take a while if its the first time and no packages are cached.
npm installRun the frontend
npm run devMany features that require the backend will not work (e.g. login, view products, etc.), so now we will start the backend.
We want to leave the frontend running. So in a new terminal, enter the
server/directory where the backend code is.
cd serverBuild the docker container for the backend. See for a crash course on what Docker is and how to use it.
docker build -t edroplets_backend .Pull the docker images for MySQL and Ngrok respectively from the Docker container repository. These are for the MySQL database and Ngrok tunnel for development.
docker pull mysql:8
docker pull ngrok/ngrok:latestNow we can use docker-compose to stand up all the backend services.
The compose files are in the root of the project. So go back to the root if needed, i.e. with
cd ..The first time we run this we want to seed the database (initialize it with data). So we add additional environment variables. On subsequent runs you do not need to do this and you probably don't want to do it as it resets the database.
$env:RESET_DATABASE = 'Yes'; $env:MIGRATE_DATABASE = 'Yes'; docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d; $env:RESET_DATABASE = ''; $env:MIGRATE_DATABASE = ''; docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs -fRESET_DATABASE=Yes MIGRATE_DATABASE=Yes docker-compose -f docker-compose.yml -f docker-compose.dev.yml up -d && docker-compose -f docker-compose.yml -f docker-compose.dev.yml logs -fThe first time the MySQL container is created, the database needs to be created, so this command may take some time. Please be patient and wait until you receive the message:
edrop_backend | Server is running at http://127.0.0.1:3000Voila! Now if you visit the frontend page at localhost:8086 again, you should see everything working. Login with the below test login:
username: customerA
password: edropTest123If anything does not work, please double check you have the correct environment variables, visit Troubleshooting, or contact a codeowner for assistance.
Last updated

