An open API service indexing awesome lists of open source software.

https://github.com/gabireze/password-generator-api

A flexible and well-structured API for generating secure passwords, built with NestJS. It allows customization of character types, quantity, and output format (JSON, XML, YAML, CSV, text, or HTML).
https://github.com/gabireze/password-generator-api

api csv customizable generator html json just nestjs nestjs-backend openapi password password-generator secure supertest swagger xml yaml

Last synced: about 1 month ago
JSON representation

A flexible and well-structured API for generating secure passwords, built with NestJS. It allows customization of character types, quantity, and output format (JSON, XML, YAML, CSV, text, or HTML).

Awesome Lists containing this project

README

          

# ๐Ÿ” Password Generator API

[![codecov](https://codecov.io/gh/gabireze/password-generator-api/branch/main/graph/badge.svg)](https://codecov.io/gh/gabireze/password-generator-api)

A secure and flexible password generation API built with [NestJS](https://nestjs.com/). Supports multiple formats including JSON, text, XML, CSV, YAML, and HTML.

## GitAds Sponsored
[![Sponsored by GitAds](https://gitads.dev/v1/ad-serve?source=gabireze/password-generator-api@github)](https://gitads.dev/v1/ad-track?source=gabireze/password-generator-api@github)

## ๐Ÿš€ Features

- Generate multiple random passwords with custom rules
- Format output as:
- JSON
- Plain Text
- XML
- CSV
- YAML
- HTML
- Exclude specific characters (e.g., `lIO0`)
- Choose custom separators and quoting
- Fully documented with Swagger (OpenAPI)
- Includes unit and E2E tests

## ๐Ÿ“ฆ Installation

```bash
npm install
```

## ๐Ÿงช Run in development

```bash
npm run start:dev
```

## ๐Ÿ—๏ธ Build for production

```bash
npm run build
npm run start:prod
```

## ๐Ÿ“š API Documentation

After running the app, visit:

```
http://localhost:3000/api
```

This loads the Swagger UI with all available endpoints.

## ๐Ÿ”„ Example request

### POST `/password/generate`

```json
{
"length": 12,
"uppercase": true,
"lowercase": true,
"numbers": true,
"symbols": true,
"quantity": 3,
"format": "json"
}
```

#### Supported formats:
`json` | `text` | `xml` | `csv` | `yaml` | `html`

## โœ… Run tests

```bash
npm run test # Unit tests
npm run test:e2e # End-to-End tests
npm run test:cov # Coverage report
```

## ๐Ÿงน Code quality

```bash
npm run lint # Check code style
npm run lint:fix # Fix lint issues
npm run prettier:fix
```

## ๐Ÿ”ง Export OpenAPI docs (Swagger JSON)

```bash
npm run export:swagger
```

## ๐Ÿ“ Project Structure

```
src/
โ”œโ”€โ”€ password/ # Password generator module
โ”œโ”€โ”€ app.controller.ts # Healthcheck route
โ”œโ”€โ”€ swagger.ts # Swagger export
โ””โ”€โ”€ main.ts # Entry point
```