https://desolate-ridge-10345.herokuapp.com/
- Webserver: Heroku
- DB host: remotemysql
- Frontend: Vue + Vuex + Vue-router + bootstrap-vue
- Backend: Laravel 7 + Sanctum
This project has:
- Registration
- Authorization
- Orders history
- Home page with menu
- Product cart
- Currency switcher
Requirements:
- php 7.2.2+ with following extensions (mysqli, pdo, pdo_mysql, zip, bcmath, pcntl, sockets, gd, xml) and composer
- a webserver (you can use php artisan serve)
- nodejs 10+, npm 6.5+
- mysql 5.6+
- Make sure the required services are up and running;
- Clone this repository and checkout needed branch;
- Create database;
- Install required dependencies:
composer install
for a development environment orcomposer install --no-dev
; - Configure webserver to pass all requests to the public/index.php.
In dev environment you can just run Laravel's webserver via
php artisan serve
console command; - Build frontend:
npm install
andnpm run dev
(ornpm run prod
in production). Re-runnpm run dev
after making changes to frontend to reflect them in your local webserver or runnpm run watch
; - Create environment file
cp .env.example .env
and update variables inside. - Generate application key
php artisan key:generate
. - Run migrations
php artisan migrate
(you may run thephp artisan db:seed
to seed your database). - Check if everything's up by visiting your page in the web browser, and you are done!
- Clone this repository and checkout needed branch;
You may need to replace DB_*
variables in your .env file
DB_HOST=db # We are replacing actual ip with a service alias `db`
- Run
docker-compose up -d
to setup a services cluster in the background, if you would like to see logs output then start it withdocker-compose up
. - Wait until all services aren't started (!!!)
- Run
docker-compose exec php-fpm php artisan migrate
(you may run thedocker-compose exec php-fpm php artisan db:seed
too) - To build frontend part run
docker-compose exec php-fpm npm install
anddocker-compose exec php-fpm npm run dev
- Check panel with docker-machine ip (127.0.0.1:8090)
- For checking logs type
docker-compose logs
in your repository folder, also you can see available containers withdocker-compose ps
, to check logs of specific container runsudo docker logs container_name
where container_name is one of available containers ordocker-compose logs service_name
where service_name is one of the available services which are described indocker-compose.yml
- To stop services if they are running in foreground mode type
ctrl+c
ordocker-compose down
for background mode