Skip to content

A simple note taking application using modular AWS SDK for JavaScript (v3)

License

Notifications You must be signed in to change notification settings

aws-samples/aws-sdk-js-notes-app

Repository files navigation

aws-sdk-js-notes-app

In this app, you are going to build a simple note taking application using modular AWS SDK for JavaScript

The note taking application is the modified version from the original Open Source MIT licensed project shared in the tutorials on serverless-stack.

Table of Contents

Prerequisites

To set up this notes app, complete the following tasks:

  • Install Node.js by following these steps:
    1. Install nvm.
    2. Use node v20.x.x by running nvm use or nvm use 20 in a terminal window.
    3. Verify that node is installed by running node -v in a terminal window and confirm that it shows Node.js >=20, such as v20.12.2).
    4. Enable corepack by running corepack enable in a terminal window.
  • Install dependencies by running yarn.
  • If you don't have an AWS account, create one.
    • If you're an Amazon employee, see the internal wiki for creating an AWS account.
  • Install the AWS CLI.
    • Verify that the AWS CLI is installed by running aws in a terminal window.
  • Set up AWS Shared Credential File.
    • Your credentials file (~/.aws/credentials on Mac/Linux,%UserProfile%\.aws\credentials on Windows) should look like the following:
      [default]
      aws_access_key_id = <ACCESS_KEY>
      aws_secret_access_key = <SECRET_ACCESS_KEY>
      
    • Your ~/.aws/config (%UserProfile%\.aws\config on Windows) should look like the following:
      [default]
      region = us-west-2
      

Setup

This exercise code uses modular AWS SDK for JavaScript as follows:

  • backend performs create, delete, get, list and update operations on DynamoDB.
  • frontend does put, get, delete operations using an S3 browser client.

Deploy infrastructure

  • Run: yarn cdk deploy
  • This command:
    • Creates AWS infrastructure using AWS Cloud Development Kit.
    • Deploys backend bundles to lambda.
    • Creates resources to be used in the frontend.

Prepare frontend API

  • Run: yarn prepare:frontend
  • This command copies AWS resources to the frontend config.

Debug frontend

  • Run: yarn start:frontend
  • This command starts ReactApp for testing frontend, and opens the URL in browser.

Clean up

The Cloudformation stack can be deleted by running: yarn cdk destroy

Contributing

Contributions are more than welcome. Please read the code of conduct and the contributing guidelines.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT License. See the LICENSE file.