Coder Social home page Coder Social logo

herkahahaha / forms-service Goto Github PK

View Code? Open in Web Editor NEW

This project forked from serverless/forms-service

0.0 0.0 0.0 208 KB

Serverless Forms Service to collect form data with Admin UI

Home Page: https://serverless-forms.netlify.com/

JavaScript 92.31% HTML 2.04% CSS 5.65%

forms-service's Introduction

Serverless Form Collection Application

Collect and manage form data with serverless tech.

Frontend

Backend

  • Node backend running in AWS Lambda Functions
  • DynamoDB noSQL for database
  • Authorization via API Gateway Custom Authorizer Function

slsforms

Setup

  1. Clone down the repo and install the dependencies
# install frontend dependencies
cd frontend && npm i

# install backend dependencies
cd backend && npm i
  1. Setup auth0 client. See Auth0 Setup below

  2. Then deploy the backend application. (install serverless if you haven't already)

cd backend

serverless deploy
  1. Add the API values to src/_config.js and bootup the frontend!
cd frontend

npm start

Deployment

Connect your repo to netlify and add the build command cd frontend && npm install && npm run build

Auth0 Setup

  1. Create an Auth0 Client

    1. Choose Single Page web app
    2. Grab your auth0 domain and clientID from your auth0 client settings
    3. plug those values into the frontend and backend config
  2. Install the Auth0 Authorization extension in your auth0 account

  3. Add an auth0 rule that will attach user roles to your JWT token

    function (user, context, callback) {
      if (context.clientID === 'your-auth-client-id') {
        // Update namespace with your namespace
        var namespace = 'https://serverless.com/';
        // console for debug purposes
        console.log('user.roles', user.roles);
        // add role to JWT token
        context.idToken[namespace + 'roles'] = user.roles;
      }
      callback(null, user, context);
    }
  4. Add your auth0 values to /frontend/src/_config.js

forms-service's People

Contributors

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