Git Product home page Git Product logo

simplesessauth's Introduction

Simple SESSION Authentication

Implementation of session-based authentication with express-session & default MemoryStore.

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

Software you need to install:-

// Visual Studio Code Installation
Go to Visual Studio Code link above and choose download according to your machine type (choose the **stable** version):-
- Window, go for Windows Installer
- MacOS, go for MacOS Installer
- Linux, go for Linux Installer

// Node.js Installation
Go to Node.org link above and choose your machine type (Please choose the **LTS download version** instead of the Current version):-
- Window, go for Windows Installer
- MacOS, go for MacOS Installer

Installing

Please follow the step below to get the system running

  1. After download or git repo the Project file. Place your Project folder anywhere in your system (doesn't matter where actually)
  2. Open your Code Editor (Visual Studio Code or any other code editor)
  3. Go to your Terminal in Visual Studio Code or open CMD - Command Prompt, manuver to where your Project folder located and do the following installation:- (make sure you already inside your Project folder. Eg: C:\parentFolder\ProjectFolder) in order to get the final version running properly
  • Install all dependencies required (as stated in package.json)
in your Terminal or CMD, it's gonna look like this:-
C:\simpleSESSAuth\final\>npm install
  • Once installation finishes with no errors. Then start the project:-
C:\simpleSESSAuth\final\>npm start

Important Notes

  1. This project contain 2 main folders:-
  • starter (contain starter codes and files needed)
  • final (contain a complete working web app - finished code)
  1. This project aims to teach you how to implement session-based authentication with default MemoryStore.
  2. This project will not cover the part of designing and implementing or coding of the UI.

Step By Step Guides

  • setup index.js (server.js)
  • setup db
    • create database & collection
    • create data schema
  • setup session
  • setup auth routes
    • create register POST route
      • create validation handler
    • create login GET & POST routes
    • create logout POST route
  • setup home routes
    • create home GET route
    • create addTime POST route
  • setup verification
    • create function to handle logged in user
    • create function to handle guest (logged out user)
  • handle forced logout

Deployment

No additional support on how to deploy on live system for this project.

Built With

  • Vanilla JavaScript (No Front-end Framework Use)

Authors

Related Articles

Acknowledgments

These are some of the online sources which I learnt from. You may do so as well.

simplesessauth's People

Contributors

lalapolalaanewb avatar

Watchers

 avatar  avatar

Forkers

prismaticoder

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.