Skip to content

MadiAbhilash/authwave-backend

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Auth Wave

Auth Wave is a robust authentication and user management service that simplifies secure user access for applications. It provides multiple authentication methods, comprehensive security features, and multi-project support, allowing developers to implement enterprise-grade authentication without building complex security infrastructure from scratch. Built with modern technologies, Auth Wave handles everything from user registration and verification to session management and security logging.

Core Features

1. Multiple Authentication Methods

  • Email/Password Authentication: Traditional authentication method
  • Magic URL Authentication: Passwordless login via email links
  • OTP Authentication: One-time passwords sent via email
  • Session Management: Handles multiple user sessions with device and user-agent tracking

2. User Management

  • User registration and account creation
  • Email verification system
  • Password reset functionality
  • Account lockout protection
  • User verification status tracking

3. Project Management

  • Multi-project support (each client application is a separate project)
  • Project-specific configurations
  • Custom email template support for each project
  • Project-level user limits and restrictions

4. Security Logging

The service implements comprehensive security logging to track various user activities and authentication attempts- login, logout, failed login attempts, user-verification, account-lockouts, etc.

5. Admin Dashboard

  • Admin authentication system
  • Project creation and management
  • User monitoring capabilities
  • Security log access and analysis
  • Project configuration management

Security Measures

1. Token Management

AuthWave employs JWT-based authentication with separate access and refresh tokens to enhance security. It features token expiration handling to automatically invalidate tokens after a set duration, reducing unauthorized access risks.

2. Password Security

AuthWave ensures password security by hashing all user passwords using bcrypt, enforcing strict password format validations and strength requirements to prevent weak credentials. Additionally, it incorporates a secure password reset mechanism, allowing users to safely reset their passwords through verified email links.

3. Rate Limiting

AuthWave implements rate limiting to prevent abuse and protect the service from excessive requests. It uses a combination of IP address, user-agent, and endpoint to track and limit request rates, ensuring fair usage and preventing abuse.

4. Session Security

AuthWave manages user sessions securely by tracking devices and user-agents. It implements session expiration and also allows for session revocation, enabling administrators (and users themselves) to terminate active sessions for specific users. Moreover, it also checks for multiple logins from the same device and user-agent.

5. Project-level Security

AuthWave enforces user limits per project and session limits per user to ensure optimal resource management and security. Administrators can customize security settings to align with organizational policies, while project-specific authentication method controls provide flexibility in managing access protocols tailored to each project's unique requirements.

6. Account Protection

AuthWave enhances account protection by enforcing account lockouts after multiple failed login attempts, requiring email verification for new accounts, providing a secure password reset flow, and sending emails to the user's email address to notify them about their account activities.

7. Data Protection

Every controller and business logic in AuthWave's backend ensures data protection by implementing sensitive data filtering, secure cookie handling, and input validation and sanitization. It follows MongoDB security best practices, including robust encryption and access controls to safeguard user information.

API Security

AuthWave's backend endpoints are secured using unique project-keys and project-ids generated by administrators via the developer console on the AuthWave website. Administrators also have the ability to regenerate project-keys as needed to maintain security in case of potential compromises.

Notable Technical Implementations by the Developer

  • Separation of concerns and a modular design that promotes maintainability and scalability.
  • Leveraging TypeScript provides strong type safety throughout the codebase, while clear error handling mechanisms enhance reliability and debuggability.
  • Scalability considerations such as database indexing for optimized data retrieval, efficient query patterns to minimize latency, pagination support for handling large datasets, and resource limiting to manage system resources effectively.

Installation

Tech Stack

  • FRONTEND: Next.js, Tailwind CSS, Shadcn UI
  • BACKEND: Node.js, Express.js, TypeScript
  • DATABASE: MongoDB (Mongoose ODM)
  • API Testing: Postman

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 100.0%