Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sumanmanna134/2fa-exchange
A robust API with 2-factor authentication using NestJS, TypeORM, Docker, and focused on managing contact books, aptly named 'Exchange.' This project aims to seamlessly integrate security measures and efficient data storage for a reliable and scalable solution. Join in to contribute and enhance the Exchange API experience!
https://github.com/sumanmanna134/2fa-exchange
api-rest docker nestjs nestjs-backend swagger typeorm typescript
Last synced: 5 days ago
JSON representation
A robust API with 2-factor authentication using NestJS, TypeORM, Docker, and focused on managing contact books, aptly named 'Exchange.' This project aims to seamlessly integrate security measures and efficient data storage for a reliable and scalable solution. Join in to contribute and enhance the Exchange API experience!
- Host: GitHub
- URL: https://github.com/sumanmanna134/2fa-exchange
- Owner: sumanmanna134
- Created: 2024-01-03T10:12:47.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-16T12:49:40.000Z (about 1 year ago)
- Last Synced: 2024-11-24T03:19:10.842Z (2 months ago)
- Topics: api-rest, docker, nestjs, nestjs-backend, swagger, typeorm, typescript
- Language: HTML
- Homepage:
- Size: 1.85 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
![Alt text](screenshots/banner.png)
## Description
🚀 Implementing 2FA Authentication with │
│ NestJS, Docker, and TypeORM │
│ 🔒 Enhance Security: Login Using Any │
│ Authenticator App## Installation
```bash
$ npm install
```Create .env file
## Env Create
```bash
DB_TYPE=
POSTGRES_HOST=
POSTGRES_PORT=
DATABASE_USER=
DATABASE_PASSWORD=
DB_NAME=
POSTGRES_USER=
DB_USERNAME=
DB_PASSWORD=
PGADMIN_DEFAULT_EMAIL=
PGADMIN_DEFAULT_PASSWORD=
PGADMIN_LISTEN_PORT=
APP_PORT=3000
JWT_ACCESS_TOKEN_SECRET=
JWT_ACCESS_TOKEN_EXPIRATION_TIME=
JWT_REFRESH_TOKEN_SECRET=anyRefreshKey
JWT_REFRESH_TOKEN_EXPIRATION_TIME=28800
TWO_FACTOR_AUTHENTICATION_APP_NAME=exchange-appDOCKER_BUILD_IMAGE_NAME=2fa-exchange
DOCKER_REPOSITORY=
```### Run the Script
## open terminal
```bash
$ chmod +x script.sh
```## Running the services
```bash
$ ./script.sh
```![Alt text](screenshots/script-menu.png)
## Swagger
```
http://localhost:3000/docs
```## 2Factor Authentication Endpoints
1. `/2fa/generate-qr`: endpoint likely represents an API endpoint in a web application responsible for generating a QR code to enable two-factor authentication (2FA) for a user.
2. `/2fa/activate`: endpoint is a route in a web application that facilitates the activation process for two-factor authentication (2FA). This endpoint typically handles HTTP POST requests and expects the user to provide necessary information, such as an authentication code, to enable 2FA for their account.
3. `/2fa/authenticate`: endpoint is typically used in the context of two-factor authentication (2FA) within a web application. This endpoint is designed to handle the authentication process when a user attempts to verify their identity using two factors: something they know (e.g., a password) and something they have (e.g., a mobile device).![Alt text](screenshots/2fa-qr-gen.png)
## Test
```bash
# unit tests
$ npm run test# e2e tests
$ npm run test:e2e# test coverage
$ npm run test:cov
```## Support
Join in to contribute and enhance the Exchange API experience!.
## Stay in touch
- Author - [Suman Manna](https://www.linkedin.com/in/sumanmanna/)
- Website - [https://iamsuman.com/](https://iamsuman.com/)