Coder Social home page Coder Social logo

cloud's Introduction

๐Ÿ“š LINFO2145 Project: Scalable Shopping-cart Application

Each microservices are described in detail in their folder backend but we will explain briefly each microservices.

HOW TO RUN...

The project is already running on our machine so you can access by clicking on this link http://cloud-romtourpe.westeurope.cloudapp.azure.com:3000 you can make some curl manually to each address or download the project on your machine and follow those instructions.
To run the project on your virtual machine you have to follow those instructions :
โš ๏ธFirst of all you need to modify the environment variable in the scapp.yml press [ctrl+H] then replace all cloud-romtourpe.westeurope.cloudapp.azure.com by your VM ip address โš ๏ธ

Open a shell comand and type :

cd project

At first we ask you to create manually a swarm manager by typping
docker swarm init --advertise-addr IP_OF_VM_LEADER

Then in others vms you can create workers by typing

 docker swarm join --token YOUR_TOKEN

Then on your manager type

docker network create --driver overlay --attachable scapp-net

After that you can enter the final command :

make swarm

The database and microservices have to load so wait about 1 min
Once it is done you can acces the website by typing http://${YOUR_IP_ADDRESS}:3000
The couch db are accessible with the username admin and password admin on the ports: - 3001 -> Authentification service - 3003 -> catalog service - 3004 -> shopping cart service - 3007 -> history service - 3009 -> logs service

you can access them by typing http://${YOUR_IP_ADDRESS}:$YOUR_PORT/_utils
you can add product by executing the script add_item with the command

./add_item $name $price $image_url $category $id

where each $ fields are an argument
You can see the updates on the website if you reload the page
you can remove an item that you have add with the command
./remove_item $item_name

you can remove a shopping cart with the command
./remove_cart_item $item_name $username

You can add item in the shopping cart with the command
./add_cart.sh $item_name $quantity $username $price $item_id

You can add history with the command
./add_history.sh $item_name $quantity $username $price $item_id

TESTING SCALABILITY

You can test the scalability of two containers with the command "make artillery" It will, if the load is superior to 70% of the capacity, increase the number of replicas of the service by 3. The tests take place on two services: the authentification service and the catalog service, but all the daemon support the scalability. In order to launch the scalability script of the differents daemon, use the 'make scalability' command.

REMARKS

All our back-end is functional but we had some problems to link it to the front-end because there is some concurency problems that we could not resolved. Furthermore we didn't create a logs service because we forget this part so we will create this service for the next part of the project. We also want to connect the front-end and the back-end properly for the end of the project. We tried to put our images on the dockerfile but when running the yml file with swarm some container were not created so we prefer to keep images locally and deploy it with a local build awaiting to find a solution to our problem.If there is any problem the website and all the services are running on our vm that you can access with ssh

With the password 3Romain01

then access to the project with the command

cd cloud/project

And execute any command of you choice that we describe above
When running command to add items in shopping cart or to add item in catalog please give a non existing id when adding a product in the catalog and a product name that is already stored in the catalog when adding the product in the shopping cart
you can access to the website by clicking on this url (http://cloud-romtourpe.westeurope.cloudapp.azure.com:3000/)

cloud's People

Contributors

cnikov avatar romtourpe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

louishenrotte

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.