These are instructions for setting up a development environment only. See DEPLOY.md for deployment instructions.
-
Clone this repository
-
Copy the fixometer config in
fixometer/config/config.dist.phptofixometer/config/config.php -
Copy
.env.exampleto.env, and replace the values that are incorrect- (e.g. MAIL_MAILER)
- Ensure that
APP_KEYis set to the same value as your restarters one. - Ensure that the FIXOMETER_* database connections in the
.envfile are set to the same database as your restarters one, e.g.:FIXOMETER_DB_CONNECTION=mysqlFIXOMETER_DB_HOST=dbFIXOMETER_DB_PORT=3306FIXOMETER_DB_DATABASE=restarters_dbFIXOMETER_DB_USERNAME=restartersFIXOMETER_DB_PASSWORD=s3cr3t
- Ensure that the DB_* database connections for the Repair Directory are set to different ones from restarters, e.g.:
DB_DATABASE=repairdir_devDB_USERNAME=repairdir_devDB_PASSWORD=secret
- Ensure that restarters is set to store sessions in the database
SESSION_DRIVER=databaseSESSION_COOKIE=restarters_sessionSESSION_DOMAIN=.restarters.testSESSION_LIFETIME=10080
-
Edit /etc/hosts and add
map.restarters.testfor127.0.0.1 -
Run
composer install -
Create the MySQL database:
CREATE DATABASE repairdir_dev;CREATE USER 'repairdir_dev'@'localhost' IDENTIFIED BY 'secret';GRANT ALL PRIVILEGES ON repairdir_dev.* TO 'repairdir_dev'@'localhost';
-
Add spatial function missing from MariaDB:
CREATE FUNCTION st_distance_sphere(pt1 POINT, pt2 POINT) RETURNS decimal(10,2) return 6371000 * 2 * ASIN(SQRT( POWER(SIN((ST_Y(pt2) - ST_Y(pt1)) * pi()/180 / 2), 2) + COS(ST_Y(pt1) * pi()/180 ) * COS(ST_Y(pt2) * pi()/180) * POWER(SIN((ST_X(pt2) - ST_X(pt1)) * pi()/180 / 2), 2) ));
-
Run
php artisan key:generateto generate anAPP_KEYenv var (required for SSL) -
Run
php artisan config:clearto reload the config cache -
Run
php artisan doctrine:migrations:migrate -
Seed the database with
php artisan restart:import:businesses data/test.csv -
If necessary, run migrations for the fixometer database
php artisan doctrine:migrations:migrate --connection=fixometer -
If you do not already have a Fixometer DB locally, add the users to log in with to visit the admin section
php artisan db:seed --class=UserSeeder. -
Run
npm install- This install front-end dependencies.
chmod +x node_modules/.bin/cross-env
-
Run
npm run dev- This builds front-end files.
-
Run the app locally with
php artisan serve
The following users are created:
| password | role | |
|---|---|---|
| root@restartproject.com | secret | Root |
| admin@restartproject.com | secret | Administrator |
| host@restartproject.com | secret | Host |
| restarter@restartproject.com | secret | Restarter |
| guest@restartproject.com | secret | Guest |