Installation - melihovv/grammar_review_tool GitHub Wiki

Required soft

  • php>=5.6.4
  • mysql or postgresql or sqlite
  • apache or hginx

Additional soft for install and build

  • node.js (>=v6), npm, yarn (yarn is not mandatory, but it more faster than npm)
  • composer
  • git (not mandatory)

Installation

  • Clone project with git or download archive
  • Change directory to project: cd grammar_review_tool
  • Install composer dependencies: composer install
  • Generate .env file from .env.example: cp .env.example .env
  • Set APP_ENV=production in .env file
  • Set APP_URL=your-domain.name
  • Set database related variables in .env file
    • DB_CONNECTION
    • DB_HOST
    • DB_PORT
    • DB_DATABASE
    • DB_USERNAME
    • DB_PASSWORD
  • Set mail related variables in .env file
    • MAIL_DRIVER
    • MAIL_HOST
    • MAIL_PORT
    • MAIL_USERNAME
    • MAIL_PASSWORD
    • MAIL_ENCRYPTION
    • MAIL_FROM_ADDRESS
    • MAIL_FROM_NAME
    • MAIL_NOREPLY
  • Set reCaptcha related variables in .env file
    • NOCAPTCHA_SECRET
    • NOCAPTCHA_SITEKEY
  • Generate a new application key: php artisan key:generate
  • Create tables in db: php artisan migrate
  • Install npm dependencies: yarn (if you have not installed it yet, type: npm i -g yarn)
  • Build static assets: npm run build
  • Create admin user: php artisan create:user {name} {email} --admin

That is all! Now go to the browser.

If site is not in document root

In case you configure your server to serve site not from document root, then you use url like http://example.com/grammar-review-tool/public instead of http://grammar-review-tool.com to access site. If so you need to specify additional variable when you build static assets. Instead of npm run build type ASSETS_PUBLIC_PATH='/grammar-review-tool/public/assets/' npm run build

Apache HTTP Server configuration

In case you use Apache web server the following .htaccess config might be useful for you

Allow from all
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f    
    RewriteBase  /Folder where app is located/
    RewriteRule "^(.*)$" index.php [L]
</IfModule>

Queue driver

For execution of a time consuming task (such as sending email) you may use several queue drivers:

  • sync - a synchronous driver that will execute jobs immediately (not recommended in production environment)
  • database
  • redis
  • others (more info in docs)

If you choose database or redis driver, you will also need a process monitor, such as supervisor. This is example of configuration file for supervisor grt.conf

[program:grt-queue]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/grt/artisan queue:work --tries=3 --sleep=5 --daemon
autostart=true
autorestart=true
user=www-data
numprocs=3
redirect_stderr=true
stdout_logfile=/var/log/supervisor/grt-queue.log

Sentry

If you want to use sentry for real time error tracking, simply provide SENTRY_DSN variable in .env file.

⚠️ **GitHub.com Fallback** ⚠️