Full stack application to track the detections from CSV file using Python
and React
.
https://decidatatv.luisacerv.dev/
Python API using flask-restful to serve a single GET
endpoint /detections
which will return a JSON
object with the channels, brands, commercials, dates and detections.
python 3.6
In order to make easier to run the project I have used docker, to run the project using docker run the following commands:
-
- In the projject root folder
cd api
- In the projject root folder
-
docker build -t detections_api:latest . -f Dockerfile
-
docker run -d -p 5000:5000 detections_api:latest
-
- Check if everyting is ok by running
docker ps
to see if your container is running at port5000
- Check if everyting is ok by running
-
- Have fun!!!
-
- In the projject root folder
cd api
- In the projject root folder
-
- Create a new python virtual env
python3.6 -m venv env
- Create a new python virtual env
-
- Start your environment
source env/bin/activate
- Start your environment
-
- Install dependencies
pip install -r requirements.txt
- Install dependencies
-
- Run the app
python src/app.py
- Run the app
-
- Have fun!!!
To build the frontend of the application I have used ReactJS as framework and Antd as styling framework.
For the project structure I have followed the concept of atomic design, you can learn more about atomic design here
The application has been configured using paceljs and uses yarn
as package manager, anyway you can use npm
To run:
-
- From the project root
cd client
- From the project root
-
- Install dependencies
yarn install
ornpm install
- Install dependencies
-
- Add new
.env
file with the following:API_ENDPOINT=http://localhost:5000/detections
or rename the.env-example
file to.env
- Add new
-
- Run the app
npm start
- Run the app
-
- Once the is built, go to
http://localhost:1234
- Once the is built, go to
-
- Have fun!!!
In order to test the components I have implemented jest
and enzyme
.
-
- Run tests
npm test
- Run tests
-
- Add test cases to increase test coverage