Giter VIP home page Giter VIP logo

http-api-survey's Introduction

Survey API

This is a REST API built on AWS via IaC with Serverless Framework. Serverless Framework will deploy the following resources to AWS:

  • Amazon DynamoDB for storing the data
  • AWS Lambda for FaaS
  • Amazon API Gateway for the API Endpoints

Changes are deployed to dev and prod using separate GitHub Actions workflows making use of reusable workflow

The production (prod) and development(dev) environments in this repo are separate AWS Regions in the same AWS Account but in real world scenarios, you would have them in seperate AWS accounts for proper isolation.

The GitHub Actions Workflows will deploy to separate AWS Regions as an easy way to simulate the workflow.


Entities

[x] customers [x] responses [x] comments

customers

responses

Comments


Access Patterns

customer

  • create customer
  • get customer
  • delete customer

surveys

  • create survey
  • get survey
  • get all surveys

responses

  • create responses
  • get responses by customer

Setup

Clone this repo to your desktop and run npm install to install all the dependencies.

You might want to look into config.json to make change the port you want to use and set up a SSL certificate.


Instructions to deploy

  • Clone this repo:
  https://github.com/FonNkwenti/http-api-survey.git
  • Install dependencies
cd user-posts-comments-api && npm install
  • Set the AWS credentials for your prod and dev environments in your GitHub Actions Secrets

paste image from GitHub Actons


  • switch to dev branch to commit your changes which will automatically trigger the GitHub CI/CD to deploy to the dev environment.
git checkout -b dev
git add .
git commit -m 'initial commit to dev'
git push --set-upstream origin dev

  • switch to main branch to deploy to prod
git checkout main
git merge dev
git commit -m 'initial commit to prod'
git push -u origin main



Deployment Output

Insert Image of GitHub Actions Workflows Insert Image of the various Jobs Insert Image of Serverless deploy logs

Your API Endpoints will be available in the GitHub Actions Logs

paste output of your endpoints here

Project Status

Project is: in progress I will continue adding more functionality as I continue to learn and experiment


Room for improvement

  • API Gateway Authorizer Function for AuthO or AWS Cognito
  • Multi Stage deployments with GitHub Actions
  • Unit, mock, integration tests with JEST

http-api-survey's People

Contributors

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