How to Design Almost Any Backend and Deploy It to AWS with No Code

[ad_1]


In this post I’ll show you how to design four different example apps – a SimpleNote clone, a Twitter clone, a Slack clone, and an E-commerce store. And we’ll do it with the coolest new toy released at AWS re:Invent 2020.

Introducing the Amplify Sandbox

Amplify Admin UI is a new low-code interface for building app backends that doesn’t require any AWS expertise. However, what many people may miss is that Amplify Admin also includes a wonderful new Sandbox which lets you get started without an AWS account.

This Sandbox is a publicly sharable version of the Amplify Admin UI where you can create and prototype your data models without even logging in to an AWS account!

Currently only the Data sandbox is built out, but over time the other AWS Amplify categories will be made available as well.

When you first enter a Sandbox, you are dropped into a visual builder where you can add your models, enums, and custom types. Mostly, you’ll just be creating models.

You can name models, add fields, and specify types (including whether they are optional or array fields), and even add one-to-one, one-to-many, or many-to-many relationships between models.

Further, it even lets you share the data models you create! This means you don’t have to start from scratch each time you create a project, and you can share your data schemas like you share code gists.

Our Four Sample Sandboxes

I thought it would be a great idea to demonstrate how powerful this is by sketching out four example sandboxes that you can use:

  • A notes app (inspired by the free note-taking app SimpleNote)
  • A chat app (inspired by Slack)
  • A social media app (inspired by Twitter)
  • An ecommerce backend (inspired by every shopping experience)

How to Create Entity Relationship Diagrams

Amplify Admin UI makes it easy to get going, but it is worth doing some planning before we start.

The time-tested way to do this is to draw entity relationship diagrams. We chose to use Lucidcharts for ours, but you can use any diagramming tool to do this.

image.png

The Notes App

This is a minimal app that I personally use every day, so I like it for its simplicity. We have two models: Notes and Tags, and only one many-to-many relationship between them for easy querying.

You could extend this by offering collaborative, role based editing, which is available once you deploy this model. You should also make use of the client-side DataStore libraries to make sure your notes work offline.

You can see the Sandbox here: https://sandbox.amplifyapp.com/schema-design/1c782f02-1fe7-4785-9a02-22a27cc96d0d/clone. Note that we use a bidirectional many to many relationship here between the models, as notes can have zero or more tags and vice versa.

image.png