- Clone the repo with the following command:
$ git clone https://github.com/josema03/tb-challenge --recursive
The --recursive
flag above is very important, otherwise the app won't start.
- Make sure submodules are up to date with the command below:
$ git submodule update --recursive
If you don't have docker installed in your computer you can get it at their official webpage and follow the instructions.
After cloning the repo and its submodules, at the root folder just run the following command:
$ docker compose up
This should start the app locally and you should be able to see it by visiting http://localhost:3000
in your browser
The express server should start running on port 8080
Before following any other steps inside the subfolders, you have to install all the dependencies. This can be done by running npm install
or yarn
at the project root folder or at each of the subfolders.
- From the root folder, navigate to the
tb-react-app
folder
$ cd tb-react-app
- Run the command below:
$ npm run start
- The app should start running on port 3000
- From the root folder, navigate to the
tb-express-server
folder
$ cd tb-express-server
- Run the command below:
$ npm run start
- The app should start running on port 8080
Run the following command from the project root folder:
$ npm run test --workspace=tb-react-app
- From the root folder, navigate to the
tb-react-app
folder
$ cd tb-react-app
- Run the command below:
$ npm run test
- Tests should start running
Run the following command from the project root folder:
$ npm run test --workspace=tb-express-server
- From the root folder, navigate to the
tb-express-server
folder
$ cd tb-express-server
- Run the command below:
$ npm run test
- Tests should start running
- Query params:
fileName="Name of the file to search"
[
{
"file": "file1.csv",
"lines": [
{
"text" :"RgTya",
"number": 64075909,
"hex": "70ad29aacf0b690b0467fe2b2767f765"
},
. . .
]
}
]
{
"files": ["file1.csv",....]
}