The Laravel 8 REST API implements the following:
- OAuth2 API authentication
- Multi level user access
- Google Maps Places API search and import
- Google Photos import
- Repository design pattern
- API Resources
- Pivot tables
The React 17 frontend implements the following:
- Responsive layout
- Google Map with custom pins and "drag and drop" position
- Google Places API search
- Module I18next used to translate from English to Romanian
The ReactJS application can be found in /resources/admin/.
It serves as an example to show that I am accustomed with both programming styles: functional based components with hooks and class based components.
Global state is managed by Redux and can be found in /resources/admin/js/stores/.
Create database:
mysql> create database easyshops;
Copy file .env.example to .env
$ cp .env.example .envand edit .env file based on your settings:
- database: DB_USERNAME, DB_PASSWORD
- main user: ADMIN_CREDENTIALS_EMAIL; ADMIN_CREDENTIALS_PASSWD
Copy the virtual host file from /debian/ to your apache directory.
$ cp -fr debian/app.easyshops.localhost.conf /etc/apache2/sites-available/Change file /etc/apache2/sites-available/app.easyshops.localhost.conf with your paths.
Activate the virtual host and reload apache:
$ sudo a2ensite app.easyshops.localhost.conf $ sudo systemctl reload apache2Apache mod_rewrite must be enabled ($ sudo a2enmod rewrite)
Add the following line to your /etc/hosts:
127.0.1.1 app.easyshops.localhost
Install dependencies using composer:
$ composer install
Run DB migration with seed flag:
$ php artisan migrate --seed
Create a Password Grant Client:
$ php artisan passport:client --passwordEdit .env with the generated ID and secret:What should we name the password grant client? [EASY.SHOPS Password Grant Client]:
password
Which user provider should this client use to retrieve users? [users]: [0] users
Password grant client created successfully.
MIX_ADMIN_CLIENT_ID=---Client ID-here--- MIX_ADMIN_CLIENT_SECRET="---Client secret-here---"
Install front-end dependencies:
$ npm install
Generate a production build:
$ npm run prod