1- ## Synopsis
1+ # Synopsis
2+
3+ [ ![ Benchmark] ( https://github.com/gguridi/exercise-react/actions/workflows/release.yml/badge.svg?branch=master )] ( https://github.com/gguridi/exercise-react/actions/workflows/release.yml )
4+ [ ![ Codacy Badge] ( https://app.codacy.com/project/badge/Grade/d1cd1dc3fafb4086802a9a4a79b39189 )] ( https://www.codacy.com/gh/gguridi/exercise-react/dashboard?utm_source=github.com& ; utm_medium=referral& ; utm_content=gguridi/exercise-react& ; utm_campaign=Badge_Grade )
5+ [ ![ codecov] ( https://codecov.io/gh/gguridi/exercise-react/branch/master/graph/badge.svg?token=IUDIfrcUOY )] ( https://codecov.io/gh/gguridi/exercise-react )
26
37This is a basic website intended to work with React and Bootstrap. This website gives a basic
48functionality to show information in a responsive way.
@@ -13,7 +17,7 @@ The first thing to do is to [fork this repository](https://help.github.com/artic
1317in your account. Once you have it forked you can clone it in your local environment
1418with the command:
1519
16- ```
20+ ``` bash
1721git clone {repo-url} ./local-folder
1822```
1923
@@ -28,16 +32,16 @@ operating system you are running.
2832
2933Once docker is installed, go to this folder and build the virtual machine with:
3034
31- ```
35+ ``` bash
3236cd < path-to-this-code>
3337docker build -t react-exercise .
3438```
3539
3640Then execute the following code to run the virtual machine. The webservice will be mapped automatically to the port 80
3741of our local machine. (ensure no other process is running in the port 80 or it might conflict):
3842
39- ```
40- docker run -dit --name react-instance -v `pwd`:/storage/app - p 80:8080 react-exercise
43+ ``` bash
44+ docker run -it --name react-instance -p 80:3000 react-exercise
4145```
4246
4347Note that the container has been created to run as an application. Once running it will
@@ -46,14 +50,14 @@ show the standard output and terminating the process will terminate also the con
4650To connect to the container we can use (this will allow us to execute commands from
4751inside the container using the bash shell):
4852
49- ```
53+ ``` bash
5054docker exec -it react-instance /bin/bash
5155```
5256
5357If you need to rerun the virtual machine then we need to remove it first. Maybe the
5458following commands will help you executing _ docker run_ again.
5559
56- ```
60+ ``` bash
5761docker stop react-instance
5862docker rm react-instance
5963```
@@ -72,15 +76,15 @@ operating system you are running.
7276Then, from the folder we have cloned the code, we can see a ` package.json ` file.
7377This file contains the dependencies of our project. To install them type:
7478
75- ```
79+ ``` bash
7680npm install
7781```
7882
7983This will create a folder called ` .node_modules ` that will contain the dependencies.
8084
8185Once the dependencies are there, we can start the development server with:
8286
83- ```
87+ ``` bash
8488npm run start
8589```
8690
@@ -113,7 +117,7 @@ The second one is installing them through npm. Then we include them as part of o
113117React project and we let webpack, when builds the application, to manage the
114118integration.
115119
116- ```
120+ ``` bash
117121import ' jquery' ;
118122import ' bootstrap/dist/js/bootstrap' ;
119123```
@@ -134,7 +138,7 @@ The tests are located altogether with the code, under the .test.js extension.
134138
135139We can run the tests from inside the container or from outside, with:
136140
137- ```
141+ ``` bash
138142npm run test
139143```
140144
0 commit comments