Jonas Neves commited on
Commit
d09c081
Β·
1 Parent(s): cff1430

Update README and requirements

Browse files
Files changed (2) hide show
  1. README.md +50 -8
  2. requirements.txt +1 -1
README.md CHANGED
@@ -1,19 +1,61 @@
1
  ---
2
  title: Weather App
3
- emoji: πŸš€
4
- colorFrom: red
5
- colorTo: red
6
  sdk: docker
7
  app_port: 8501
8
  tags:
9
  - streamlit
 
10
  pinned: false
11
- short_description: Streamlit template space
12
  ---
13
 
14
- # Welcome to Streamlit!
15
 
16
- Edit `/src/streamlit_app.py` to customize this app to your heart's desire. :heart:
17
 
18
- If you have any questions, checkout our [documentation](https://docs.streamlit.io) and [community
19
- forums](https://discuss.streamlit.io).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
  title: Weather App
3
+ emoji: 🌀️
4
+ colorFrom: blue
5
+ colorTo: lightblue
6
  sdk: docker
7
  app_port: 8501
8
  tags:
9
  - streamlit
10
+ - weather
11
  pinned: false
12
+ short_description: A weather app built with Streamlit
13
  ---
14
 
15
+ # 🌀️ Weather Web App
16
 
17
+ A interactive web application built with Streamlit to get current weather information for any city.
18
 
19
+ ## How It Works
20
+
21
+ The app runs a server that users can interact with through their browser in a continuous loop:
22
+
23
+ ```mermaid
24
+ sequenceDiagram
25
+ participant U as πŸ‘€ User
26
+ participant B as 🌐 Browser
27
+ participant S as πŸš€ Server
28
+ participant W as 🌐 API
29
+
30
+ U->>B: Visits app URL
31
+ B->>S: Loads page
32
+ S->>B: Shows input form
33
+
34
+ loop πŸ” Each Search
35
+ U->>B: Enters city & clicks "Get Weather"
36
+ B->>S: Sends city name
37
+ S->>W: πŸ” Fetches weather
38
+ W->>S: Sends data
39
+ S->>B: Updates with weather info
40
+ B->>U: πŸ“Š Displays results
41
+ end
42
+ ```
43
+
44
+ ## Run Locally
45
+
46
+ 1. Get an API key from [OpenWeatherMap](https://home.openweathermap.org/users/sign_up)
47
+ 2. Copy `.env.example` to `.env` and add your key
48
+ 3. Install deps: `pip install -r requirements.txt`
49
+ 4. Run: `streamlit run src/streamlit_app.py`
50
+
51
+ ## Deploy on Hugging Face
52
+
53
+ 1. Push code to a GitHub repo
54
+ 2. Create a new Streamlit Space on HF
55
+ 3. **Add your API key as a secret** in Space Settings:
56
+ - Name: `OPENWEATHER_API_KEY`
57
+ - Value: `your_actual_key_here`
58
+
59
+ ## License
60
+
61
+ MIT License - feel free to use this project for learning and development!
requirements.txt CHANGED
@@ -1,3 +1,3 @@
1
  requests==2.31.0
2
  python-dotenv==1.0.0
3
- streamlit
 
1
  requests==2.31.0
2
  python-dotenv==1.0.0
3
+ streamlit==1.28.1