-
Notifications
You must be signed in to change notification settings - Fork 0
Project Setup and Maintenance
You already have Vain ready for development? Start contributing! Get a feeling for the platform by reading the Deep Dive Development guide.
These steps are generally required multiple times. You will need to follow them in sequential order if you boot your Homestead VM for the first time. Later on you may need some of them for maintaining the development environment and to complement your development work.
NOTE: All of the following steps are performed through an SSH connection to your Homestead VM. To open a SSH connection fire up your terminal and type homestead ssh
.
You have to supply some environment specific variables to run the application. Having its roots in the ruby community the DotEnv concept is used. For your local development environment just copy the .env.example
stub file to .env
(don't commit that to any repository!). Check the key-value pairs and verify that everything is correct.
For more information about DotEnv visit the Laravel Documentation.
All dependency management tools have to run from the project root. We use the following dependency management tools for both backend and frontend:
- Composer / Repository for Backend
- NPM for Frontend
- Bower / Repository for Frontend
NOTE: All of them are shipped with Homestead out of the box.
Install all PHP backend dependencies with the command composer install
or composer update
respectively. It reads its dependencies out of the composer.json
file.
Examples: laravel
, phpSpec
, entrust
Please don't .gitignore
the composer.lock
file. Commit it to the repository. It is necessary to install correct dependency versions in production. (Source)
For more Information about Composer visit the Composer Documentation.
Why using two dependency managers for the frontend? NPM is commonly used for installing server or backend dependencies along with Node, while Bower is used for the client-side dependencies. You can not really differentiate the two dependency managers general nowadays, but for the Vain project you can think of them like the following.
NPM the Node Package Manger
..is used to install all system level requirements. Those are necessary to build the frontend but are not required to actually run it. You can think of them as compile-time dependencies. Install those by running the command npm install
in your terminal. It reads its dependencies out of the package.json
file.
Examples: grunt
, less
For more Information about NPM visit the NPM Documentation.
Bower
..is used to install all frontend frameworks upon which the UI and UIX is built. You can think of them as runtime dependencies. Install those - like you would do with composer - using the bower install
or bower update
command respectively. It reads its dependencies out of the bower.json
file.
Examples: bootstrap
, AdminLTE
For more Information about Bower visit the Bower Documentation.
Since we use a module architecture in Vain there are some differences to how you normally would migrate and seed a database in Laravel.
NOTE: The default artisan database commands will also work but they do not affect the modules.
For more Information about arisan commands for modules visit the Module Artisan Commands page.
Create new migration for the specified module.
php artisan module:migration MIGRATION MODULE
Rollback, Reset and Refresh The Modules Migrations.
php artisan module:migrate-rollback
php artisan module:migrate-reset
php artisan module:migrate-refresh
Rollback, Reset and Refresh The Migrations for the specified module.
php artisan module:migrate-rollback MODULE
php artisan module:migrate-reset MODULE
php artisan module:migrate-refresh MODULE
NOTE: See this pitfall with module:migrate-rollback
.
Migrate from the specified module.
php artisan module:migrate MODULE
Migrate from all modules.
php artisan module:migrate
Seed the mandatory dependencies (default permissions and roles) with the following command:
php artisan db:seed
Create new seed for the specified module.
php artisan module:seed-make SEED MODULE
Seed from the specified module.
php artisan module:seed MODULE
Seed from all modules.
php artisan module:seed
Building the Frontend is super easy. Since Elixir is built on top of gulp, you only have to run gulp
. If you are actively developing the frontend you may choose gulp watch
as it automatically triggers recompiles if you change an asset file.
To get an in-depth guide how to handle assets read the How to Elixir guide.
To get more information about testing read the Testing Techniques guide.
Very well, you are ready for development. If you need assistance for some maintenance processes you can come back and use this page as an cheatsheet anytime you want.
Start contributing! Get a feeling for the platform by reading the Deep Dive Development guide.
Any problems? Try our Troubleshooting page!