Skip to content

A pretty basic weather app that demonstrated use of public apis and basic web development stack, consisting of vue.js and django. This app is made for educational purposes, and hopes to get people into web dev the same way i did! The code is open sourced, and contributions to this project are welcome.

Notifications You must be signed in to change notification settings

arneja-arnav/vue-weather_app

Repository files navigation

Simple Weather App

Technologies to Learn (Assuming Basic Familiarity):

  1. Vue.js: Have a basic understanding of Vue.js and its components.

  2. Django: Familiarize yourself with Django, especially models, views, and APIs.

  3. MongoDB: Learn how to set up and interact with MongoDB using Django.

  4. HTML and CSS: Basic knowledge of HTML and CSS for building the user interface.

Preparation:

  • Set up Django Backend: Have a Django project and app ready to go.
  • Get MongoDB Ready: Ensure you have MongoDB installed and Django configured to use it via the "djongo" library.

Steps to Create a Weather Application (Simplified):

1. Vue.js Frontend (40 minutes):

  • Create a new Vue.js project.
  • Build a simple user interface with input fields for location and a display area for weather information.
  • Implement Vue components to manage user input and display weather data.
  • Use Vue's built-in HTTP client or Axios to make API requests to fetch weather data from a weather API (e.g., OpenWeatherMap).

2. Django Backend with MongoDB (40 minutes):

  • Set up Django's REST framework in your project to create RESTful API endpoints.
  • Define a Django model for storing weather data. Ensure the model fields align with the data you'll receive from the weather API.
  • Create an API view that receives location requests from the Vue.js frontend, fetches weather data from the API, and stores it in the MongoDB database.
  • Implement another API view to retrieve weather data from MongoDB and send it to the frontend.

Set up Django's REST framework in your project to create RESTful API endpoints.

  • Define a Django model for storing weather data. Ensure the model fields align with the data you'll receive from the weather API.
  • Create an API view that receives location requests from the Vue.js frontend, fetches weather data from the API, and stores it in the MongoDB database.
  • Implement another API view to retrieve weather data from MongoDB and send it to the frontend.

3. Frontend-Backend Integration (20 minutes):

  • Connect the Vue.js frontend to the Django backend by making HTTP requests to the Django API endpoints you created.
  • Implement data dinding to display weather information on the frontend.

4. Testing (15 minutes):

  • Test your weather application locally to ensure that it fetches and displays weather data correctly for user-specified locations.
  • Debug and troubleshoot any issues that may arise.

5. Deployment (5 minutes):

  • Deploy your Vue.js frontend and Django backend separately on platforms like Heroku, Netlify, or Vercel. Ensure you configure CORS correctly to allow communication between the two.

6. Documentation and Cleanup (5 minutes):

  • Write a README file explaining how to use and run your weather application.
  • Remove unnecessary code or files to keep the project clean.

Total Estimated Time: 2 Hours

Please note that this is a simplified guide, and the actual time may vary based on your familiarity with the technologies and your coding speed. For a production-level application with more features, additional time and considerations are necessary.

About

A pretty basic weather app that demonstrated use of public apis and basic web development stack, consisting of vue.js and django. This app is made for educational purposes, and hopes to get people into web dev the same way i did! The code is open sourced, and contributions to this project are welcome.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published