#100Devs - Auth & Project Night (cohort 2)

Class 48 of our Free Web Dev Bootcamp for folx affected by the pandemic. Join live T/Th 6:30pm ET leonnoel.com/twitch and ask questions here: leonnoel.com/discord

Skip to first slide
Slide 1 of 54

 

Auth & Project Night

Leon Noel

#100Devs

"Wake up, get my grind on like Section. Question?
If gang pull up, are you gonna back your bredrin?"


Slide 2 of 54

Agenda


Slide 3 of 54

Questions

About last class or life


Slide 4 of 54

Checking In

Like and Retweet the Tweet

!checkin


Slide 5 of 54

Submitting Work

I WANT IT - CHECKLIST

Homework: https://forms.gle/MUdE5XCY7VGKup1y8

Please Triple Check Before You Submit! No incomplete / fake work. It just makes my life more difficult and won't help you...

 


Slide 6 of 54

BACKEND REVIEW CLASS

SUNDAY Sept 11th
1:00pm EST


Slide 7 of 54

Thank You

#COMMUNITYTAUGHT


Slide 8 of 54

Huntober

I'm going to help with your:

Resume

Portfolio

Job Outreach

Interview Practice / Skills

Verification

I Will Be Your Reference ?

And more...

 

Special Discord Channels for Interview Feedback and Faster Help


Slide 9 of 54

But I Ain't Here To Play


Slide 10 of 54

List Of Things I Need Done

Please:


Slide 11 of 54

!checkin

every class


Slide 12 of 54

Homework

(Due A Week Later)


Slide 13 of 54

Networking

Alternatives?

Keep !sheet Updated Weekly

1 coffee chat / 3 connections every week


Slide 14 of 54

Code Challenge Every Day


Slide 15 of 54

PUSH EVERY DAY


Slide 16 of 54

The Bank

!bank


Slide 17 of 54

This Week (AGAIN)

Read About String Methods

Add them to an Interview Anki

Due 5 New Codewars

REDUE Your Codewars From Last Week

(tagged as strings!)


Slide 18 of 54

 Checklist

 Due Tuesday

DUE TODAY:

https://forms.gle/MUdE5XCY7VGKup1y8

!checklist

EVERYTHING


Slide 19 of 54

 Team Project

 Due Tuesday

(Sept 6th)


Slide 20 of 54

 Hitlist

 Due Tuesday

(Sept 13th)

!sheet


Slide 21 of 54

 Client Signature
Approved PR

 Due Tuesday

(Sept 27th)


Slide 22 of 54

 100 Hours Project
Beautiful MVP

 Due Tuesday

(Sept 27th)


Slide 23 of 54

 100 Hours Project
DONE

 Due Tuesday

(Oct 11th)


Slide 24 of 54

10 Premium Apps

Networked, Custom everything plus, tweets, blog, and project

Due Tuesday

(Oct 11th)


Slide 25 of 54

How to play the game?

Up to you if you want to play...


Slide 26 of 54

DON'T TAKE YOURSELF OUT OF THE GAME


Slide 27 of 54

We Have A Problem!

Our Apps Don't Have Authentication (ability for users to login)


Slide 28 of 54

We Have A Second Problem!

I'm not a cyber security expert

Music & Light Warning - Next Slide


Slide 29 of 54

Passport is authentication middleware for Node.js. Extremely flexible and modular, Passport can be unobtrusively dropped in to any Express-based web application.

Passport.js


Slide 30 of 54

Slide 31 of 54

I'm going to embrace the magic

Live footage of me using passport


Slide 32 of 54

Let's Look At Our App With Authentication


Slide 33 of 54

If You Ain't Hip


Slide 34 of 54

Live footage of me after adding auth


Slide 35 of 54

Authentication? Logged In Users? HOW?


Slide 36 of 54

Passport Has Strategies

Each application has unique authentication requirements. Authentication mechanisms, known as strategies, are packaged as individual modules.


Slide 37 of 54

That File Was BIG and I'm Gonna Take It As Disrespect


Slide 38 of 54

Ok, so... 

Our Users Are Logged In


Slide 39 of 54

BUT WHY?


Slide 40 of 54

What if I want them to only see their OWN todos?

Music & Light Warning - Next Slide


Slide 41 of 54

Let Me Show You


Slide 42 of 54

EnsureAuth, BABY!


Slide 43 of 54

Slide 44 of 54

Slide 45 of 54

If we have logged in users, what can we dream up?


Slide 46 of 54

Slide 47 of 54

Let's Build An App with Passport & Express


Slide 48 of 54

Real Quick


Slide 49 of 54

Mongoose

Collection

document

document

document

document

Mongoose provides a straight-forward, schema-based solution to model your application data.


Slide 50 of 54

Mongoose

Collection

document

document

document

document

Each schema maps to a MongoDB collection and defines the shape of the documents within that collection.

const UserSchema = new mongoose.Schema({
  userName: { type: String, unique: true },
  email: { type: String, unique: true },
  password: String
})

Slide 51 of 54

Mongoose

Collection

document

document

document

document

Models are fancy constructors compiled from Schema definitions. An instance of a model is called a document.

Models are responsible for creating and reading documents from the underlying MongoDB database.

module.exports = 
  mongoose.model('User', UserSchema)

Slide 52 of 54

Slide 53 of 54

Team Projects!

Group Pairings, Room, Floor, & Table Info

Remo Room 01

Remo Room 02


Slide 54 of 54

Homework

Do: Finish Project