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?"
Agenda
-
Questions?
-
Let's Talk - #100Devs
-
Review - What's Due For Huntober
-
Due - Professional Checklist
-
Learn - Local Auth
-
Build - Project Night
-
Homework - Start Interview Prep
Questions
About last class or life
Checking In
Like and Retweet the Tweet
!checkin
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...
BACKEND REVIEW CLASS
SUNDAY Sept 11th
1:00pm EST
Thank You
#COMMUNITYTAUGHT
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
But I Ain't Here To Play
List Of Things I Need Done
Please:
!checkin
every class
Homework
(Due A Week Later)
Networking
Alternatives?
Keep !sheet Updated Weekly
1 coffee chat / 3 connections every week
Code Challenge Every Day
PUSH EVERY DAY
The Bank
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!)
!checklist
EVERYTHING
Team Project
Due Tuesday
(Sept 6th)
Hitlist
Due Tuesday
(Sept 13th)
!sheet
Client Signature
Approved PR
Due Tuesday
(Sept 27th)
100 Hours Project
Beautiful MVP
Due Tuesday
(Sept 27th)
100 Hours Project
DONE
Due Tuesday
(Oct 11th)
10 Premium Apps
Networked, Custom everything plus, tweets, blog, and project
Due Tuesday
(Oct 11th)
How to play the game?
Up to you if you want to play...
DON'T TAKE YOURSELF OUT OF THE GAME
We Have A Problem!
Our Apps Don't Have Authentication (ability for users to login)
We Have A Second Problem!
I'm not a cyber security expert
Music & Light Warning - Next Slide
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
I'm going to embrace the magic
Live footage of me using passport
Let's Look At Our App With Authentication
Live footage of me after adding auth
Authentication? Logged In Users? HOW?
Passport Has Strategies
Each application has unique authentication requirements. Authentication mechanisms, known as strategies, are packaged as individual modules.
That File Was BIG and I'm Gonna Take It As Disrespect
Ok, so...
Our Users Are Logged In
BUT WHY?
What if I want them to only see their OWN todos?
Music & Light Warning - Next Slide
Let Me Show You
EnsureAuth, BABY!
If we have logged in users, what can we dream up?
Let's Build An App with Passport & Express
Real Quick
Mongoose
Collection
document
document
document
document
Mongoose provides a straight-forward, schema-based solution to model your application data.
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
})
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)
Team Projects!
Homework
Do: Finish Project
#100Devs - Auth & Project Night (cohort 2)
By Leon Noel
#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
- 2,070