Skip to content

Instantly share code, notes, and snippets.

@boxfrommars
Last active December 13, 2015 20:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save boxfrommars/f788ce725fb6ae6e8339 to your computer and use it in GitHub Desktop.
Save boxfrommars/f788ce725fb6ae6e8339 to your computer and use it in GitHub Desktop.

%PROJECT_NAME%

Description of the project

Install

Production Requirements

  • PHP >= 5.5.9
  • MySQL >= 5.5
  • OpenSSL PHP Extension
  • PDO PHP Extension
  • Mbstring PHP Extension
  • Tokenizer PHP Extension
  • Apache or Nginx

Development Requirements

  • PHPUnit >= 4
  • npm >= 2.14
  • gulp
  • bower

Installation

xu@calypso:~$ git clone git@%PROJECT_NAME%.git
xu@calypso:~$ cd %PROJECT_NAME%/
xu@calypso:~$ composer install              # install project dependencies
xu@calypso:~$ chmod a+rw storage -R         # folder for logs, cache, etc
xu@calypso:~$ chmod a+rw bootstrap/cache -R # folder for laravel internal cache
xu@calypso:~$ chmod a+rw public/storage -R  # folder for uploads
xu@calypso:~$ bower install

# create database (you should change credentials)
mysql> CREATE USER '%PROJECT_NAME%'@'localhost' IDENTIFIED BY '%PROJECT_NAME%';
mysql> CREATE DATABASE %PROJECT_NAME%;
mysql> GRANT ALL PRIVILEGES ON %PROJECT_NAME% . * TO '%PROJECT_NAME%'@'localhost';
mysql> FLUSH PRIVILEGES;

xu@calypso:~$ cp .env.example .env          # create enviroment config file
xu@calypso:~$ vim .env                      # edit configuration (mail smtp options, db credentials you choose on db creation, debug mode=true/false, APP_ENV=local/production).
xu@calypso:~$ php artisan key:generate      # generate unique application key
xu@calypso:~$ php artisan migrate           # run database migrations

# configure and point your web server to /public folder

then create Manager user

open tinker repl (to quit type \q)

xu@calypso:~$ php artisan tinker
>>> $user = new \App\User;
>>> $user->email = 'admin@example.ru';
>>> $user->password = Hash::make('somePassword'); # replace somePassword with strong manager password
>>> $user->name = 'Administrator Name';
>>> $user->save();
>>> \q # quit tinker

Updating (both production and development)

xu@calypso:~$ cd %PROJECT_NAME%/
xu@calypso:~$ git pull
xu@calypso:~$ composer install              # install new project dependencies
xu@calypso:~$ php artisan migrate           # run database migrations

Development

Files

  • controllers: app/Http/Controllers/
  • routes: app/Http/routes.php (To see all defined routes and corresponding controller methods use php artisan route:list console command)
  • main config config/app.php,
  • site config config/%PROJECT_NAME%.php
  • logs storage/logs/
  • docs in the docs folder
    • database description: db.dia or db.png

Assets

This project uses gulp (see gulpfile.js for details) for run tasks. To build assets run

xu@calypso:~$ gulp dashboard:build # builds dashboard assets
xu@calypso:~$ gulp frontend:build  # builds frontend (main site) assets

bower_components is placed in the public directory for development purpose (see .bowerrc)

Seed development data

xu@calypso:~$ php artisan db:seed # run database seeders

Development server

xu@calypso:~$ php artisan serve --port 8444

Testing

xu@calypso:~$ phpunit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment