Full-Stack Auth: Login from Scratch


A full stack Auth app requires:

sign up
user model
jwt Class
encode, decode
access keys
install jwt + bcrypt
generate token
setup login, registration
login page
logout page
authorize request => application
store token
strong params

Need to be able to have a user sign up, the process is as follows:

You’ll need a form with username and password and a submit button
a route => user create
user model (has_secure_password) which comes with a particular gem called..bcrypt
bcrypt + jwt

Following the above instructions requires some serious insight. If you want to be good at programming, it can show how capable you are to google each of the above lines…line by line to figure out and understand how you might write a full-stack auth app without having ever written one before.

The below commands written using Terminal could also prove useful within the framework of using Ruby on Rails for the backend and plain old vanilla JavaScript for the frontend.

rails new backend --api -d=postgresql
mkdir frontend
touch index.html app.js app.css
rails g model user
rails g controller users

Good luck making the best use of this as a reminder of what you should be looking for and remembering when trying to write a full-stack auth app for the first time.

Useful links for success and insight into the MERN stack and even the MEVN stack:



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store