Git Product home page Git Product logo

microcampaign's Introduction

HTML5 Boilerplate with a couple of extras..

This is not the official HTML5 boilerplate, if you're looking for that head on over here: HTML5 Boilerplate

HTML5 Boilerplate is a professional front-end template for building fast, robust, and adaptable web apps or sites. I've added in a few bits and pieces to allow things like social login (FB for now), AWS Cognito and DynamoDb.

This project is really a starting point for anyone wanting to create a microsite, marketing campaign site or anything similar. Most small websites require some form of data capture, but traditionally this meant some form of intermediary like an API or third party services in order to keep data or access secure. The whole point is to provide rich functionality and keep the COSTS LOW

Because services like AWS Cognito use federated logins in order to authenticate users, you can furnish your users with a multitude of login options without having to write any authentication code yourself (unless you want to that is). The other awesome thing is you can push settings to Cognito and they'll be available anywhere the user is provided that they use the same login and cognito is implemented.

Seriously, you could run a single page application using Angular or React, store the codebase in AWS S3, Azure Blob or Google Cloud Platform Bucket and have data persisted like a normal database and run it for less than $5 per month (YMMV).

Setup

Getting setup is easy. First you need to have a developer account setup on Facebook by signing up to Facebook and heading to https://developers.facebook.com. Then create a new application and make a note of your Facebook App ID.

Then you need an account on AWS.

Once you're up and running, you'll need to setup AWS Cognito by creating a new Identity Pool. You'll need to provide a name under "Create new identity pool" and under "Authentication providers", choose the Facebook tab and enter the Facebook App ID from earlier. This will associate the Facebook application with this identity pool. Take note of your IdentityPoolId as you will need to update that in the js/facebookLogin.js file of the project.

Next up you'll need to create a new DynamoDb table, I've chosen DemoCampaign as my table name just for ease of understanding, call it whatever you want. The table requires a Key and type in "UserIdentity" and set the type as String. That's it for the setup. Simply add in the Facebook App Id and Table name into the variables at the start of js/facebookLogin.js.

then run the project! You should get a screen which prompts you to log in using Facebook. Once logged in, the user's name and email address will be added to the DynamoDB table.

Subsequent page loads will display the new user's details and a list of all the stored names and emails in the dynamodb table.

Notes

Make sure you have relevant terms and conditions for storing things like email and ensure that private fields are secured stored and not publicly available.

License

The code is available under the MIT license.

microcampaign's People

Contributors

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