Weather Alert Application
This project is a distributed application that uses the Open Weather API to provide accurate and up-to-date weather information to its users. The app will provide valuable information to users, such as forecasts for the near future, long-term weather trends, and immediate alerts in case of extreme weather conditions. To ensure data consistency and accessibility, we will deploy Docker containers to run the web application and Kafka to handle real-time data streams. Additionally, we will use a Python pipeline to process the obtained weather data and save it to a Mongodb database for future analysis.
Using Open Weather, Python, Kafka, and MongoDB in combination, a comprehensive machine learning pipeline can be developed to gather, process, examine, visualize, and transmit data. Open Weather can be utilized to gather data, Python can be employed for analysis, and MongoDB can be utilized to store the data. Lastly, the data can be transmitted to users through Kafka, providing for their needs.
You can avoid this configurational step by using the Docker installation process.
Perform the following steps:
1- Download and install Node.js. 2- Download and install Python (>= 3.9). 3- Download and install Kafka. 4- Download and install Mongodb (6.0). 5- Download and install Visual Studio Code(VS Code). 6- Install Vetur, Better Comments, Docker, Python, GitHub Theme extensions for VS Code To enjoy the code. 7- Clone this repository. 8- Connect to the MongoDB 6.0 server by running the following command:
9- Navigate to the Kafka installation directory using the “cd” command. For example, if you installed Kafka in “C:\kafka_2.13-2.8.1“, type the following command and press enter:
Start the ZooKeeper server (if not already running) by entering the following command:
In a separate command prompt window, start the Kafka broker by entering the following command:
10- Start The Express Server:
Enter the following commands:
cd backend npm install node index.js
11- Start The Vue app by entering the following commands:
cd frontend npm install npm run serve
12- Start The Analysis server by entering the following commands:
cd analysis-servers pip install --no-cache-dir -r requirements.txt python daily-analytics.py
13- Start The Alert server by entering the following commands:
cd alert-server pip install --no-cache-dir -r requirements.txt python alert-server.py
14- Start The Collect server by entering the following commands:
cd collect-server pip install --no-cache-dir -r requirements.txt python collect-server.py
Now, You can now access the server at http://localhost:8080/.
Make sure Docker is installed.
Spin up the containers
docker-compose up -d --build
Running the command will expose 7 services with the following ports:
- Alert-server –
- Analysis-server –
- Backend –
- Frontend –
- Kafka –
- Zookeeper –
- Mongodb –
You can now access the server at http://localhost:8080/.
Want more details?
For more details or if you want to recommend me for other projects. Just contact me on my email: [email protected]