Skip to content

Setting Up The Development Environment

Justin Loutsenhizer edited this page Dec 25, 2013 · 4 revisions

Contents


Overview


Googulator is a web app that depends on PHP5 and MySQL. In order to develop you'll need to setup some sort of server configuration that will support both of these. This application uses Google's PHP Google Client library which requires the PHP5 curl module to be enabled.

Once the server is setup you'll need to modify the configuartion file with appropriate values, comments should explain everything pretty clearly. One aspect that you'll have to do in addition to be able to fully setup the configuration, you'll need to setup a google api project:

  • Go to https://cloud.google.com/console
  • Click Create Project and give it a name and a id
  • It will take a little bit for google to create it, once it is you'll be redirected to the management area
  • Click on "Apis & auth" and disable all active APIs
  • Enable Drive SDK, Drive API, and Google Picker API
  • Click the Credentials tab
  • Create a new Oauth client id
  • Choose web application for application type, then for the authorized javascript origin and callback uri specify the uri your development environment will be running on (i.e. http://localhost)
  • Create a new Public API access key
  • Choose browser key and leave the inputs blank and create the key

Once you've done this the following will be how you configure the google api section of the configuration.php file from the information shown on the api console when you're done:

  • $GOOGLE_CLIENT_APP_NAME - the name of the api project (shown in the top right of the api console)
  • $GOOGLE_CLIENT_OAUTH_CLIENT_ID - The client id you made from the oauth section (make sure it's the one for the web application)
  • $GOOGLE_CLIENT_OAUTH_CLIENT_SECRET - The client secret you made from the oauth section
  • $GOOGLE_CLIENT_REDIRECT_URI - The redirect URI you chose from the oauth section
  • $GOOGLE_CLIENT_DEVELOPER_KEY - The Public api access key you made

Once the server is up and running and you can load the website, log in with your google account and you will get a message titled "The Website is Currently Broken". Close the message and go to the Admin tab and click reset database and click ok. Once this is done the website will be setup and ready to go!

In the case and event you are running on a server that doesn't let you create mysql tables you will need to create the mysql table manually, give it the same name as in the config (or update the config to match the name) and specifiy character set utf8mb4 collate utf8mb4_unicode_ci. The engine doesn't particularly matter (the characterset is so that we can store the vast majority of unicode characters)


Linux Instructions


Setup was done on ubuntu but should be similar for other Debian based systems

Install MySQL server: sudo apt-get install mysql-server

Install PHP5: sudo apt-get install php5

Install PHP5 MySQL plugin: sudo apt-get install php5-mysql

Install PHP5 Curl plugin: sudo apt-get install php5-curl

Install git: sudo apt-get install git

check out project from git:

cd /dir/to/store/project

git clone https://github.com/jloutsenhizer/googulator.git

To run the php built in server on port 8080 (you can use whatever port you please): /usr/bin/php -S 0.0.0.0:8080 -t /dir/to/store/project/googulator/public_html


Windows Instructions


Coming Soonish


Mac Instructions


Coming Soonish