Scan-and-go is a form of self-checkout which has recently been growing in popularity with big-box stores. However, custom software is expensive and smaller retailers do not have the budget to develop their own custom scan-and-go solution. Therefore, EZBag is a free web app that aims to allow any brick-and-mortar store to implement scan-and-go. A patron at a participating store can use the EZBag web app on their phone to scan and pay for items without going through the typical checkout process. Click here for an online demo
docker-compose build
docker-compose run --rm --name backend backend
. You will be prompted for a password, which we will supply.
docker-compose run ...
on the first startup for its interactive mode, without which you could not type in the password.docker-compose run ...
. Close the containers with docker-compose down
.Having completed the inital setup with docker, our project can be started with docker-compose up
. The frontend will be served in development mode at http://localhost:9000, the backend will be served by tomcat on http://localhost:8080/EZBagWebapp, and our mongodb database will be available on port 27017 of localhost. Cypress will run behavioral tests once http://localhost:9000 becomes available, and it will exit after either the tests finish or if a test fails. When you are finished with the project, these three services should be closed with docker-compose down
.
If not already deployed, docker-compose up
will build the backend with maven and deploy it with tomcat. If you need to rebuild the backend (say, if you change the source code):
docker-compose up
in this repositorydocker exec -it backend bash
to access the backend container./backend
run ./build-deploy.sh
The backend will be rebuilt and automatically deployed to /usr/local/tomcat/webapps
. However, through the magic of docker volumes, it will also be available on your local machine at this_repository/docker_persist/tomcat/
. The frontend is automatically served at http://localhost:9000 in development mode when you use docker-compose up
. However, if you need to build the frontend for production, you can:
docker-compose up
.docker exec -it backend bash
/frontend
, run npm run build
The frontend will be built and placed at /frontend/dist
. However, through the magic of docker volumes, it will also be available on your local machine at this_repository/Frontend/dist
. Using the Jersey Test Framework, unit tests can be ran in the IDE (IntelliJ). The Jersey Test Framework creates a fast and easy way to quickly test Jersey code. The Test Framework can emulate GET, and POST requests, and verify that the values being returned are correct. Can also be used to test any backend methods without deploying the server via TomCat.
Tests location: EZBagWebapp/src/main/java/test
Running the tests in the Jersey Test Framework:
We use Cypress for end-to-end behavioral testing. Tests are located in /e2e/cypress/integration/, with a folder structure similar to the what is described here.
Tests are automatically run in the background with docker-compose up
. Screenshots and videos of failed tests will be placed in e2e/cypress/.
export DISPLAY=$(cat /etc/resolv.conf | grep nameserver | awk '{print $2; exit;}'):0.0
IP=$(ipconfig getifaddr en0)
then DISPLAY=$IP:0
docker-compose -f docker-compose.yml -f e2e/cy-open.yml up --exit-code-from cypress
.
docker-compose up
. There is NO need to docker-compose down
- it would just take longer to get running.