{"id":24903774,"url":"https://github.com/lostovayne/profanity-api","last_synced_at":"2026-05-05T14:04:51.683Z","repository":{"id":274893300,"uuid":"924388917","full_name":"Lostovayne/Profanity-Api","owner":"Lostovayne","description":"API built using Typescript and Honojs, connected to a vector database using an embedding of Upstash to compare similar words and phrases and determine if they are insults etc.","archived":false,"fork":false,"pushed_at":"2025-02-06T04:13:58.000Z","size":39,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-06T05:23:54.115Z","etag":null,"topics":["bun","cloudflare","honojs","typescript","upstash-vector"],"latest_commit_sha":null,"homepage":"https://profanity-api.epsaind.workers.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Lostovayne.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-29T22:55:14.000Z","updated_at":"2025-02-06T04:14:01.000Z","dependencies_parsed_at":"2025-01-30T01:22:16.509Z","dependency_job_id":"2aa40b29-f59a-437e-a882-8c1c82a11a50","html_url":"https://github.com/Lostovayne/Profanity-Api","commit_stats":null,"previous_names":["lostovayne/profanity-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lostovayne%2FProfanity-Api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lostovayne%2FProfanity-Api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lostovayne%2FProfanity-Api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Lostovayne%2FProfanity-Api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Lostovayne","download_url":"https://codeload.github.com/Lostovayne/Profanity-Api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245916742,"owners_count":20693400,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bun","cloudflare","honojs","typescript","upstash-vector"],"created_at":"2025-02-01T22:31:08.501Z","updated_at":"2025-10-07T21:06:11.442Z","avatar_url":"https://github.com/Lostovayne.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Profanity API\n\n![Build Status](https://img.shields.io/badge/build-passing-brightgreen)\n![License](https://img.shields.io/badge/license-MIT-blue)\n![Version](https://img.shields.io/badge/version-1.0.0-orange)\n![Technology](https://img.shields.io/badge/technology-Bun.js-blue)\n\n## Description\nThe Profanity API was created to provide an endpoint that can quickly and efficiently respond to words or phrases that are considered offensive or inappropriate. Its primary goal is to filter out content that could harm a healthy community, thereby cleaning up chats and fostering a more positive environment. By using this API, developers can help prevent toxic behavior and promote a healthier community.\n\nThis API utilizes a vector database for words and similarities, along with Langchain to handle contextual understanding. It offers an easy-to-use interface for integrating profanity detection into applications.\n\n## Table of Contents\n- [Installation](#installation)\n- [Usage](#usage)\n- [API Endpoints](#api-endpoints)\n- [Examples](#examples)\n- [Environment Variables](#environment-variables)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Installation\nTo install the Profanity API, follow these steps:\n\n1. Clone the repository:\n   ```bash\n   git clone https://github.com/Lostovayne/Profanity-Api.git\n   ```\n\n2. Navigate to the project directory:\n   ```bash\n   cd Profanity-Api\n   ```\n\n3. Install the dependencies using Bun:\n   ```bash\n   bun install\n   ```\n\n4. Create the vector database in Upstash.\n\n5. Seed the database with initial data:\n   ```bash\n   bun run seed.ts\n   ```\n\n## Usage\nTo use the Profanity API, you need to set up the server and make requests to the endpoints.\n\n### Starting the Server\nYou can run the server using:\n```bash\nbun index.ts\n```\nor using Wrangler:\n```bash\nbun wrangler dev index.ts\n```\n\n## API Endpoints\n| Endpoint       | Method | Description                     |\n|----------------|--------|---------------------------------|\n| `/`       | POST   | Check for profanity in text     |\n| `/`      | POST   | Filter profanity from text      |\n\n### Request Parameters\nFor both endpoints, the request body should be a JSON object containing the following parameter:\n\n- `text` (string): The text to check or filter for profanity.\n\n### Example Request\n#### Check for Profanity\n```bash\ncurl -X POST http://localhost:3000/ -d '{\"text\": \"Some text with profanity\"}'\n```\n\n\n### Response Format\nThe API will return a JSON response. Here’s an example response for the `/check` endpoint:\n\n```json\n{\n  \"isProfanity\": true,\n  \"score\": 0.95,\n  \"flaggedFor\": \"profanity word\"\n}\n```\n\n```\n\n## Environment Variables\nYou need to set the following environment variables in your `.env` file:\n\n- `VECTOR_URL`: The URL for your Upstash vector database.\n- `VECTOR_TOKEN`: The token for authenticating with your Upstash vector database.\n\nExample `.env` file:\n```plaintext\nVECTOR_URL=\"https://your-upstash-vector-url\"\nVECTOR_TOKEN=\"your-upstash-token\"\n```\n\n## Contributing\nContributions are welcome! Please follow these steps to contribute:\n\n1. Fork the repository.\n2. Create a new branch:\n   ```bash\n   git checkout -b feature/YourFeature\n   ```\n3. Commit your changes:\n   ```bash\n   git commit -m \"Add some feature\"\n   ```\n4. Push to the branch:\n   ```bash\n   git push origin feature/YourFeature\n   ```\n5. Open a pull request.\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostovayne%2Fprofanity-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flostovayne%2Fprofanity-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flostovayne%2Fprofanity-api/lists"}