Provides food truck administration and an API for the consumer user interface.
Use these instructions to setup a temporary* development environment of this project.
- Fork this repository
- Create a new Virtual Machine (1gb+ recommended) >> SSH in >> Run vms quick install:
export GHUSER='AnthonyAstige'(Replace AnthonyAstige with your username)curl -L -o- https://rawgit.com/$GHUSER/foodtrucks/master/drupal-project/bin/vmsquickinstall.sh | bash
- See app running
- Visit http://{vms-ip} in your browser
- Options to move forward
- Play with UI as admin
(cd ~/foodtrucks/drupal-project/web && drush uli 1)- Replace
defaultin the login url with {vms-ip}
- Play with UI as Vendor
- Visit http://{vms-ip}/user in your browser
- Use a username / password you know (ie; 'food' user)
- Be a dev
- Edit a file (Files in
~/foodtrucks/) - Clear cache if needed (ie; if changed sass) via
cd ~/foodtrucks/drupal-project/web && drush cr - Refresh page
- See changes in your browser
- Edit a file (Files in
- Play with UI as admin
*For a permanent development environment we recommend you read the referenced script above to install locally.
/api/eventsreturns details of all events with their associate food trucks nested/api/vendorsreturns details for all vendor food trucks/api/events/yyyy-mm-ddreturns only events with the samestart_time, ignoring theThh:mm:ssportion of the returnedstart_time
/api/events && /api/events/yyyy-mm-dd && /api/events/yyyy-mm-dd/yyyy-mm-dd
[
{
uuid: // unique identifier,
description: // description,
foodtruck: { // are the Vendor Food Truck(s) associated with the Event
uuid: // the unique identifier,
title: // text,
description: // text,
logo: // the full `http(s)` url to the logo,
website_url: // text, not full `http(s)` url,
facebook_url: // text, not a full `http(s)` url,
twitter_name: // text, should be an `@twitter-name` value,
telephone_number: // text, should be a telephone number
},
lat: // latitude ,
lng: // longitude,
start_time: // exactly as they are entered by vendors with no timezone adjustments (assumed to be local Eau Claire time already DST adjusted),
end_time: // simply offset by adding the `duration` entered by vendor to the `start_time`
},
...
]
/api/vendors
[
{
uuid: // the unique identifier
title: // text,
description: // text,
logo: // the full `http(s)` url to the logo
website_url: // text, not full `http(s)` url
facebook_url: // text, not a full `http(s)` url
twitter_name: // text, should be an `@twitter-name` value
telephone_number: // text, should be a telephone number
},
...
]
Foodtruck Permissions Google Doc
- php 5.6 (minimum, with extensions: php5-mysql, php5-gd, php5-curl, php5-fpm)
- A MySQL server (MariaDB recommended)
- Webserver (nginx recommended, apache will probably work too)
First you need to install composer.
Note: The instructions below refer to the global composer installation. You might need to replace
composerwithphp composer.phar(or similar) for your setup.
- Clone this repository and delete its
drupal-projectdirectory - Create a new project directory with the
composer create-projectcommand - Restore this repository's files with
git reset - Install this reposirtory's custom project dependencies with
composer install, this command will take a while to finish
git clone git@github.com:codeforeauclaire/foodtrucks.git
cd foodtrucks
rm -rf drupal-project
composer create-project drupal-composer/drupal-project:8.x-dev drupal-project --stability dev --no-interaction
git reset --hard HEAD
cd drupal-project
composer install
- Configure your server, set the site root to the
drupal-project/web/directory - Configure a database and db user in your server. The database name, user credentials, the path
to the deploy folder, and a
$settingshash need to be entered into the sitesettings.phpfile
(here is an examplesettings.phpsnippet to append to thedrupal-project/web/sites/default/settings.phpfile)
$databases['default']['default'] = array (
'database' => 'DB_NAME',
'username' => 'DB_USERNAME',
'password' => 'DB_PASSWORD',
'prefix' => '',
'host' => 'localhost',
'port' => '3306',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
);
$config_directories['sync'] = '../deploy';
$settings['hash_salt'] = hash('sha256', serialize($databases));
then replace the DB_NAME, DB_USERNAME, and DB_PASSWORD placeholders
TODO: Update here to use stuff from quickinstall script
(cd /root/foodtrucks/drupal-project/web && drush cedit system.site --file="/root/foodtrucks/drupal-project/deploy/system.site.yml" -y)
(cd /root/foodtrucks/drupal-project/web && drush cedit shortcut.set.default --file="/root/foodtrucks/drupal-project/deploy/shortcut.set.default.yml" -y)
- from the web directory use drush to install the site
cd drupal-project/web
drush si --account-pass=admin -y
(if you don't have drush 8.x installed I believe you can use the one provided in the vendor/drush directory: ../vendor/drush/drush/drush)
- with a browser go to
http://yoursite.name/core/install.php
- lookup
system.sitevalues from deploy folder and then edit the site db-config to replace the uuid with the one from thedeploy/system.site.ymlfile - delete the last 2 lines with the hash from the db-config
_core: default_config_hash: - repeat for the shortcut if needed
cd drupal-project/web
cat ../deploy/system.site.yml
drush cedit system.site
cat ../deploy/shortcut.set.default.yml
drush cedit shortcut.set.default
- finally, import config using drush
cd drupal-project/web
drush cim
- from web folder,
drush cexwill export config to the deploy folder - from project root folder,
composer require drupal/MODULE_NAME:8.xwill usually install the latest version of that module or theme in their contrib folder and then update the composer.json and composer.lock files - from project root folder, commit and push changes in deploy config, composer.json and composer.lock
cd to your project root, above the drupal root.
cd ../.. from web directory
git add .
git commit -m "YOUR COMMIT MESSAGE"
git push