Giter VIP home page Giter VIP logo

ragnariock / simple-serverless-registration-java Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lesterrivera/simple-serverless-registration-java

0.0 1.0 0.0 1.61 MB

A boilerplate serverless architecture for a simple email-based registration system that enables a serverless website to offer free access to assets stored on an S3 bucket (using pre-signed urls) to registered users.

License: MIT License

Java 54.78% TypeScript 35.68% JavaScript 1.82% HTML 6.11% CSS 1.61%

simple-serverless-registration-java's Introduction

Simple Serverless Registration built with Java

A boilerplate serverless architecture for a simple email-based registration system that enables a serverless website to offer free access to assets stored on an S3 bucket (using pre-signed urls) to registered users; for example, offers access to a video once the user has registered with their confirmed email address.

This project is the built and deployed using Serverless Framework and the following technology stack:

  • AWS Lambda with Java 8
  • AWS API Gateway
  • AWS DynamoDB
  • AWS SES
  • AWS S3
  • Angular

Current Status: Under Development

Usage

  1. Set up Serverless Framework and your AWS account as detailed here.

  2. Clone the project and initialize the stack

$ git clone https://github.com/lesterrivera/simple-serverless-registration-java.git

$ cd simple-serverless-registration-java

$ npm install

$ mvn clean install

  1. Deploy the AWS stack
$ serverless deploy
  1. Use web browser to open the front-end website on your S3 bucket

Configure optional support for Verification Email using SES

Its possible to send the registering user an email verification link over SES. Doing so will ensure that the user cannot retrieve a pre-signed url to the private assets in the s3 bucket until the email has been separately verified using the verifyToken generated and sent over SES.

  1. Configure AWS SES in your AWS Console as detailed here

  2. Set appropriate values to the following in serverless.yml.

    # Allow an external party to verify email (do not send verification email)
    EXTERNAL_VERIFY: false
    # The source email for SES; must be validated via AWS Console
    SES_SOURCE_EMAIL: [email protected]
    # The name of your service; used in the validation email to subscriber
    SERVICE_NAME: myhost
    # The verification url; used in the validation email to subscriber
    VERIFY_URL: https://www.myhost.com/verify.html

Viewing the website locally

The sample website is built with angular 4 using bootstrap 4. When using the angular cli, you can view the website locally rather than thru the s3 bucket that serverless framework deploys.

To run the website locally, use the following commands:

$ cd static

$ npm install

$ ng serve

Synchronize contents to your S3 bucket

You can deploy both private assets and the front-end website to your S3 buckets without deploying the serverless architecture as follows:

$ serverless syncToS3

However, deploying the serverless architecture again also works well and does not affect the already-deployed components.

Cleanup

If you wish to remove the AWS infrastructure created as a part of this project, use the following command to do so. This will remove the IAM roles, any resources defined in serverless.yml, and destroy the CloudFormation stack.

$ serverless deleteFromS3

$ serverless remove

Serverless: Getting all objects in S3 bucket...
Serverless: Removing objects in S3 bucket...
Serverless: Removing Stack...
Serverless: Checking Stack removal progress...
..................................
Serverless: Stack removal finished...

simple-serverless-registration-java's People

Contributors

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