Skip to content

Basic authentication module with 2FA, made with NestJS and Twilio Service and database I used Google Cloud Firestore. I used swagger for api documentation.

Notifications You must be signed in to change notification settings

JulianGarcia04/authentication-module-api

Repository files navigation

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Nest framework TypeScript starter repository.

Installation

$ pnpm install

Requirements

- Google Cloud CLI

Installing the Google Cloud CLI

The Google Cloud CLI is a command-line tool that allows you to interact with Google Cloud Platform services from your local machine. Here's a step-by-step guide on how to install it:

1. Prerequisites:

  • Operating System: Ensure you're running one of the supported operating systems: Linux, macOS, or Windows.
  • Python: The CLI requires Python 3.7 or later to be installed. You can check your Python version using the python --version command in your terminal. If you don't have it installed, download and install it from https://www.python.org/.

2. Installation Methods:

Method 1: Using the Google Cloud SDK Installer

  • Download: Visit the official Google Cloud SDK installation page: https://cloud.google.com/sdk
  • Select Platform: Choose the installer for your operating system (Linux, macOS, or Windows).
  • Run Installer: Double-click the downloaded installer file and follow the on-screen instructions.

Method 2: Using the gcloud Command (Linux/macOS)

  • Install with curl: Open a terminal and execute the following command:

    curl https://sdk.cloud.google.com | bash
  • Install with wget: Alternatively, you can use wget:

    wget https://sdk.cloud.google.com -O gcloud-installer.sh && bash gcloud-installer.sh

3. Configuration:

  • Initialization: After installation, run the following command to initialize the CLI and create a configuration file:

    gcloud init
  • Account Selection: Choose the Google account you want to use with the CLI. If you're not logged in, you'll be prompted to authenticate using your browser.

  • Project Selection: Select the Google Cloud project you want to work with. You can create new projects or choose existing ones.

4. Verification:

  • Check Installation: Run the following command to verify the installation and check the CLI version:

    gcloud --version

5. Additional Notes:

  • Component Installation: The CLI comes with a set of components that can be installed or uninstalled using the gcloud components command.
  • Usage: Refer to the official Google Cloud CLI documentation for detailed usage information and commands: https://cloud.google.com/sdk/docs

By following these steps, you'll have the Google Cloud CLI successfully installed and ready to use for managing your Google Cloud resources.

Running firestore local database

# start firestore database
$ pnpm run start:db
or
$ gcloud emulators firestore start --host-port=localhost:8080

Enviroment variables

This enviroment variables is necessary for you can access to all features and endpoints

  {
    TWILIO_ACCOUNT_SID: string
    TWILIO_AUTH_TOKEN: string
    TWILIO_VERIFY_SERVICE: string
    JWT_SECRET: string
    PORT?: number
  }

Running the app

# development
$ pnpm run start

# watch mode
$ pnpm run start:dev

# production mode
$ pnpm run start:prod

Test

# unit tests
$ pnpm run test

# e2e tests
$ pnpm run test:e2e

# test coverage
$ pnpm run test:cov

Support

Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.

About

Basic authentication module with 2FA, made with NestJS and Twilio Service and database I used Google Cloud Firestore. I used swagger for api documentation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published