Skip to content

syuChen1/Shoppingfy-MERN

Repository files navigation

Shoppingfy-MERN Build Status

Features:

  • User:
    • Full featured shopping cart
    • Product reviews and ratings
    • Top products carousel
    • Product pagination
    • Product search feature
    • Ceckout process (shipping, payment method, etc)
    • PayPal / Credit card integration
  • Admin:
    • Product management
    • User management
    • Order details page
    • Mark orders as delivered option

Built with:

  • React, Redux
  • Javascript, Node.js, Express, MongoDB
  • Containerlized with Docker
  • Nginx, TravisCI
  • Deployed on AWS Elastic BeanStalk

Setting up Development:

git clone https://github.com/syuChen1/Shoppingfy-MERN.git
cd Shoppingfy-MERN && npm i
cd client && npm i
cd ..

replace .example.env with .env with your credentials.

To run in Development mode:

docker-compose up

Development

The development environment is composed of three dockeraizd container and run with docker-compose.

  • shoppingfy-client - localhost:3006
  • shoppingfy-server - localhost:5000
  • shoppingfy-nginx - Load balancer serve to redirect traffic to client or server depending on the request.

Screen Shot 2021-07-15 at 2 54 19 AM

Production

Shoppingfy is deployed on AWS Elastic BeanStalk. It uses two nginx services. The first one act as a load balancer to redirect traffic. The second one is used to serve React production files. Screen Shot 2021-07-15 at 3 29 45 AM

CI/CD and Production Workflow

  1. Push code to Github from a Feature branch
  2. Travis automatically pulls repo
  3. Travis builds a test image and test the code
  4. On test success, you would be able to review the code and merge it into master
  5. After merging, Travis automatically pulls repo and builds production image
  6. Travis pushes production image to Docker Hub
  7. Travis pushes project to AWS Elastic Beanstalk
  8. AWS Elastic Beanstalk pulls image from Docker Hub and deploys.