Skip to content

Cryptobyte-Team/Authy

Repository files navigation

Authy - NodeJS JWT Authentication Template

Authy is a simple template for user authentication in NodeJS using modern tooling such as TypeScript while being minimal and effective. Authy is designed with the KISS principle intentionally keeping the code, requirements, etc. simple so that we don't accidentally introduce vulnerabilities or collect and store too much information about users. Authy is also designed to be a secure default using security techniques.

Security Features

  • Modern Password Hashing via argon2
  • Common Password List Lookup
  • Rate Limiting
  • Deep Email Validation (MX Records, SMTP Lookup, Disposable Check) via deep-email-validator
  • Email verification with code

Developer Features

  • MongoDB
  • TypeScript
  • Typed Requests on top of Express
  • TypeScript Request Body Validation via DTO's
  • Configurable Email Services

Using Authy

  1. Click the green "Use this template" button above!

OR

  1. Install Node, NPM
  2. Install Yarn
  3. Clone the project
    git clone https://github.com/Cryptobyte-Team/Authy.git
  4. Install Dependencies
    cd Authy && yarn
  5. Configure .env
    # Create env from template
    cp .env.template .env
    
    # Edit the new .env file with your variables

Contributing

As an authentication template, the work is never truly complete and requires consistent updates. We welcome any and all contributions from developers who want to add features, fix issues or create new components within the platform. We ask that all contributions follow some simple contribution guidelines so that we can ensure a smooth experience for everyone.

  • Use a similar code style as what exists within the project
  • Refactor your code to be clean, concise and easy to read
  • Test any and all changes manually before submitting a pull request
  • Use the feature branch workflow ie. create a branch for your work, work and then create a pull request for us to review
  • All tests must pass in order for your pull request to be reviewed
  • All pull requests must be approved before being merged

REST API

This template is a REST API that can be built on to create systems that require user authentication. As a result the built in endpoints are fairly sparse and only cover what is required for the core template functionality. All endpoints are designed to recieve and respond with JSON data. Since the API is simple, we've included the API documentation here.

POST /v1/user/signup
{
  "email": "some@email.com",
  "password": "somepassword"
}

// Response
{
  "token": "JWT TOKEN"
}
POST /v1/user/signin
{
  "email": "some@email.com",
  "password": "somepassword"
}

// Response
{
  "token": "JWT TOKEN"
}