DEV Community

Kurt Kemple
Kurt Kemple

Posted on

Introducing Quick Notes

Alt Text

Deploy a full stack web app to help you organize your notes when you're on the go.

The other day I released Journey, a bite sized app that helps you track your job listings when on the job hunt. I received a lot of positive feedback and figured I would put together some more examples of the types of things you can do with AWS Amplify and backing Amazon services.

That's why I built Quick Notes. It's a small enough app that it can be figured out relatively easily and it also serves a purpose that hopefully many will find useful, just like Journey.

What It Does

Quick notes allows you to quickly take down and access notes and provides features like:

  • ๐ŸŽ™ Record notes
  • ๐Ÿ”ˆ Play notes back
  • ๐Ÿ“– Read notes
  • ๐Ÿ‘ฎโ€ Authenticated
  • ๐Ÿ”ฅ Serverless back end
  • ๐Ÿš€ GraphQL
  • ๐Ÿ’ป Deploy back end in minutes

How It Works

The code for the app is located here.

This project uses Amazon ML services (Amazon Polly and Amazon Transcribe) and the Amplify Predictions category to convert text to speech for playing notes, and for converting recorded notes to text to store in AWS AppSync (GraphQL service).

In the project, you'll notice a folder named amplify. This folder contains the back end for the app that can be redeployed in anyone's account. In the amplify folder you'll see a backend folder. In this folder you'll see the configuration for the four main features:

  • Authentication service (powered by Amazon Cognito)
  • GraphQL API (built with AWS AppSync)
  • Speech To Text Generation (built with Amazon Transcribe)
  • Text to Speech Generation (built with Amazon Polly)

In the backend/api folder you'll see the GraphQL API configuration as well as the base GraphQL Schema.

This is the base GraphQL Schema. You'll see that the base schema looks like this:

type Note @model @auth(rules: [{ allow: owner }]) {
  id: ID!
  title: String!
  text: String!
  createdAt: String
  updatedAt: String
}
Enter fullscreen mode Exit fullscreen mode

If you've never worked with Amplify before you may not be aware of the @model and @auth directive. These are part of the GraphQL Transform library of the Amplify CLI.

@model - Decorate any base type with this directive to get CRUD and list query and mutation definitions, a DynamoDB table, and resolvers created for the GraphQL operations.

@auth - Decorate any base type or field with this directive to get granular authentication and authorization set up for protected data.

Deploying the App

To automatically deploy the app, click the big orange button ๐Ÿ‘‡

amplifybutton

If you wish to manually deploy the app, follow the instructions below.

Deploy the back end and run the app

  1. Clone the repo & install the dependencies
~ git clone https://github.com/kkemple/quick-notes.git
~ cd quick-notes
~ npm install
Enter fullscreen mode Exit fullscreen mode
  1. Initialize and deploy the Amplify project
~ amplify init
? Enter a name for the environment: dev (or whatever you would like to call this env)
? Choose your default editor: <YOUR_EDITOR_OF_CHOICE>
? Do you want to use an AWS profile? Y

~ amplify push
? Are you sure you want to continue? Y
? Do you want to generate code for your newly created GraphQL API? N
> We already have the GraphQL code generated for this project, so generating it here is not necessary.
Enter fullscreen mode Exit fullscreen mode
  1. Start the app and register a new user
~ yarn start
Enter fullscreen mode Exit fullscreen mode

Deploy the front end

  1. Create a new repository with your git service of choice

  2. Push the project to your new repository

~ git remote add origin <your_new_repository>
~ git push --set-upstream master
Enter fullscreen mode Exit fullscreen mode
  1. Connect to AWS Amplify Console and wait for build to start. You will be given a production URL and you are ready to take some notes!

Customizing the GraphQL schema

This schema can be edited. If you need additional fields, you can update the backend by doing the following:

Update the schema (located at amplify/backend/api/quicknotes/schema.graphql).

Redeploy the back end

amplify push
Enter fullscreen mode Exit fullscreen mode

If you or anyone you know needs help getting up and running with this app, reach out to me on Twitter, I'd be happy to help!

Top comments (4)

Collapse
 
miguel391 profile image
Miguel • Edited

Following the README file I was able to get the app running.

But I am having a hard time understanding where the notes from the app are actually stored. I see from the CreateNote Resolver file that this information should be stored in DynamoDB.

The problem is that the table shows no records even though I have created several notes across multiple accounts. Do you have any guidance on how I could trace where this information for the app is stored?

Collapse
 
theworstdev profile image
Kurt Kemple

Hey Miguel,

You could have more than one table because one is created for each environment so I would look at all tables to see if maybe there is another one for quick notes. The data is definitely being stored in DynamoDB as you mentioned so if you're still unable to find it I'd be happy to jump on a video chat with you to try to figure it out! You can DM on twitter (@kurtiskemple)

Collapse
 
deadcoder0904 profile image
Akshay Kadam (A2K)

So I recently noticed AWS has launched offline support for this. Do I still need to create AWS new user even to debug offline?

Collapse
 
theworstdev profile image
Kurt Kemple

Yeah, you can mock out the auth part as well, so can develop apps locally and only push to AWS once you have the desired setup.