- Search Weather: Users can search for a city's current weather and view up to 2-week forecast.
- Weather History: The application stores recent weather searches locally for later revisit.
- Subscription: Users can subscribe to daily weather updates via email.
- Frontend: ReactJS, SCSS
- Backend: Spring Boot, PostgreSQL, Redis (caching)
- Deployment: Docker, Render (backend), Vercel (database)
- Node.js (v18.x or later)
- npm (v8.x or later)
- Docker
Follow these steps to set up and run the project on your local machine.
-
Clone the repository
git clone https://github.com/quangduy201/g-weather-forecast.git cd g-weather-forecast
-
Configure environment variables
- There are 2 .env-example files in both frontend and backend.
- Create .env files for both frontend and backend based on the .env-example accordingly.
- Make sure to replace the placeholder values with your actual credentials.
- PostgreSQL: Create a PostgreSQL database locally on your machine or remotely on the clouds (e.g., Vercel)
- SMTP: Use any SMTP service provider to send emails (e.g., Gmail SMTP, Mailtrap).
- Redis: Set up Redis via Docker or use a remote Redis instance.
-
Set up the backend (Spring Boot)
-
Navigate to backend directory
cd g-weather-forecast-backend
-
Build and run the services with Docker Compose
docker-compose up --build
-
Access the services
http://localhost:8080
-
-
Set up the frontend (React)
-
Navigate to the frontend directory
cd g-weather-forecast-frontend
-
Install dependencies
npm install
-
Start the development server
npm run dev
-
Access the application
http://localhost:5173
-