App in a Box - Todo

App in a Box is a series of applications that are prebuilt and architected to demonstrate common application architectures and share projects that can repurposed to support your needs. Each one just requires one command to run and when the process is done, a fully function version of the app is available and running, ready to use or modify.

Todo

Todo is a simple todo application architected as a vanilla 3 tier application:

  • Backend
    • Database - MySQL - Cloud SQL
    • Caching - Redis - Cloud Memorystore
  • Middleware/API
    • Container hosted API - Golang - Cloud Run
  • Front End/UI
    • Container hosted UI - Nginx + HTML/JS/CSS - Cloud Run
  • Deployment
    • Continuous Deployment - Cloud Build
    • Secret Management - Cloud Secret Manager

Get Started

Click on the link below to a copy of the source code in Cloud Shell. Once there, a single command will spin up a workng copy of the application in your project.

Open in Cloud Shell

Also feel free to review the source code directly in github.

View source code

Learn More

Use the links below to get more information on the piece we used in this Application. Choose how you learn best: video, product documentation, or interactive walkthrough.

Backend

Cloud SQL

Cloud SQL provides the backend for the application, the database layer. This app uses MySQL.

Cloud Memorystore

Cloud Memorystore provides the caching layer for the application. This app uses Redis.

API and Front End

Cloud Run

Cloud Run allows you to run application in a container, but in a serverless way, no having to configure number of instances, processors, or memory. Upload a container, get a url. This app uses two Cloud Run services backed by containers: a container running Nginx to provide the webserver for a static front end, and a container running an API layer providing access to the backend, written in golang.

Build Tools

Cloud Build

Cloud Build is the tool that packages up the containers and deploys them to be available as Cloud Run services.

Cloud Secret Manager

Cloud Secret Manager stores sensitive particulars about the application for the build process.

Scripts

The install script uses the gcloud and gsutil CLI tools to take an empty project and install the application in it. The output should be a working application and a url to the Cloud Run service for the front end.

./install

./cloudbuild.yaml