Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kareimgazer/a-eggaw
single page application for weather forecast
https://github.com/kareimgazer/a-eggaw
axios css-flexbox css-grid d3 d3js docker flyio frontend gostatic html javascript playwright react redux-toolkit restful-api single-page-app tailwindcss vite
Last synced: about 2 months ago
JSON representation
single page application for weather forecast
- Host: GitHub
- URL: https://github.com/kareimgazer/a-eggaw
- Owner: KareimGazer
- Created: 2024-09-01T02:50:50.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-09-22T04:06:53.000Z (4 months ago)
- Last Synced: 2024-10-26T18:44:24.855Z (3 months ago)
- Topics: axios, css-flexbox, css-grid, d3, d3js, docker, flyio, frontend, gostatic, html, javascript, playwright, react, redux-toolkit, restful-api, single-page-app, tailwindcss, vite
- Language: JavaScript
- Homepage: https://a-eggaw.fly.dev/
- Size: 1.47 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A-Eggaw π€οΈ
A production-grade single page app for weather forecasting.
## Table of content π
- [A-Eggaw π€οΈ](#a-eggaw-οΈ)
- [Table of content π](#table-of-content-)
- [Features π](#features-)
- [Future Roadmap πΊοΈ](#future-roadmap-οΈ)
- [Getting Started π©](#getting-started-)
- [Locally π₯οΈ](#locally-οΈ)
- [Development π¨βπ»](#development-)
- [Production π](#production-)
- [Docker π](#docker-)
- [Development π¨βπ»](#development--1)
- [Production π](#production--1)
- [Testing π§ͺ](#testing-)
- [Unit Testing π](#unit-testing-)
- [End-To-End Testing π](#end-to-end-testing-)
- [Project Structure π](#project-structure-)## Features π
Here is a [slides version](https://docs.google.com/presentation/d/1BhxiugWHq_NrVFlPmnR1rBMZF9b1vmJTj76LBA_iOqY/edit#slide=id.g2fcee10ece6_0_21213)!
- Dark / Light modes
- Auto location and time detection
- summary of the weather across the country
- daily forecast summary
- accurate weather forecating for the next 10 days
- historical weather info in the last 10 years
- iteractive charts## Future Roadmap πΊοΈ
- Country GeoJSON Map (under development)
- E2E Testing (in progress)
- prototypes
- RTK for stage management
- Vitest
- CI/CD
- Browser caching
- [Tommorw API](https://www.tomorrow.io/weather-api/)
- Typescript## Getting Started π©
We provide two ways one using docker with minimal setup or locally if you don't get comfortable with containers. both provide production and development environments.
> :warning:
> This App is powered by the [World Weather API](https://www.worldweatheronline.com/weather-api/) so you need to get an API key first and then set your [environment variables](https://vitejs.dev/guide/env-and-mode) in the `.env` file.### Locally π₯οΈ
Start by installing [nodejs](https://nodejs.org/en/learn/getting-started/how-to-install-nodejs)
#### Development π¨βπ»
1. run `npm install` at the root of the project
2. run `npm run dev`#### Production π
for a production build use
```bash
npm run build
npm run preview
```### Docker π
start by downloading [Docker](https://www.docker.com/get-started/)
#### Development π¨βπ»
Uses a nodejs container image and runs the app on the vite development server
```bash
docker compose -f .\docker-compose.dev.yml up --build --watch
```#### Production π
Uses a multi-stage image building process starting from nodejs image to generate the build, and then uses [goStatic](https://github.com/PierreZ/goStatic) image as a static web server built with Go. It's commonly used with the Jamstack although the app is MERN oriented.
```bash
docker compose up
```## Testing π§ͺ
### Unit Testing π
vitest
### End-To-End Testing π
[Playwright](https://playwright.dev/) is the right choice, you can find a standalone testing repo [here](https://github.com/KareimGazer/A-Eggaw-E2E).
## Project Structure π
```
A-Eggaw
βββ src
| βββ App.jsx main react app
β βββ assets
β β βββ weather-icon.webp
β βββ day components for daily forecast section
β β βββ DailyBoard.jsx
β βββ history components for historical weather trends section
β β βββ Graph.jsx
β β βββ GraphSelector.jsx
β β βββ HistoryDashboard.jsx
β β βββ TimeSelector.jsx
β βββ main.jsx React entry point
β βββ month components for monthly forecast section
β β βββ MonthlyBoard.jsx
β βββ search search bar componets
β β βββ CitySelector.jsx
β β βββ SearchBar.jsx
β βββ week components for weekly forecast section
β βββ WeekCards.jsx
| βββ WeekGraph
| βββ WeeklyBoard
βββ dist static site built files (git ignored)
βββ .gitignore
βββ .dockerignore
βββ dev.Dockerfile Image for running the development server
βββ docker-compose.dev.yml development compose file
βββ Dockerfile The production container image of the server
βββ Dockerfile production compose file
βββ index.html
```