/medical-shop

A Containerized ecommerce store, built with node js, neo4j, docker and woocommerce rest api.

Primary LanguageJavaScript

One Stop Medical Shop

One stop eCommerce shop for providing medical equipments and products. Alt text Alt text Alt text

Getting Started

Video Guide

Design

image

Start the services

  • Install docker desktop and docker compose
  • Clone the repository
  • Start docker desktop
  • run the following command:
  docker-compose up 
  • Some things to keep in mind while using this file: ⭐️ We'll need the name of our network later on, so be aware about it. ⭐️ Neo4j browser will be available on localhost:7474 and the login credentials for connecting with neo4j db are as follows.
  bolt url : bolt://localhost:7687
  username: neo4j
  password: bitnami1

Populating the db via node js script

  • we've create a Docker file for this process
  • Steps:
  mkdir db-loading
  cd db-loading
  npm init -y
  npm i neo4j-driver dotenv
  touch app.js
  touch Dockerfile
  touch .dockerignore
  copy code from my files to yours
  • With this Dockerfile, we have our image ready and now we need to build it and run a container
  docker build -t dataloadermonster . //builds the image
  docker run -d --network=smarter-codes_wordpressdb_net dataloadermonster //starts a container with above image.

📌 We're setting the network for our new container, same as the network we created during the step 1 of docker-compose up. We want to be able to query to the neo4j container that is already running in the bg. So, being in the same network is crucial to establish communication.

✅ Our dataloadermonster's container will execute the query, which will populate the neo4j db and exit from the process.

  • we've create a Docker file for this process
  • Steps:
  mkdir backend
  cd backend
  npm init -y
  npm i neo4j-driver dotenv randomstring 
  touch app.js
  touch Dockerfile
  touch .dockerignore
  copy code from my files to yours
  • With this Dockerfile, we have our image ready and now we need to build it and run a container
  docker build -t backendapi . //builds the image
  docker run -d --network=smarter-codes_wordpressdb_net backendapi //starts a container with above image.

Adding product to the woocommerce store with neo4j db's data using node js

Neo4j Visualization Video

productvisualization.mov

Neo4j Visualization Screenshots

Neo4j homepage showing relations of a product node with other nodes:

Screenshot 2023-12-10 at 4 38 06 PM

All the Product Nodes

Screenshot 2023-12-10 at 4 35 26 PM

Brand Nodes

Screenshot 2023-12-10 at 4 36 21 PM

Manufacturer Nodes

Screenshot 2023-12-10 at 4 36 45 PM

References