Skip to content

🌩️ Boilerplate for typescript/nodejs on AWS using serverless yml templates with graphQL as the API backed by dynamod & elastic search

License

Notifications You must be signed in to change notification settings

DasithKuruppu/Serverless-GraphQL

Repository files navigation

🌩️ Serverless Nodejs/GraphQL Boilerplate

(IaC using YML/Serverless & other 🦄 magical stuff)

CircleCI tested with jest jest forthebadge forthebadge

Please go to Gitlab Repo or use gitlab if you want to use free gitlab CI/CD instead of circleCI

Read more on :

Features.


  1. Serverless YML templates(Infrastucture As Code- IAC) that provide and provision dynamic/scalable resources like DynamoDb,S3,elastic search, lambda functions etc with a single command.
  2. 📜 Support for Typescript.
  3. 🎭 An attempt at unit testablity and test coverage via Jest, this would be focused more heavily on later updates.
  4. 🌀 Attempts to focus on a simple development structure / flow.
  5. 🏋️‍♂️ Support for any amount of environments (Dev,Test,Production etc..) replications via Cloud formation templates.
  6. 🕸️GraphQL api exposed via a single endpoint with the posiblilty to scale via step functions or otherwise in future.
  7. ✔️ CI/CD for all 3 environments (dev,test,production) via Gitlab CI/CD
  8. 🐋 Docker file / compose for running dynamodb offline on a docker container.

Architecture

Architecture diagram

How to Install & Pre-requisites


Clone project into your local folder.... & then navigate to project on terminal or Shell

npm install -g serverless

serverless config credentials --provider aws --key $AWS_ACCESS_KEY_ID --secret $AWS_SECRET_ACCESS_KEY

Note that the $AWS_ACCESS_KEY_ID and $AWS_SECRET_ACCESS_KEY here needs to be replaced by credentials given to you by project owner or you may create your own AWS account and IAM role / credentials for programatic access Click here for more info !!!

Install GraphQL Playground optional for easy querying

Getting started


npm install

npm install -g graphql-cli

npm run deploy-dev
npm start

To run it locally

Using / Playing around with it...


Initially make sure you have completed steps in both Install & Pre-requisites and in Getting started

npm run deploy-dev

Copy URL to the lambda function that is output onto the terminal once above command is run Terminal

Then Open GraphQL Playground and Select "URL EndPoint" and paste the Copied URL there GraphQL OpenProject

Then Run

query {
  listEvents {
    id
    name
  }
}

To see if the GraphQL query works as inteded either by returning empty list or list of "events" GraphQLPlayground

Read more on graphQL to learn Queries / Mutations to try out more queries againt the API

About

🌩️ Boilerplate for typescript/nodejs on AWS using serverless yml templates with graphQL as the API backed by dynamod & elastic search

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published