nguyen190887 / badge-scanner-app

App to scan badge, extract employee ID, and track sharing team's activities.
1 stars 0 forks source link

Sharing Tracker App

Track sharing activities in a team.

Getting started

Web App

Backend

Deploy

Deploy using stage

Deploy a function

CI/CD

FAQs

  1. How to get Cognito info?

    • cd to stack/, then run sls info -v
  2. How to seed user for testing?

    • Run below script (or create .sh file, then execute)
      USERPOOL_ID=us-east-1_xxxxxxxx
      USERNAME=your@user.name
      PASSWORD=yourpwd
      aws cognito-idp admin-create-user --user-pool-id $USERPOOL_ID --username $USERNAME 
      aws cognito-idp admin-set-user-password --user-pool-id $USERPOOL_ID --username $USERNAME --password $PASSWORD --permanent

How to create new GraphQL query + resolver

  1. Add new type (object, query, mutation, etc.)
    • Declare new type in stack/schema.graphql
    • Run amplify codegen in stack
    • New type is added to app/graphql to use on client side
  2. Add resolver for new query
    • Declare resources in stack/serverless.yml
    • Declare AppSync resources including mappingTemplates and dataSources as seen on AppSync
    • For dataSources point the config to a lambda function which will act as the resolver
      type: AWS_LAMBDA
      config:
      functionName: newFunc
    • Declare new lambda function in function section to register the resolver function, point the function to a handler
      newFunc:
      handler: handlers/funcHandler.index
    • Add a handler to where we point to in the lambda declaration, in this case, handlers/funcHandler.js

Built-with

Learning