In this project we'll go through an example Node.js, Express.js and MongoDB API that supports user registration, login with JWT authentication and user management. For an extended example that includes refresh token. The API is written in Typescript for NodeJS and requires MongoDB to be running. Mongoose is used to connect to MongoDB, define the database schema and read/write data. Express is used as the web server.
• Install Node.js and MongoDB
• Running the project API locally
• Testing the API with Postman
• Install Node.js and NPM, when you install the Node.js NPM install automatically: https://nodejs.org/en/download/
• Install MongoDB Community Server from: https://www.mongodb.com/try/download/community
• Run MongoDB : https://docs.mongodb.com/manual/administration/install-community/
• Please clone or download the project from this link : https://github.com/RajabMohammadi/user-management
• Run npm install
from the command line in the project root folder
• Start the API by running npm run dev from the command line in the project root folder, you should see the messages Server running at http://localhost:3000
and connected to mongodb
Sign Up New User
Login User
Upate User
Get User
Refresh Token
Note: You can get the refresh token from login user request.