- The project's purpose
- What used to make this project
- Before you begin
- how to run project
- how to run tests
- Final step
This project is a visual interface for a BigQuery public dataset of Chicago's crimes. You can filter the dataset based on Crime type and Date, and check the exact location of the crimes on Chicago's map. The whole project is written in Python. So, let's enjoy it!
Technology | π |
---|---|
Chicago Crime Dataset | [Google Cloud Link] [Kaggle Link] |
Fastapi | [Github Link] |
Python-BigQuery | [Github Link] |
aioredis | [Github Link] |
httpx | [Github Link] |
Pytest | [Github Link] |
Streamlit | [Github Link] |
Docker | [Github Link] |
Docker-Compose | [Github Link] |
GitHub | [Github Link] |
- You need JSON Credentials for using BigQuery API. If you don't have it, click here to go to Google instructions.
- Where to put that JSON file?
you can put it in backend directory project or anywhere you want, BUT you should add that path in backend/.env variable bellow.
β οΈ In project, both Backend & Frontend folders has a .env.sample file, which you should rename it to .env and setup your variables.
GOOGLE_APPLICATION_CREDENTIALS=./GoogleCredentials.json
- If you need to check the installed packages, they are in requirements folder under Backend or Frontend folder and splited to base.pip & dev.pip .
There is a docker-compose.dev.yml in root folder, which can help to run the project easily. I'll show you how to use it.
docker-compose -f docker-compose.dev.yml up -d --build
And to access the dashboard, just open below link in your browser.
http://localhost:8501/
Both Backend & Frontend folders have the tests folder, in which you can run pytest command to run the tests separately.
And, what about Test Coverage?
pytest
coverage run -m pytest
coverage report
# Name Stmts Miss Cover
# -----------------------------------------------------
# Backend Test Coverage TOTAL 185 5 97%
# Frontend Test Coverage TOTAL 56 0 100%