Bookshelf App for Java on App Engine Standard Environment

The Bookshelf app is a sample web app written in Java that shows how to use a variety of Google Cloud Platform products, including:

  • Google App Engine standard environment
  • Google Cloud Datastore
  • Google Cloud Storage

This tutorial explores the Bookshelf app in detail, and discusses how each feature of the app is implemented using familiar technologies and services provided by Cloud Platform.

The Bookshelf app is based on the javax.servlet web application framework and uses JavaServer Pages. The Bookshelf sample app uses Servlets because of their simplicity and ease of use. However, the concepts and technologies explored are applicable regardless of which framework you use.

Screen shot of the Bookshelf app showing controls and book covers

The Bookshelf sample app stores a collection of book titles. Anyone who has access to the app can add books to the list. The sample app offers these features:

  • Users can view the list of books, add books to the list, and remove books from the list.
  • Users can edit book details.
  • Users can upload cover images for books.
  • Users can log in with their Google accounts and view the books that they have added to the list.

Objectives

  • Clone or download the sample app.
  • Build the app and run it on your local machine.
  • Deploy the app to App Engine.
  • Walk through the sample code.
  • Learn how the app stores structured data.
  • Learn how the app stores binary data in Google Cloud Storage.

Costs

This tutorial uses billable components of Cloud Platform.

This tutorial has several steps, and each step is documented on its own page. The final page of the tutorial includes instructions for cleaning up resources, so you won't continue to be billed for Cloud Platform services. If you decide not to complete all the steps of the tutorial, see the cleanup instructions on the final page.

Before you begin

  1. Use the Cloud Platform Console to set up your Google Cloud Platform project:
    1. Create a new Cloud Platform project, and then create an App Engine application and enable billing in that project:
      Go to App Engine

      When prompted, select the region where you want your App Engine application located and then enable billing. After your Cloud Platform project is created, the Dashboard opens.

    2. Enable the Cloud Storage JSON, Stackdriver Logging, and Google+ APIs.

      Enable the APIs

  2. To deploy a Java app to App Engine, you must first set up your environment. See Using Apache Maven and the App Engine Plugin for details.
  3. Download, install, and initialize the Google Cloud SDK:
    Download the SDK
  4. Clone the sample repository:

    git clone https://github.com/GoogleCloudPlatform/getting-started-java.git

    Alternatively, you can download the sample as a zip file and extract it.

Tutorial structure

The Bookshelf tutorial has several parts that demonstrate how the sample app uses various Cloud Platform services.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...