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.php
tofixometer/config/config.php
-
Copy
.env.example
to.env
, and replace the values that are incorrect- (e.g. MAIL_MAILER)
- Ensure that
APP_KEY
is set to the same value as your restarters one. - Ensure that the FIXOMETER_* database connections in the
.env
file are set to the same database as your restarters one, e.g.:FIXOMETER_DB_CONNECTION=mysql
FIXOMETER_DB_HOST=db
FIXOMETER_DB_PORT=3306
FIXOMETER_DB_DATABASE=restarters_db
FIXOMETER_DB_USERNAME=restarters
FIXOMETER_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_dev
DB_USERNAME=repairdir_dev
DB_PASSWORD=secret
- Ensure that restarters is set to store sessions in the database
SESSION_DRIVER=database
SESSION_COOKIE=restarters_session
SESSION_DOMAIN=.restarters.test
SESSION_LIFETIME=10080
-
Edit /etc/hosts and add
map.restarters.test
for127.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:generate
to generate anAPP_KEY
env var (required for SSL) -
Run
php artisan config:clear
to 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 | |
---|---|---|
[email protected] | secret | Root |
[email protected] | secret | Administrator |
[email protected] | secret | Host |
[email protected] | secret | Restarter |
[email protected] | secret | Guest |