News Aggregator Web Application using Laravel and React Js
Copy .env.example
and rename it to .env
.
docker-compose build
docker-compose up
Please wait a couple of minutes for the backend, frontend, and MySQL container to be initialized.
Open a new command prompt and type the following command:
docker-compose exec backend-app php artisan migrate --seed
This will create the desired tables.
Your app will be running at http://localhost:3000/. Click on Get News button to fetch news.
To verify tables in the MySQL container:
docker ps # Check MySQL container ID
docker exec -it <mysql-container-id> sh # Replace <mysql-container-id> with the actual ID
mysql -u root -p # Enter password (type root)
show databases;
use news;
show tables;
(these configurations are defined in .env file)
docker exec -it <container_name_or_id> sh
cd /var/www/html/storage
cat logs/laravel.log
For the Front end:
npm install
npm build
For backend:
composer install
php artisan key:generate
php artisan migrate
php artisan seed
*Fig. 1: Homepage - Before LogIn
*Fig. 2: Homepage - After LogIn
*Fig. 3: Homepage - Author Filter