Skip to content

A lightweight and secure implementation of user authentication using Nest.js. Demonstrates JWT authentication and data validation with a focus on security and simplicity.

License

Notifications You must be signed in to change notification settings

Da4ndo/NestAuthFlow

Repository files navigation

Forks Stars License Issues

NestAuthFlow

A lightweight, secure, and efficient user authentication system built with Nest.js. This project showcases the usage of JSON Web Tokens (JWT) for maintaining user sessions, rate limiting to prevent potential abuse, and built-in data validation for user inputs with a focus on security and simplicity.

This project was built using Node.js v20.5.1.

🚀 Features

  • User Registration and Authentication
  • JWT Sessions
  • Data Validation
  • Rate Limiting
  • Database usage with typeorm
  • Environment-Specific .env Files
  • Added logging support

🚀 Planned Enhancements

  • CSRF Protection

Research is underway to identify the best modern package for CSRF protection and how to effectively implement it.

📜 Changelog

v1.2.0 - 11.09.2023:

  • Environment-Specific .env Files
  • User Service Update and Increase
  • Added logging support
  • Rate Limiting

🛠️ Getting Started

📋 Prerequisites

🔧 Installation

  1. Clone the repository:
git clone https://github.com/Da4ndo/NestAuthFlow
  1. Install the dependencies:
cd NestAuthFlow
yarn install
  1. Configure your environment variables:

Open .env and change 'YOUR_SECRET' to your own secret:

JWT_SECRET = 'YOUR_SECRET';
  1. Start the development server:
yarn dev

Your server should now be running at http://localhost:4000.

🛠️ Usage

Here are some example endpoints that you can try:

To test calls to my api, I personally use the Thunder Client vscode plugin.

📚 Learn More About Nest.js

To learn more about Nest.js, visit Nest.js documentation.

📝 License

This project is licensed under the MIT License. See the LICENSE file for details.

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A lightweight and secure implementation of user authentication using Nest.js. Demonstrates JWT authentication and data validation with a focus on security and simplicity.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published