Skip to content

cbrenberg/serverless-dnd-graphql

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Serverless D&D GraphQL

A GraphQL implementation for AWS Lambda that provides Dungeons and Dragons game data.

Overview

This project was originally created as a traditional Node.JS application, and was refactored to run as a Lambda function on AWS.

It currently acts as a GraphQL layer built on top of the publicly available D&D 5e REST API, but with plans to eventually migrate the data into an AWS data store.

Getting Started

Development

To get started developing your own implementation:

  1. Clone or download this repository onto your local development machine.
  2. Ensure you have Node and NPM installed on your machine.
  3. Navigate to the directory containing the project, run npm install
  4. To test the application locally, you will need to create a .env file with the following key and value
  5. From the project's main directory, run node server.js. The application will run on http://localhost:3000, and you can access the Graphiql user interface for testing queries at http://localhost:3000/graphql

Deploying to AWS

You will first need an AWS account.

  1. First, from inside your project directory, select all files and folders and create a .zip file
  2. From the AWS Console, choose the Lambda service.
  3. Choose 'Create Function', then 'Author from scratch'
  4. Give the function a name of your choice
  5. Provide the function a suitable IAM role with, at minimum, Cloudwatch permissions.
  6. Again click 'Create Function'
  7. From the dropdown above the code editor, choose to upload a .zip file and select the file you created previously

To run the Lambda code, you will need to decide how the function will be triggered. I connected an API Gateway with GET and POST routes (if you choose this method, make sure to select Lambda Proxy Integration for each route).

Good luck!

About

A Dungeons & Dragons GraphQL implementation for AWS Lambda

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published