Giter VIP home page Giter VIP logo

laravel_patent_one's Introduction

Requirement

  • PHP 8.2
  • Composer ^2.4
  • Docker
  • Ctype PHP Extension
  • cURL PHP Extension
  • DOM PHP Extension
  • Fileinfo PHP Extension
  • Filter PHP Extension
  • Hash PHP Extension
  • Mbstring PHP Extension
  • OpenSSL PHP Extension
  • PCRE PHP Extension
  • PDO PHP Extension
  • Session PHP Extension
  • Tokenizer PHP Extension
  • XML PHP Extension
  • Redis PHP Extension
  • PDO_Postgres PHP Extension
  • PDO_Mysql PHP Extension (optional)
  • GD PHP Extension (optional)
  • Imagick PHP Extension (optional)

Run Quick Setup and don't run the step from 1 to 7

Quick Setup

Run script below for quick setup

sh ./setup.sh -p 3000 -a -f -d -r 6380 -b 5433 -e local
Option Description Value
-p Specify custom app port. Default is 3000 Number
-a Specify has authentication module Empty
-f Specify has file upload feature Empty
-d Specify docker is development environment if local machine don't install PHP and Composer Empty
-r Specify custom redis port. Default is 6379 Number
-b Specify custom database port. Default is 5432 Number
-e Specify custom environment (local,development,staging,production). Default is local string

Note: Please make sure that the file .env.staging and .env.production are exist (check the encrypt/decrypt ) before run the script above

Run Manual Setup and don't run the Quick Setup

Manual Setup

1./ Install Package

Select one of methods belows:

With composer

composer install

Without composer

docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php82-composer:latest \
    composer install --ignore-platform-reqs

2./ Copy .env

cp .env.development .env

2.1/ (Optional) Modify .env on 1st run at local environment

APP_ENV=local

3./ Start app

./vendor/bin/sail up -d

4./ Generate app key

./vendor/bin/sail php artisan key:generate --ansi

5./ Run migration

./vendor/bin/sail php artisan migrate

6./ (Optional) Create symlink for file storage if you're using local disk upload

./vendor/bin/sail php artisan storage:link

7./ (Optional) Generate Passport secret if you're using authentication modules (EMAIL LOGIN, SMS LOGIN...)

./vendor/bin/sail php artisan passport:keys

After Setup is done (Quick setup or Manual)

Install OAuth App. Please make sure that all setup above are run successfully

./vendor/bin/sail php artisan passport:client --password

Note*: If you have multiple-authentication models, and when passport asking for provider, just pick the 1st option. It doesn't matter.

Copy your new client_id, client_secret to FE project

Encrypt/Decrypt env for staging & production

  • In order to decrypt env, please get the key from {your_env_name}.key file and run command below
./vendor/bin/sail php artisan env:decrypt --env=your_env_name --key=your_key

or

php artisan env:decrypt --env=your_env_name --key=your_key

EX: In order to decrypt staging env, get the key from file staging.key and run command below

./vendor/bin/sail php artisan env:decrypt --env=staging --key=1234567890
  • In order to encrypt env, please get the key from {your_env_name}.key file and run command below
./vendor/bin/sail php artisan env:encrypt --env=your_env_name --key=your_key

or

php artisan env:encrypt --env=your_env_name --key=your_key

EX: In order to decrypt staging env, get the key from file staging.key and run command below

./vendor/bin/sail php artisan env:encrypt --env=staging --key=1234567890

API HealthCheck

View in the browser on (replace the 3000 with your port)

http://localhost:3000/api/health-check/

API documents

View in the browser on (replace the 3000 with your port)

http://localhost:3000/request-docs/

Localization

  • To using localization, attach the locale name in Accept-Language header in every request. Supporting locales are en(English) and ja (Japanese)

Throttler

Rollbar

  • Rollbar Token is set at key ROLLBAR_TOKEN, with level log as debug.
  • Will be conditional load for each env that input on the Studio. Implement at app/Providers/AppServiceProvider.php
  • Logging config at config/logging.php
  • Validate Project Key
    • Via artisan (sail)
      ./vendor/bin/sail php artisan rollbar:validate-key 
    • or via composer (sail)
      ./vendor/bin/sail composer additional-commands
  • For more details please check the Official Docs https://docs.rollbar.com/docs/laravel

Scout APM

  • SCOUT KEY is set at key SCOUT_KEY, with level log as info. You could change it by adding SCOUT_LOG_LEVEL to your env. Check official docs for more details https://scoutapm.com/docs/php/configuration
  • Will be conditional load for each env that input on the Studio. Implement at app/Providers/AppServiceProvider.php
  • More config could be done by publishing Scout config:
  php artisan vendor:publish --provider="Scoutapm\Laravel\Providers\ScoutApmServiceProvider"  

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.