/laravel-swapi

The Star Wars API (swapi.dev) example.

Primary LanguagePHP

๐ŸŒŒ๐Ÿ”ซ Laravel SWAPI

Laravel SWAPI - The Star Wars API (swapi.dev) example.

๐Ÿ–ฅ๏ธ Demo

Live demo (registration required): swapi.alexprojects.pl

swapi

๐Ÿšฉ Table of Contents

  1. Requirements
  2. Installation
  3. Testing
  4. Data
  5. Built with
  6. To-do

๐Ÿ”Œ Requirements

  • PHP version: >= 8
  • Composer
  • Node.js

๐Ÿงพ Installation

  1. git clone https://github.com/aleksandertabor/laravel-swapi YOURPROJECTNAME

  2. cd YOURPROJECTNAME

  3. Install dependencies:

    composer install

    npm install

  4. cp .env.example .env

  5. php artisan key:generate

  6. Set your .env with credentials to your database server (DB_* settings) and your domain config (APP_URL).

  7. php artisan migrate

  8. Fetch data from SWAPI with Artisan command php artisan swapi:fetch-characters 50

  9. Build frontend with npm run production for production.

  10. Run your server php artisan serve.

Using Docker?

Use docker-compose.yml with Laravel Sail - installation

๐Ÿงช Testing

vendor/bin/phpunit tests

๐Ÿ—‚๏ธ Data

The application uses data from Swapi.dev - The Star Wars API.

Artisan command for Star Wars characters with their movies titles: php artisan swapi:fetch-characters {amount=50}.

๐Ÿงฐ Built with

  • Laravel 8
  • Laravel Breeze as Starter kit (authentication features and frontend scaffolding - Inertia, Vue, Tailwind)
  • Inertia.js 0.9+
  • Vue.js v3
  • Tailwind CSS 2+

๐Ÿ“‹ To-do

  • More tests ๐Ÿ™‚
  • More options for Artisan command
  • Split content of Vue pages for components
  • Robust architecture (data management, validation)
  • Handling more endpoints
  • Fancy design
  • ...