Your application brief description.
- View product catalogue
- Add products to shopping cart
- Process payment of products
- Manage customer orders
This application uses the following technologies:
- React
- Redux
- NginX
To develop in this application you will need, at a minimum, to have installed in your system the following:
- Docker with Compose
This repository contains a local development environment, fully containerised, that can be used to run the application on your machine and test it.
The services available in the local development environment are configured at setup/local/docker-compose.yml and setup/local/docker-compose.elk.yml.
NOTE: Any service assigned with the profile only_if_not_cicd will not be started in a CICD environment.
NOTE: Use of a unix command line environment is recommended.
To run the local environment, in development mode, follow these steps:
- From the root of the project run the command
sh cli/start.sh [flags] [services]Where:
flags:
Any flag supported by the Docker compose up command.
For more information consult the official Docker documentation.
NOTE: Consider using the -d flag, which runs the Docker project in detached mode.
services:
Whitespace separated list of services to run.
The available services are declared in the local environment Docker compose project at setup/local/docker-compose.yml.
NOTE: If no services are provided, all services will be started.
This will run a Docker compose project and start several networked Docker containers will all the services and necessary tools to use the application.
The following services will be running in the containers:
- List your services here
- Interact with the local environment via the following URLs:
Application: http://localhost:10000
To run the local environment, simulating a remote environment, follow these steps:
- From the root of the project run the command
sh cli/start_nginx.sh [flags] [services]Where:
flags:
Any flag supported by the Docker compose up command.
For more information consult the official Docker documentation.
NOTE: Consider using the -d flag, which runs the Docker project in detached mode.
services:
Whitespace separated list of services to run.
The available services are declared in the local environment Docker compose project at setup/local/docker-compose.nginx.yml.
NOTE: If no services are provided, all services will be started.
This will run a Docker compose project and start several networked Docker containers will all the services and necessary tools to use the application.
The following services will be running in the containers:
- NginX server
- Interact with the local environment via the following URLs:
Application: http://localhost:10000
From the root of the project run the command
sh cli/stop.shThis will stop the Docker compose project and cleanup its resources.
To configure some of the parameters of the local environment follow these steps:
- Copy the file
setup/local/.env.templatetosetup/local/.env - Fill in the parameters you want to overwrite and delete the ones you want to keep the defaults
- Run the local environment
From the root of the project run the command
sh cli/test.sh [flags] [projects]Where:
flags:
-w: Run the tests in watch mode (Requires at least 1 project to be specified)--unit: Run only unit tests--integration: Run only integration tests--e2e: Run only end to end tests--docker: Run the tests in a Docker container--filter: Run only the tests that match the provided pattern (Ex:test/unitwill run only the tests that are inside the this path)--coverage: Run the unit tests with coverage report
projects:
Whitespace separated list of test paths to run.
NOTES:
- When running the tests with the flags
--dockeror--cicd, the tests will run inside a Docker container that will be in themyapp_sharednetwork. - When running the script with the flags
--integrationor--e2ethe flag--dockeris assumed as well, which means the tests will run inside a Docker container.
To generate unit test coverage reports, including an HTML report, from the root of the project run the command
sh cli/coverage.sh [flags]Where:
flags:
--dockerBuild the coverage report in a Docker container
The HTML coverage report is located inside the directory ./coverageReport, which contains an index.html file.
To check for updates to the project dependencies and update them if needed, from the root of the project run the command
sh cli/dependencies_update.sh [flags]Where:
flags:
-u|--update: Update all outdated dependencies. You will be prompted for each one for confirmation before updating-y: Update all dependencies without prompting--dockerRun the script inside a Docker container
If the update flag is not provided, the script will print the report with all the dependencies that are outdated, but will not update any of them.