Skip to content

Simple sample application built with Vue 3 and PHP 8 to consume the famous SWAPI.

License

Notifications You must be signed in to change notification settings

ErickPetru/vue-php-swapi-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Vue + PHP + Star Wars API

Simple sample application which runs a Vue 3 client and a PHP 8 server, inside the same container, by using Docker Compose. The API is built with Slim framework, and consumes data from the famous SWAPI. The client application is built with Vite, and uses Vue Router.

Application search page sample screenshot

Quick start

You need Docker running on your machine to quickly boot this sample application. In case you're using Windows, it's recommended to use Docker Desktop and enable the WSL 2 backend.

With the requirements met, just run the following in a terminal:

docker-compose up --build

Then you can open the client application at http://localhost:3000 and look at the API endpoints at http://localhost:3001.

Note: This sample application is intended to be used in a development environment only, since both container services will run using simple development servers, with no production optimizations, no minification, and with hot-reloading enabled. It's not recommended to use this setup as is in production.

Manually running

In case you don't want or can't use Docker for any reason, you still can run this application manually.

You'll need to have PHP and Composer installed on your machine for the API, and Node.js for the client web application.

API

cd api
composer install
php -S localhost:3001 -t src

Client

cd web
npm install
npm run dev --port 3000

About

Simple sample application built with Vue 3 and PHP 8 to consume the famous SWAPI.

Resources

License

Stars

Watchers

Forks