MERN JWT Auth Backend
Pre-release
Pre-release
MERN JWT Auth Backend
Release Notes:
- Initialized the application using
npm
and installed necessary packages - Set up a MongoDB database
- Set up a server with
Node.js
andExpress
- Created a database schema to define a
User
for registration and login purposes - Implement the
user registration
API. - Implement the
user login
API. - Set up three API routes,
register
,login
, andcurrentuser
usingpassport
+jsonwebtoken
s for authentication andvalidator
for input validation
Installed Packages:
- Install bcryptjs package to hash passwords before we store them in our database.
- Install body-parser to parse incoming request bodies in a middleware.
- Install concurrently to allows us to run our backend and frontend concurrently and on different ports.
- Install express so on top of Node it make the routing, request handling, and responding easier to write.
- Install is-empty as global function that will come in handy when we use validator.
- Install jsonwebtoken for authorization.
- Install mongoose to interact with MongoDB.
- Install passport to authenticate requests, which it does through an extensible set of plugins known as strategies.
- Install passport-jwt so passport strategy for authenticating with a JSON Web Token (JWT); lets you authenticate endpoints using a JWT.
- Install validator to validate inputs (e.g. check for valid email format, confirming passwords match).
- Install nodemon as dev dependency to track changes and restart the server.
Future Implementations:
- Implementation of React client app.
- Integration of redux for state management.
- Integration of Backend APIs in the react client.