Skip to content

arindam31/CityWeatherWithFlask

Repository files navigation

Weather data APIs with Flask and React

Build Python Flask

React Vite

A flask project that stores and provides APIs for usage.

Following things are demoed:

✅ Receiving data from mock data (json file included) in an API.
✅ Receiving data from MySQL database (loaded from json file)
✅ Get live weather data for current day with an API.
✅ Usage of docker to orchestrate complete setup with mock data loaded.

Backend Project Features

🛡️ Live data from online weather service
🛡️ Fully Dockerized
🛡️ MySQL database used
🛡️ Synchronized data
🛡️ Restfull APIs
🛡️ Continuous testing with github actions. (see github actions history)
🛡️ Swagger document for trying APIs
🛡️ Minimal Frontend with React to see weather data and search for cities to see current weather.

🚀 QUICK Start

  git clone https://github.com/arindam31/Flask_Construction_Gis.git
  cd Flask_Construction_Gis

For backend (create venv and activate it)

  pip install -r requirements.txt
  flask create-db
  flask load-data
  flask run

For frontend:

  cd .\frontend\my-weather-app\
  npm install
  npm run dev

With docker (recommended):

docker compose -f docker-compose-all-service.yaml up --build

Setting up local environment:

  • Clone the project from github/gitlab
  • Create a virtual environment.
    python -m venv .venv
  • Activate it (for windows)
    .venv/Scrpts/activate
  • Create a local database and populate data.
    flask create-db
    flask load-data
  • Test your setup
    • Check for routes or run API tests
    flask routes
    pytest -v

🧪 Running Tests

📌 The tests are located under /tests.

  pytest
  pytest -s # To see prints too
  pytest -s -k "keyword" # Run tests matching a keyword

📜 Documentation

📄 Detail documentation on sub topics are available in the docs/ directory.

📙 Docker, 📙 Database

🙌 Contributors

👤 Arindam Roychowdhury

About

A flask project to show clean architechture and building Rest APIs and routes with blueprints

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published