Giter VIP home page Giter VIP logo

eshopdemodocker's Introduction

Philae e-shop

This repository contains the necessary components to run Philae's e-shop application using Docker. e-shop is an open-cart instance with a fake catalog that has been modified to collect server-side logs as well as per-request code coverage. It is also possible to collect client-side logs by adding an AIFEX script.

Preliminaries

First, install Docker
Second,install docker-compose

Start and stop the services

At the root of the unzipped archive, run the following command:
$ make up
And wait for 30 seconds or so.
To shut down the website, run:
$ make down
Not that this will delete all the containers, including the database. The user logs file is preserved as it is stored on the host machine. If you only want to stop the services, run:
$ make stop
And then to turn them back on, run:
$ make start

Access

The URL to access e-shop is http://localhost:8080. If for some reason you need to access e-shop from another machine, replace localhost by the IP address of the machine that runs e-shop in files www/html/opencart/config.php and www/html/opencart/admin/config.php.
If you want to use another port, open file docker-compose.yml, go to line 11 "- 8080:80" and change 8080 with the port you wish to use.

The URL of the admin panel is http://localhost:8080/admin

Server Logs

Server-side logs (user action traces) are collected in file www/storage/logs/OpenCartAction.txt

Client Logs (AIFEX)

If you want to collect user traces from the client's point of view, create an account on <www.aifex.fr> and start a new AIFEX session. Obtain the sessionId and modelId of your session, and insert the following script in the <head> tag of file /var/www/html/opencart/catalog/view/theme/default/template/common/header.twig:

<script id="AIFEX" connexion-url="https://www.aifex.fr/join?sessionId=######&modelId=#####" src="https://www.aifex.fr/static/AIFEXScript.js" defer=""></script>

Make sure to replace the two # placeholders in the URL by your sessionId and modelId.

Code Coverage

Code coverage can be enabled by creating the containers with the following command:
$ make up-cov
Coverage is collected per request by default. After each request, a json file is created in www/html/opencart/codecoverage/coverages and lists, per file, both uncovered lines (value 0) and covered lines (value 1).
It is possible to merge request coverages by first setting the cookie variable test-name to a name of your choosing, then once all requests have been issued, by running:
$ make agg-cov Note that the first time that this command is executed, a Docker image is first created.
The aggregated coverage file (stored at location www/html/opencart/codecoverage/coverages/aggregated) has a slightly different format: for each executed file, it only lists the covered lines, and for each covered line, it mentions which request(s) covered it.
Beware Code coverage files can quickly accumulate and take up a lot of storage space, especially when you don't aggregate the coverage files on a regular basis. To clean all the per-request coverage files, run:
$ make clean

Credentials

####Client 1

username: [email protected] password: client

####Client 2

username: [email protected] password: client2

####Administrator username: admin password: admin

Troubleshooting

If images cannot load, try to chmod -R 0777 the www/html/opencart folder. If e-shop does not start properly and is not reachable, try starting it manually without make, i.e docker-compose up to obtain execution logs.

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.