- Docker
- A valid OpenWeather API Key (You can get it from OpenWeather)
-
Clone the repository
Clone the repository to your local machine:
git clone https://github.com/pmiczewski/weather-app.git cd weather-app -
Set up your environment
Copy the .env.example file to .env:
cp .env.example .env
-
Configure the OpenWeather API Key
Open the .env file and add your OpenWeather API key:
OPEN_WEATHER_API_KEY=your_api_key_here -
Run the application
Install dependencies:
docker run --rm \ -u "$(id -u):$(id -g)" \ -v "$(pwd):/var/www/html" \ -w /var/www/html \ laravelsail/php83-composer:latest \ composer install --ignore-platform-reqs
Start Docker containers using Laravel Sail:
./vendor/bin/sail up
Migrate and seed the database:
./vendor/bin/sail artisan migrate --seed
Once the containers are up and running, build the assets:
./vendor/bin/sail npm run dev
-
Access the application
The application should now be running. Open your browser and go to: localhost
-
Make sure Docker is running before starting the application.
-
If you're encountering any issues, try rebuilding the containers:
./vendor/bin/sail down ./vendor/bin/sail up --build
-
By default, Sail creates a separate testing database to prevent interference with your main database. Before testing, ensure you migrate the testing database