A production-grade single page app for weather forecasting.
Here is a slides version!
- 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
- Country GeoJSON Map (under development)
- E2E Testing (in progress)
- prototypes
- RTK for stage management
- Vitest
- CI/CD
- Browser caching
- Tommorw API
- Typescript
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.
⚠️ This App is powered by the World Weather API so you need to get an API key first and then set your environment variables in the.env
file.
Start by installing nodejs
- run
npm install
at the root of the project - run
npm run dev
for a production build use
npm run build
npm run preview
start by downloading Docker
Uses a nodejs container image and runs the app on the vite development server
docker compose -f .\docker-compose.dev.yml up --build --watch
Uses a multi-stage image building process starting from nodejs image to generate the build, and then uses goStatic image as a static web server built with Go. It's commonly used with the Jamstack although the app is MERN oriented.
docker compose up
vitest
Playwright is the right choice, you can find a standalone testing repo here.
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