Giter Site home page Giter Site logo

nico-rodriguez / authentication-app Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.97 MB

Secure authentication application (username/password and OAuth)

Home Page: https://authentication-app-473ad7.netlify.app/

JavaScript 73.00% HTML 4.48% CSS 22.51%
css css-flexbox expressjs html javascript nodejs oauth oauth-github oauth-google reactjs

authentication-app's Introduction

Authentication App

Solution for a challenge from Devchallenges.io.

Netlify Status

Visit https://authentication-app-473ad7.netlify.app.

Features

This application/site was created as a submission to a DevChallenges challenge. The challenge was to build an application to complete the given user stories.

It features:

  • Frontend deployed on Netlify; backend on Render
  • Username/Password authentication
  • Strong password policy enforcement
  • Rate limit to account creation and profile edition
  • OAuth authentication (GitHub and Google)
  • httpOnly cookies for session management
  • Client and server code are written in a modular and highly scalable way
  • Profile images stored in Cloudinary
  • Automatic dark mode
  • Redis database for session storage
  • Query and modify local Redis entries in real-time

Note: for the GitHub OAuth to work, third-party cookies must be enabled.

Overview

Signup (desktop, light theme)

signup-desktop-light

Login (desktop, dark theme)

login-desktop-dark

Welcome page (desktop, light theme)

welcome-desktop-light

Profile (mobile, light theme)

profile-mobile-light

Profile edit (desktop, light theme)

profile-edit-desktop-light

Getting started

After grabbing a local copy of the repository, you can start the backend server in development or production mode, by issuing either npm run start:dev or npm run start respectively, from inside backend/ folder.

When using Redis database locally, the package redis-commander allows one to query and modify the entries in the database in real time.

Regarding the session, a secret must be provided to verify the authenticity of each user session (it's used to sign the session cookie).

The user data is stored in a Mongo database.

Environment variables

The application expects certain environment variables (provided values are template examples):

PORT=5000

MONGODB_URL="mongodb+srv://xxxxxxxxxxxxxxxxxxxxxxxx"

# Redis configuration only needed in development mode
REDIS_HOST="localhost"
REDIS_PORT=6379

# Secret for signing the session cookie
SESSION_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx"

# OAuth
# GitHub
GITHUB_CLIENT_ID="xxxxxxxxxxxxxxxxxxxxxxxx"
GITHUB_CLIENT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx"
# Google
GOOGLE_CLIENT_ID="xxxxxxxxxxxxxxxxxxxxxxxx"
GOOGLE_CLIENT_SECRET="xxxxxxxxxxxxxxxxxxxxxxxx"

CLOUDINARY_URL="cloudinary://xxxxxxxxxxxxxxxxxxxxxxxx"

FRONTEND_URL="http://xxxxxxxxxxxxxxxxxxxxxxxx"

Deployment

It's recommended to set up two OAuth applications: one for testing and another for production. Also, environment variables may be set with values different as those of development.

For the rate limiter, a store more appropriate for production should be used (memory-store is currently used).

Built With

authentication-app's People

Contributors

nico-rodriguez 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.