Skip to content

Migration of an eCommerce Monolithic Architecture to a Service Oriented Architecture

Notifications You must be signed in to change notification settings

G-Jenkins/Project-Atelier

 
 

Repository files navigation


Project Atelier E-commerce Page Redesign


Explore the docs »

Table of Contents
  1. About
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Optimizations
  6. Contributing
  7. Contact

About

Client Portal

project landing page image

Project Atelier is a full redesign of a product webpage, to deliver a modernized, dynamic and responsive web application utilizing the component React that is a web-developer to client file sharing and communication platform that is not just functional, but also intuitive and user-friendly, catering to clients who found existing services like Dropbox overly complex.

Built With

node.js React Javacript

(back to top)

Getting Started

Instructions to setup Project Atelier on your local machine below.

Prerequisites

NPM

npm install npm@latest -g

Installation for Development Environment

Clone the repo

git clone https://github.com/buffalo-while/Project-Atelier

Create local .env and .config.js files

  • Copy the example.env file, rename to .env, add you github credentials and preferred local port to use
  • Copy the example.config.js file and rename to .config.js
  • Make sure both files created are in the same top level directory as the example files

Run the following commands from the top level project directory:

# Install dependencies
npm install

# Start the server, and refresh when files are updated using nodemon
npm run server-dev

# Build the client side of the app and refresh when files are saved using webpack
npm run client-dev

Deployment

To deploy in production:

  • ensure node is installed in production instance
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
  • clone repo to production instance
git clone https://github.com/buffalo-while/Project-Atelier.git
  • navigate to ProjectAtilier root directory
  • update example.env file to be .env and add your API tokens and port 3000
  • run the following commands in ubuntu
npm install
npm run build

Usage

Pixel Atelier is run on the designated port. It can also be accessed utilizing localhost:PORT directly in the browser.

Run linter: npm run lint

(back to top)

Optimizations

  1. To be added

Contributing

Feel free to join in! Whether its fixing bugs, improving documentation, or simply spreading the word!

Contact

Greg

James

Justin

Stephen

(back to top)

Additional project details

Git Workflow

  1. If first time working on the repo, git clone main branch from git to local machine
git clone https://github.com/buffalo-while/Project-Atelier.git
  1. Optional: Make sure you are working from latest version of main
    • Note: alternative is to keep working from the most recent version of your feature branch, but this could lead to more conflicts to resolve when you eventually make pull request to merge into main
git checkout main
git pull origin main
  1. Create or checkout branch for feature you will be working on - DO NOT WRITE CODE DIRECTLY IN MAIN BRANCH
git checkout -b <new-feature-branch>

or

git checkout <feature-branch>
  1. Optional: Merge main branch into your working branch, and resolve any conflicts in your branch
    • if there are merge conflicts and you do not accept incoming changes only, consider submitting a pull request to make these changes in main before moving forward (see steps 5 to 11)
git merge main
  1. Work/write code in feature branch until ready to submit to main

    • this could include creating or using any number of different branches and merging or rebasing commitsinto your feature branch
  2. Make sure all you have added and committed all files that you want to include in your feature branch

git add <file-name-1> <file-name-2> <...>
git commit
  1. Pull latest version of main, merge into your feature branch and resolve any conflicts

    • see steps 1-3
  2. Push your feature branch commits to your feature branch in github

git push origin <feature-branch>
  1. In Github, make pull request (PR) to main from your feature branch

  2. Code review from at least one teammate will be required

    • Make sure your Trello user story and implementation cards are linked from the pull request, and that the implementation task is in the Staged for Review section of Trello
    • Any teammate can pick up a code review, and should join the Trello card and make a comment that they will be reviewing in the pull request to avoid duplication of effort by reviewers
    • If you want review from a specific teammate or from multiple teammates, coordinate with them directly and make this clear in the pull request so that other teammates do not review and/or complete the merge before the
    • Code reviews will generally be completed async
  3. Address any feedback received by updating, committing and pushing code to github in your feature branch, or responding to reviewer questions as applicable

    • make sure to update the pull request so that the reviewer knows to review again
  4. Resolve any merge conflicts if indicated in github, once code review is completed, commit and push your feature branch to Github

    • see steps 1-3
  5. Complete the merge using the magical green button that will now show in the github pull request

  6. Take a minute to celebrate your win, and then rinse and repeat

Additional Notes:

  • Minimize conflicts and disruption of large code reviews by submitting PRs early and often
  • That is not a license to break the site, verify that the page is still rendering correctly/without errors and no tests that were previously passing are failing at each stage of the pull request process, including after making changes based on code review and after resolving conflicts
  • Mistakes could happen, teammates will seek to be forgiving if rollback of main to earlier version of git is necessary

Making API requests

All API requests should be routed through the server, by making requests to url /api/<endpoint> where endpoint, paramaters, request method and request body are as specified by the Atelier API.

The server will add Authentication to the request based on github token included in .env file, before rerouting the request to the API and passing back the response provided by the the API.

Rating and Reviews Module

getRatings function

The getRatings function is designed to provide a rating stars react element as well as other rating and reviews meta data for a particular product for any module that needs it.

As such it is imported into App.jsx from where it can be passed as a prop to any module.

getRatings takes an argument of any productId string and a second optional argument of a css class name string, and returns a promise of an object with the following properties:

{
  totalReviews: <string>,
  meanRating: <string>,
  RatingStars: <react span element>,
  allMetaData: <object>
}

More information for each property:

  • totalReviews
    • number of total reviews for the product, or
    • "N/A" if API request failed
  • meanRating
    • mean (average) of all ratings, rounded to 1 decimal point, for the product, or
    • "N/A" if API request failed
  • RatingStars
    • react element (span) with name "ave-rating-stars" and css class(es) named "stars" plus the css class name passed to the getRatings function if applicable
    • the element will display 5 star icons which are solid (filled) up to the meanRating rounded to nearest 0.25 with the remainder outline only, or
    • the element displays 'Unable to show rating' if the API request errored
  • allMetaData
    • an object containing all reviews meta data for the product, or
    • an empty object if API request failed

About

Migration of an eCommerce Monolithic Architecture to a Service Oriented Architecture

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 84.8%
  • CSS 14.8%
  • HTML 0.4%