Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```