Coder Social home page Coder Social logo

ali-husnain / appsync-serverless-api Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 115 KB

Appsync Serverless boilerplate

License: MIT License

JavaScript 100.00%
appsync appsync-graphql-api appsync-resolvers aws aws-lambda dynamodb serverless serverless-framework

appsync-serverless-api's Introduction

AWS AppSync API

This project is a template for AWS AppSync operations.

Services

  • AWS AppSync
  • AWS Lambda
  • Amazon DynamoDB
  • Serverless Framework for IaC.
  • GitHub actions for CI/CD.
  • Webpack for packaging code.
  • ESLint for linting.

How to setup the project

npm install

  • This will install all the required dependencies.

npm run format

  • format all the files using ESLint

npm run bundle

  • Packages the code using WebPack

sls deploy

  • This command will deploy the resources to AWS using dev credentials

Folder Structure

.
├── .gitHub            # CI/CD workflow for GitHub actions
├── Lambdas            # NodeJs code for all 4 CRUD Lambdas, including dynamodb helper functions
├── mapping-templates  # Mapping templates for getBlog query and create, update, delete mutations 
├── Resources          # AppSync mapping templates configuration and roles
├── schema.api.graphql # AppSync schema
├── serverless.yml     # Serverless framework configuration file supporting IaC
├── serverless-appsync-api.yml  # AppSync plugin configuration for data sources
├── LICENSE
└── README.md

CI/CD Setup (GitHub Actions Workflow)

Steps to setup CI/CD using GitHub Actions

The following is the list of steps that is executed as a part of the CI/CD setup:

  1. Store all account credentials in GitHub secrets to access them in environment without exposing. The AWS credentials will be used for deploying the application into your AWS account.
AWS_ACCESS_KEY_ID: ${{secrets.AWS_ACCESS_KEY_ID}}
AWS_SECRET_ACCESS_KEY: ${{secrets.AWS_SECRET_ACCESS_KEY}}
DEV_REGION: ${{secrets.DEV_REGION}}
PROD_REGION: ${{secrets.PROD_REGION}}
  1. Install serverless
  2. Install npm
  3. Build project using webpack
  4. Deploy to dev environment: Mumbai (ap-south-1)
  5. Deploy to prod environment: Oregon (us-west-2)

Image for the Format Checker job:

Image for the Serverless deploy job:

appsync-serverless-api's People

Stargazers

 avatar  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.