Coder Social home page Coder Social logo

aws-serverless-document-scanner's Introduction

aws-serverless-document-scanner

Screenshot

The full guide can be found on the AWS Compute Blog https://aws.amazon.com/blogs/compute/building-a-serverless-document-scanner-using-amazon-textract-and-aws-amplify/

An example serverless application for using Amazon Textract, AWS Amplify, Amazon API Gateway, AWS Lambda, Amazon S3, Amazon Cognito, and Amazon DynamoDB to create a document scanner application. Users can register, login, create projects, and upload images of text and generate a downloadable PDF of the detected text.

Frontend

  1. Follow the instructions to install and configure the Amplify CLI.
  2. Clone this project from GitHub and navigate to the amplify-frontend directory.
git clone https://github.com/aws-samples/aws-serverless-document-scanner
cd aws-serverless-document-scanner/amplify-frontend
  1. Install the dependencies.
npm install
  1. Initialize Amplify in the project using this command. Follow the prompts.
amplify init
  1. Use Amplify to deploy the backend resources using AWS CloudFormation.
amplify push

Deploy the backend

The Serverless Application Model Command Line Interface (SAM CLI) is an extension of the AWS CLI that adds functionality for building and testing Lambda applications. It uses Docker to run your functions in an Amazon Linux environment that matches Lambda. It can also emulate your application's build environment and API.

To use the SAM CLI, you need the following tools.

To build and deploy your application for the first time, run the following in your shell from the serverless-backend/ directory:

sam build
sam deploy --guided

The first command will build the source of your application. The second command will package and deploy your application to AWS, with a series of prompts. You'll be asked for the UserPoolID and AmplifyStackName created by the Amplify CLI. Those values can be found in the amplify-frontend/amplify/backend/amplify-meta.json file generated by Amplify.

Once deployed, the SAM cli will output an API Endpoint. Create a file, api-config.js in the amplify-frontend/src/ directory with the endpoint:

const apiConfig = {
    "endpoint": "<ENDPOINT>",
    "s3_bucket_name": "<BucketName>",
    "s3_region": "<S3 REGION>"
};

export default apiConfig;

Run the frontend application

To run the application locally, enter this command from the amplify-frontend/ directory:

npm run serve

To publish the frontend to AWS cloud hosting:

amplify publish

aws-serverless-document-scanner's People

Contributors

virgilvox avatar amazon-auto avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.