Giter VIP home page Giter VIP logo

project-3-backend's Introduction

MERN Authentication Backend

This is a code along for MERN Auth

Notes:

  1. Set up server
  2. Test home route
  3. Make api folder and test /test route
  4. Set up models
  5. Setup passport strategy
  6. Intialize passport and pass passport as arguemnt to config
  7. Make controllers for user
  8. Test each one after completing it.
  9. /test, /register, /login, /profile
  10. Make route for each controller
  11. Test other controllers in the box
  12. Make template, add models and routes

What it includes

  • Mongoose User schema and model
  • Settings for the database
  • Passport and passport-jwt for authentication
  • JSON Web Token
  • Passwords that are hashed with BCrypt

User Model

Column Name Data Type Notes
id Integer Serial Primary Key, Auto-generated
name String Must be provided
email String Must be unique / used for login
password String Stored as a hash
timesLoggedIn Number used to track the amount of times a user logs in
date Date Auto-generated
__v Number Auto-generated

Default Routes

Method Path Location Purpose
GET / app.js Server file
GET /api/users/test users.js Return json data
POST /api/users/login users.js Login data
POST /api/users/signup users.js Signup data
GET /api/users/profile users.js Profile data
GET /api/users/all-users users.js Get all users

project-3-backend's People

Contributors

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