Skip to content

GraphQL Microservice Arch implementation for e-commerce store using Apollo Federation.

Notifications You must be signed in to change notification settings

PreetamSing/e-commerce-federation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

e-commerce-federation

GraphQL Microservice Architecture implementation for basic e-commerce store using Apollo Federation. This project is just meant to serve as a PoC ( Proof of Concept ).

Note

You cannot use the buyProduct mutation without having a frontend, which has integrated stripe, as it involves payment intent creation. And required Frontend app is not included in this repo!

Rover Configuration

Install Rover CLI

npm i -g @apollo/rover

Follow these two steps: #1 and #2

Reference

Rover CLI

Rover CLI for Subgraph

Setup

Clone the project from Github.

Run following command in every service directory, namely "auth", "cart", "rest-api".

rover subgraph publish ${Graph id}@${variant} --schema "./src/${service name}-schema.graphql" --name ${service name} --routing-url "http://localhost:${service port}/graphql"

Install Dev dependencies in the root directory of project by running:

npm i -D

Install the dependencies of all the components by running:

npm run load-dependencies

Install and login into Stripe CLI by following this guide.

To start listening for webhook on localhost run following command:

stripe listen --forward-to http://localhost:${Router Port}/rest/api/v1/webhook/stripe

Run following command in every component's directory, namely "router", "auth", "cart", "rest-api".

npm run copy-env

Fill up the created .env files in all the components with appropriate values.

Migrate back to root directory of the project, and run:

npm run dev

About

GraphQL Microservice Arch implementation for e-commerce store using Apollo Federation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published