Skip to content

Quick start

jip edited this page Aug 21, 2019 · 13 revisions

Clone the project

Clone Socya project into your working directory

Via HTTPS :

git clone https://github.com/le-campus-numerique/socya.git

Via SSH:

git clone [email protected]:le-campus-numerique/socya.git

Install Composer

In order to retrieve project dependencies, Composer is required.

composer install

Install NPM

Project also require NPM to compile and manage dependencies :

npm install

Create .env file

The repo comes with a .env.example file as a model for the project.

Simply duplicate this file, renaming it as .env

Key generation

.env file contains an APP_KEY parameter that needs to be auto generated by php artisan:

php artisan key:generate

Sessions configuration

Default sessions config is set up on file.

Simply switch it to database in .env file :

SESSION_DRIVER=database

Database configuration

Database settings are also included into .env file.

Make sure your database is created for the project to work, then set up database editing the following parameters :

DB_CONNECTION=mysql

DB_HOST=127.0.0.1

DB_PORT=3306

DB_DATABASE=homestead

DB_USERNAME=homestead

DB_PASSWORD=secret

Migrating/Seeding

For that quick start guide, we'll disable mailing to prevent maigration errors:

Replace

MAIL_DRIVER=smtp

MAIL_HOST=smtp.mailtrap.io

MAIL_PORT=2525

MAIL_USERNAME=null

MAIL_PASSWORD=null

MAIL_ENCRYPTION=null

by this single line :

MAIL_DRIVER=log

We can now migrate and populate datas into the database :

php artisan migrate:fresh --seed

If you encounter Class $ does not exist error, let's try this :

composer dump-autoload


Damn, isn't this "Quick" guide over yet ? --No, but we're pretty close now !


Running production server

We can now launch the production server to display the application :

php artisan run serve

Handler preprocessor scss files (if needed)

npm run watch

And... Let's GO