Skip to content
Zomato menu list Web app written in Go for GAE
Go HTML Shell
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
_scripts
static
templates
zolist
.gitignore
README.md
app.yaml.template
deploy.sh
run_dev.sh
zolist.go

README.md

ZoList - Zomato menu list

IMPORTANT!

Since October 1 2019 this Go runtime (1.9) is no longer supported. Also to succesfully deploy Go runtime 1.11 (least supported version) you must enable Billing (even when you plan to use free quotas only).

Therefore I have no plan to upgrade this project to higher Go runtimes. Sorry.

GAE Application (written in Go)

Goal is to list favourite menus using Zomato REST API as data source.

See live demo on https://hp-zolist.appspot.com/ :-)

2017-10-07 Reached milestone-5:

  • now available in two languages (British English, Czech) - uses specific path prefix for language to ease bookmarks and avoid robots confusion
  • localized most of page content

2017-09-30 Reached milestone-4:

  • master-detail (click on restaurant heading to get detail)
  • ripped few YUI2 styles to spice page design a bit

2017-09-29 Reached milestone-3:

  • You can now use REST_IDS variable to pass custom public Restaurant IDs
  • defined 1st template function ZoCzDateFormat to format date in czech format and Europe/Prague timezone (called location in Go)
  • use memcache for daily menu list

2017-09-20 Reached milestone-2:

  • Partial caching (Restaurant struct in datastore. It is simple struct which changes infrequently - ideal fit for datastore)

2017-09-17 Reached milestone-1:

  • really shows menu from Zomato API.
  • no caching (yet)
  • restaurant list is hardcoded (shall be in environment for public and should allow personalisation for logged user)

This application shows how to use in Go/GAE:

Setup

To properly checkout source you must obey following structure:

cd 
mkdir -p src/github.com/hpaluch/
cd src/github.com/hpaluch/
git clone https://github.com/hpaluch/zolist-go.git

REMEMBER! You must have parent directory structure exactly set to src/github.com/hpaluch/ otherwise all local go imports like:

import (
 ...
  "github.com/hpaluch/zolist-go/zolist"
 ...
)

Would fail!!! Please see discussion at https://cloud.google.com/appengine/docs/flexible/go/using-go-libraries

Get additional localisation packages using:

_scripts/goget.sh

To Get Zomato API key:

  • go to page https://developers.zomato.com/api
  • click on Generate API Key button
  • click on Registrace (= Register in English)
  • fill in
    • Jméno a příjmení (= Name and Surname)
    • Emailová adresa (= e-mail address)
    • Heslo (= password)
  • click on Zaregistrovat
  • login to your mail account
  • click on confirmation mail from Zomato user.
  • go back to https://developers.zomato.com/api
  • click on Generate API Key button
  • fill in
    • Phone & Companay/Blog URL
  • and click on Generate API Key
  • add your key to your ~/.bashrc as:
export ZOMATO_API_KEY=your_key
  • and source it:
source ~/.basrc

Install required components:

sudo mkdir /opt/gae
sudo chown $USER /opt/gae
tar xzf google-cloud-sdk-171.0.0-linux-x86_64.tar.gz -C /opt/gae
  • Add newly created /opt/google-cloud-sdk/ to your PATH, for example add this to your ~/.bashrc:
export PATH=/opt/gae/google-cloud-sdk/bin:$PATH
  • and reload environment using:
source ~/.bashrc
  • add Go GAE plugin to your Google Cloud SDK:
gcloud components install app-engine-go

Create new application in GAE Dashboard:

Developing app

  • to run this app locally use:
./run_dev.sh

Deploying app

For the first time you must register your Google Account to deploy app:

  • configure your project ID (in my case hp-zolist):
gcloud config set project YOUR_APP_ID
  • configure your Google Account for GAE:
gcloud config set account YOUR_GOOGLE_ACCOUNT
  • login with your GAE account:
gcloud auth login
  • new browser window should appear:
    • login or confirm selected account
    • allow required permissions for Google Cloud SDK
  • you should see page with title "You are now authenticated with the Google Cloud SDK!"

And finally:

  • to deploy app run script:
./deploy.sh

Mis tips

How to view traces:

  • Go to Dashboard of your GAE project
  • click on "View Traces" on interested URL in list
  • than click on point in trace graph
  • you should now see detailed profile of your request

Resources

I used many resources to write this program including (but no guarantee to be comprehensive!):

You can’t perform that action at this time.