Skip to content

fgiannar/mastori-api

Repository files navigation

Mastori API

Installation

A working installation of Apache 2.4 or higher with PHP 5.6 or higher, and MySQL 5.6 or higher (for geospatial queries to work) is required for this application to work properly.

Install Composer if you don't have it installed already.

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer

Clone Mastori API to a directory accessible by the web server. eg. /var/www

git clone https://github.com/fgiannar/mastori-api.git

Install dependencies, configure permissions, and configure databse

To avoid any issues with the artisan cli tool, the .env mysql host should be set to 127.0.0.1 instead of 'localhost'. If the mysql is installed on a separate server this is not required.

cd mastori-api
composer install
chmod -R 777 storage
cp .env.example .env
vi .env # set at least database values (also FACEBOOK_ID and FACEBOOK_SECRET for FB related functionalities to work)
php artisan key:generate
php artisan migrate:refresh --seed
php artisan php artisan l5-swagger:publish  (to publish swagger docs in api/documentation path)

Configure Web Server to proper root directory

At this point the application is ready. All we need is to point our web server to the correct directory, eg /var/www/mastori-api/public, and restart our web server.

Last thing is to make sure that Apache's mod_rewrite is enabled and that AllowOverride is set to All for our directory.

a2enmod rewrite
service apache2 restart

Seeding

php artisan db:seed

Will populate the DB with 500 mastoria and 500 end users. Both mastoria and end users will have random addresses. Mastoria will also have random professions and areas they serve. Areas are populated based on the greece-prefectures.geojson found in database/seeds/data. Professions are populated based on the professions.json found in database/seeds/data.

About

Laravel based REST API for Mastori

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages