Installing the Amazon QLDB Node.js sample application - Amazon Quantum Ledger Database (Amazon QLDB)

Installing the Amazon QLDB Node.js sample application

Important

End of support notice: Existing customers will be able to use Amazon QLDB until end of support on 07/31/2025. For more details, see Migrate an Amazon QLDB Ledger to Amazon Aurora PostgreSQL.

This section describes how to install and run the provided Amazon QLDB sample application for the step-by-step Node.js tutorial. The use case for this sample application is a department of motor vehicles (DMV) database that tracks the complete historical information about vehicle registrations.

The DMV sample application for Node.js is open source in the GitHub repository aws-samples/amazon-qldb-dmv-sample-nodejs.

Prerequisites

Before you get started, make sure that you complete the QLDB driver for Node.js Prerequisites. This includes installing Node.js and doing the following:

  1. Sign up for AWS.

  2. Create a user with the appropriate QLDB permissions.

  3. Grant programmatic access for development.

To complete all of the steps in this tutorial, you need full administrative access to your ledger resource through the QLDB API.

Installation

To install the sample application
  1. Enter the following command to clone the sample application from GitHub.

    2.x
    git clone https://github.com/aws-samples/amazon-qldb-dmv-sample-nodejs.git
    1.x
    git clone -b v1.0.0 https://github.com/aws-samples/amazon-qldb-dmv-sample-nodejs.git

    The sample application packages the complete source code from this tutorial and its dependencies, including the Node.js driver and the AWS SDK for JavaScript in Node.js. This application is written in TypeScript.

  2. Switch to the directory where the amazon-qldb-dmv-sample-nodejs package is cloned.

    cd amazon-qldb-dmv-sample-nodejs
  3. Do a clean install of the dependencies.

    npm ci
  4. Transpile the package.

    npm run build

    The transpiled JavaScript files are written in the ./dist directory.

  5. Proceed to Step 1: Create a new ledger to start the tutorial and create a ledger.