Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mansoorhussain12/profanity-api
An API endpoint where you can check the profanity in words and sentences.
https://github.com/mansoorhussain12/profanity-api
cloudflare-worker honojs nodejs upstash-vector
Last synced: 11 days ago
JSON representation
An API endpoint where you can check the profanity in words and sentences.
- Host: GitHub
- URL: https://github.com/mansoorhussain12/profanity-api
- Owner: MansoorHussain12
- Created: 2024-06-10T03:58:46.000Z (7 months ago)
- Default Branch: main
- Last Pushed: 2024-06-10T05:46:19.000Z (7 months ago)
- Last Synced: 2024-10-25T10:36:46.628Z (about 2 months ago)
- Topics: cloudflare-worker, honojs, nodejs, upstash-vector
- Language: TypeScript
- Homepage: https://profanity-api.profanity-checker.workers.dev/
- Size: 33.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Profanity Check API
This API endpoint, built with `hono-js`, uses a vector database from Upstash and is deployed on Cloudflare as a worker. It checks the profanity level of a given message and returns a response indicating whether the message contains profanity, along with a score representing the severity.
## Features
- **Profanity Detection**: Analyze messages for profanity.
- **Scoring System**: Receive a score indicating the severity of the profanity.
- **Deployment**: Seamless deployment as a Cloudflare Worker.## Getting Started
### Prerequisites
- [Node.js](https://nodejs.org/)
- [hono-js](https://hono.dev/)
- [Upstash](https://upstash.com/)
- [Cloudflare Account](https://www.cloudflare.com/)### Installation
1. **Clone the repository:**
```sh
git clone https://github.com/MansoorHussain12/profanity-api.git
cd profanity-api3. **Install Dependecies:**
```sh
npm install
```3. **Configure Upstash:**
- Set up your Upstash vector database and obtain your credentials.
- Create ***Wrangler.toml*** file and add Upstash credentials to it.
4. **Deploy on Cloudflare:**
- ```sh
npm run deploy### Usage
To check the profanity level of a message, send a `POST` request to the API endpoint with a JSON object containing the message.**Request**
```sh
{
"message": "Hello World"
}
```
**Response**
If no profanity is detected:```sh
{
"isProfanity": false,
"score": 0.76693106
}
```