17 Commits

Author SHA1 Message Date
c15d0869c6 Update frontend/src/utils/apiFunc.ts 2025-08-02 02:18:46 +02:00
bbbc8b9edd Update frontend/vite.config.ts 2025-08-02 02:16:48 +02:00
72754f5949 Update frontend/vite.config.ts 2025-08-02 02:13:04 +02:00
c1e96eb7d2 Update docker-compose.yml 2025-08-02 02:10:32 +02:00
ae410bda2b Update frontend/vite.config.ts 2025-08-02 02:09:59 +02:00
400d77cd5a Update docker-compose.yml 2025-08-02 02:07:26 +02:00
5708bfa1b3 changed README.md accordingly 2025-08-02 01:55:20 +02:00
71a29ad9de Merge branch 'main' into debian12
updated host version to 1.0.1
2025-08-02 01:55:05 +02:00
d98fab004f fix: correct numbering in installation instructions for clarity 2025-08-01 21:49:23 +02:00
e56e998467 docs: enhance installation instructions and clarify Docker usage in README 2025-08-01 21:43:02 +02:00
ee6469379f added docker functionality 2025-08-01 21:23:58 +02:00
62094299d4 fix: change button type to submit in ChangeAPI component and update temperature unit logic in WeatherData component 2025-08-01 20:25:03 +02:00
dbbca57f59 fix: update README to clarify web version availability and hosted version details 2025-08-01 19:51:50 +02:00
97b5190442 docs: update version information in README to reflect current development status 2025-08-01 19:49:59 +02:00
a2ee1b3d1f chore: remove detailed usage instructions and features from README for web-only version 2025-08-01 19:48:39 +02:00
7d91eb64eb Merge branch 'v1.0.0-local' into debian12 2025-08-01 19:45:26 +02:00
a3df60178b changed ports 2025-08-01 01:09:58 +02:00
7 changed files with 39 additions and 74 deletions

View File

@@ -1,56 +1,9 @@
# Weather App
This is a simple weather application that allows users to view current weather data for a specified location. The app is built using React and TypeScript, and it fetches weather data from an external API.
This version is only meant for publishing on the web. It is not meant for local development or use.
> For that we use the OpenWeatherMap API. You can get your own API key by signing up at [OpenWeatherMap](https://openweathermap.org/api).
## Features
- Search for weather by city name
- Display current weather conditions including temperature, humidity, and wind speed
- Responsive design for mobile and desktop views
- Change API key preferences
- Display weather data in a user-friendly format
## Installation
1. Clone the repository:
```bash
git clone https://git.the1s.de/theis.gaedigk/weather-app.git
```
2. Navigate to the frontend project directory:
```bash
cd weather-app/frontend
```
3. Install dependencies:
```bash
npm install
```
4. Start the development server:
```bash
npm run dev
```
5. Open your browser and go to `http://localhost:7002` to view the app.
**Note:** There is also a backend server directory, which is currently not in use. - You can ignore it for now.
## Usage
1. Get an API key from [OpenWeatherMap](https://openweathermap.org/api).
2. Click on the "Set API Key" button in the header to enter your API key.
3. Enter a city name in the search bar and press Enter or click the "Get Weather" button.
**Now you can view the current weather data for the specified city!**
# Other Information
## Technologies Used
- React
- TypeScript
- Tailwind CSS
- OpenWeatherMap API
- Vite
You can find the web version of the Weather App at [https://weather.the1s.de](https://weather.the1s.de).
## Version
**1.0.0**
Currently hosted version: **1.0.1**

View File

@@ -1,21 +1,26 @@
services:
# frontend:
# container_name: frontend
# build: ./frontend
# ports:
# - "7002:7002"
# environment:
# - CHOKIDAR_USEPOLLING=true
# volumes:
# - ./frontend:/app
# - /app/node_modules
# restart: unless-stopped
backend:
container_name: backend
build: ./backend
frontend:
container_name: weather-frontend
build: ./frontend
ports:
- "7001:7001"
- "7002:7002"
networks:
- proxynet
environment:
- CHOKIDAR_USEPOLLING=true
volumes:
- ./backend:/bikelane-backend
- ./frontend:/app
- /app/node_modules
restart: unless-stopped
# backend:
# container_name: backend
# build: ./backend
# ports:
# - "7001:7001"
#volumes:
# - ./backend:/bikelane-backend
# restart: unless-stopped
networks:
proxynet:
external: true

View File

@@ -9,4 +9,4 @@ COPY . .
EXPOSE 7002
CMD ["npm", "start"]
CMD ["npm", "run", "dev"]

View File

@@ -64,7 +64,7 @@ const ChangeAPI: React.FC<Props> = ({ currentAPIKey, onClose }) => {
/>
</div>
<button
type="button"
type="submit"
className="bg-gradient-to-r from-blue-600 to-blue-400 text-white font-bold px-6 py-3 rounded-xl shadow-lg hover:from-blue-700 hover:to-blue-500 transition-all"
onClick={handleUpdate}
>

View File

@@ -24,7 +24,9 @@ const WeatherData: React.FC = () => {
? "°C"
: localStorage.getItem("unit") === "imperial"
? "°F"
: "K"}
: localStorage.getItem("unit") === "standard"
? "K"
: "°C"}
</p>
<p className="flex items-center justify-center gap-2">
{weatherData?.sys?.country && (

View File

@@ -7,7 +7,7 @@ export const fetchWeather = async (
) => {
// Get location data
const location = await fetch(
`http://api.openweathermap.org/geo/1.0/direct?q=${city}&appid=${apiKey}`
`https://api.openweathermap.org/geo/1.0/direct?q=${city}&appid=${apiKey}`
).then((response) => {
if (response.status === 401) {
myToast(

View File

@@ -1,12 +1,17 @@
import { defineConfig } from "vite";
import tailwindcss from "@tailwindcss/vite";
export default defineConfig({
plugins: [tailwindcss()],
server: {
server: {
host: "0.0.0.0",
allowedHosts: ["weather.the1s.de"],
port: 7002,
watch: {
usePolling: true,
watch: { usePolling: true },
hmr: {
host: "weather.the1s.de",
port: 7002,
protocol: "wss",
},
},
});