Skip to content

Coding Challenge to make a weather app using fast-api

Notifications You must be signed in to change notification settings

RobACurtis/weather-app

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Weather App

A fullstack web application to view a 7 day weather forecast.

I built this full stack single page application as a challenge to learn how to integrate a Python server with a React App.

Technologies Used

  • React
  • CSS
  • Bootstrap
  • JavaScript
  • PostgreSQL
  • pip3
  • Python
  • Uvicorn
  • FastAPI
  • Schedule
  • psycopg2

Feature List

  • User can view the weather for today and tomorrow
  • User can view the weather for upcoming days

Preview!

ezgif com-gif-maker (1)

Development

System Requirements

  • Python 3
  • pip3
  • Postgres
  • npm
  • pgweb

Getting Started

  1. Clone the repository.
git@github.com:RobACurtis/weather-app.git
  1. Install all dependencies with pip and npm.
pip install uvicorn
pip install psycopg2
pip install schedule
pip install fastapi
npm install
  1. Make an account to get an API Key

    Get your API key here

  2. Start postgreSQL.

brew services start postgresql
  1. Create a database.
createdb yourDatabaseName
  1. Set environment variables.
  • open terminal
  • in your home directory type
nano .bash_profile
export WEATHER_API="youraccesskey"
export USER="databaseuser"
export WEATHERDB="nameofyourdatabase"
  • type ' ^x ' to save
  • type ' y ' to confirm
  • then close out of terminal
  1. View your database through pgweb. You can view it in your browser at localhost:8081
pgweb --db=yourDatabaseName
  1. Import the code from schema.sql into your database
  2. Run main.py to import weather data into your database (scheduled to run everyday at midnight)
python3 get-weather.py
  1. Start the server
uvicorn main:app --reload
  1. Start the project. Once started, you can view the application by opening localhost:3000 in your browser
npm run start

About

Coding Challenge to make a weather app using fast-api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published