MeteoMate is a sleek and simple web application that provides real-time weather information for select cities. It's powered by Flask and Python and utilizes MongoDB for logging requests.
- Real-time Weather Data: Fetches the latest weather data for predefined cities.
- Responsive UI: Designed to work seamlessly on both desktop and mobile devices.
- Logging: Captures request information in MongoDB for analytics and monitoring purposes.
- Dockerized: The application, along with it's unit and integration tests, is containerized using Docker, ensuring consistency across various environments and testing phases.
- Kubernetes orchestration: Deployed on Kubernetes clusters for scalable and resilient operations.
- Infrastructure as Code: Managed using Terraform and Helm for consistent and reproducible infrastructure provisioning.
Before you begin, ensure you have met the following requirements:
- Docker: Make sure you have Docker installed.
- Kubernetes: Access to a Kubernetes cluster for deployment.
- Terraform: Terraform installed for infrastructure management.
- Helm: Helm installed for managing Kubernetes applications.
-
Clone the Repository:
git clone https://github.com/israelazoulay/MeteoMate.git cd MeteoMate
-
Environment Variables: Setup the
.env
file based on the provided.env.example
. Populate the necessary variables likeAPI_KEY
andMONGODB_URI
. -
Using Makefile:
- To build the Docker image:
make build
- To run the application:
make run
For more commands, refer to the
Makefile
. - To build the Docker image:
-
Access the App: Once the server is running, you can visit
http://localhost:5000
in your web browser.
-
Unit Tests:
make test
-
Integration Tests: These are located in the
tests
directory. -
Virtual Environment:
- Setup the virtual environment:
make venv
- Activate the virtual environment:
source .venv/bin/activate
- Setup the virtual environment:
MeteoMate uses multiple CI/CD pipelines for robust and automated deployment:
-
Heroku Deployment: Configured with GitHub Actions for CI/CD. On each push to the
main
branch, the app undergoes a build and test phase, and is manually deployed to Heroku using thecd.yml
workflow.- Live on Heroku: https://meteomate-30b58b736361.herokuapp.com/
-
AWS Deployment with K8S, Terraform and Helm: Containerized and deployed on AWS EKS. The
aws_ci.yml
andaws_cd.yml
workflows in the.github/workflows
directory handle the CI/CD pipelines for AWS deployments, including steps for scanning secrets, running unit and integration tests, validating and applying Terraform configurations, updating the Kubernetes configuration, building & pushing the Docker image to AWS ECR, and deploying the application using Helm.- Live on AWS EKS: https://www.meteomate.online/
- Terraform: Used for provisioning and managing the AWS infrastructure, including EKS and EC2 instances & more.
- Helm: Utilized for deploying and managing the Kubernetes application.
- AWS CloudWatch: Integrated for monitoring and logging, providing insights into application performance and health.
- AWS ACM: Used for managing SSL/TLS certificates for secure HTTPS connections.
- AWS ECR: Docker images are stored and managed in Amazon Elastic Container Registry.
- Prometheus: Planned for enhanced monitoring and alerting capabilities, integrating with existing AWS CloudWatch setup.
- Ansible: To be used for automated configuration management, complementing the existing Terraform setup for infrastructure provisioning.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License.