ronald-kimeli / laravel-newsaggregator-api

This a backend api for laravel new aggregator. Fully api development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

React Bakend news-aggregator

Installation

  • clone this project into your machine
git clone https://github.com/KimelirR/backend-laravel-api.git
  • clone this project into your machine
cd backend-laravel-api
  • create environment
cp .env.example .env
  • Dockerize by building and running on detached mode
docker compose build --no-cache && docker compose up --force-recreate -d
  • Clear cache first of all
docker compose exec lara php artisan config:clear
  • Test laravel migration and the app container name is lara.
docker-compose exec lara php artisan migrate:fresh --seed
  • Interact with database cli as a root user using command below, container name db.
docker compose exec db mysql -u root -p
  • Run the application and on your Browser run .
http://localhost:8000
  • Load newsapidata to our database by refreshing code below.
 http://localhost:8000/api/fetchnewsapi
  • Load fetchthegurdian to our database by refreshing code below.
 http://localhost:8000/api/fetchthegurdian
  • Load fetchnewyorktimes to our database by refreshing code below.
 http://localhost:8000/api/fetchnewyorktimes

End

Then, on the other way manually

** Install project dependencies

  composer install
  • Generate key for laravel new application you have installed.
php artisan key:generate
  • Run the application
php artisan migrate:fresh --seed
  • Run the application
php artisan serve
  • Load newsapidata by running same http routes just like above

Or import news_aggregator.sql database to the database and run

  • The Frontend Image

    alt text

About

This a backend api for laravel new aggregator. Fully api development


Languages

Language:PHP 78.7%Language:Blade 19.9%Language:Dockerfile 0.7%Language:Shell 0.5%Language:JavaScript 0.2%