DEV Community

Said MOUNAIM
Said MOUNAIM

Posted on

2

JWT Authentication Using TypeScript, Express.js, & MongoDB

Auth-TS

JWT Authentication Using TypeScript, Express.js, & MongoDB

Features:

  • Authentication

Technology Stack:

  • TypeScript
  • Node.js
  • Express.js
  • MongoDB
  • JWT

Default urls:

  • Login User : POST METHOD localhost:5000/api/auth
  • Register User : POST METHOD localhost:5000/api/auth/register
  • Get All Users : GET METHOD localhost:5000/api/auth/

Usage

Env Variables

Create a .env file in then root and add the following

PORT = 5000
MONGO_URI = your mongodb uri
JWT_SECRET = 'abc123'

Enter fullscreen mode Exit fullscreen mode

Install Dependencies

npm install

Enter fullscreen mode Exit fullscreen mode

Run App


# Run in dev mode

npm run server

Enter fullscreen mode Exit fullscreen mode
  • Version: 1.0.0
  • License: MIT
  • Author: Said Mounaim

Repo : https://github.com/saidMounaim/Auth-TS

Top comments (0)

Image of PulumiUP 2025

Let's talk about the current state of cloud and IaC, platform engineering, and security.

Dive into the stories and experiences of innovators and experts, from Startup Founders to Industry Leaders at PulumiUP 2025.

Register Now

👋 Kindness is contagious

Engage with a wealth of insights in this thoughtful article, cherished by the supportive DEV Community. Coders of every background are encouraged to bring their perspectives and bolster our collective wisdom.

A sincere “thank you” often brightens someone’s day—share yours in the comments below!

On DEV, the act of sharing knowledge eases our journey and forges stronger community ties. Found value in this? A quick thank-you to the author can make a world of difference.

Okay