Giter Club home page Giter Club logo

awards-data-explorer's Introduction

Starter template for applications that connect to an API, deal with users + authentication, and benefit from server-side rendering.

Built with React, Next.js, Node, and MySQL. Best for single-page applications if looking to do client-side rendering only.

For client-side rendering / single page applications, check out the sibling application, Fullstack-Login-Starter.

Authentication flow is as follows:

  • user submits a signup form
  • if all formatting is correct, it encrypts password (via bcrypt) and enters the user in the database
  • server sends the user an email with a verification link
  • the link redirects them to the login window where they enter their password one last time
  • once logged in, an access_token (JWT) is issued in a cookie, and is also stored in a database
  • access_token stores an encrypted user_id that is required to make any requests
  • the token expires every 10 minutes, wherein it makes a request to the database to ensure that it is valid, and reissues a token
  • because tokens are deleted in the database every time they are validated, we can detect when a hacker has obtained your token since two people would be requesting the same token (by the second request, the token will have been deleted)
  • if a request is made for a token that does not exist, the app will automatically delete all session tokens associated with the user, making it impossible to proceed without a password

awards-data-explorer's People

Contributors

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