Сontent moderation API built with Node.js, TypeScript, and Express.
Warning
This project is unfinished, but I'm trying to finish it as soon as possible.
- Text moderation with customizable profanity lists
- Sentiment analysis
- Spam detection
- NSFW image detection
- API key authentication
- Rate limiting
- Request logging
- Caching with Redis
- Batch processing support
- Clone the repository
- Install dependencies:
npm install
- Copy
.env.example
to.env
and configure variables - Start Redis server
- Run development server:
npm run dev
- Run tests:
npm test
Moderates text content for profanity, sentiment, and spam.
curl -X POST http://localhost:3000/api/v1/moderate/text \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"text": "Hello world"}'
Analyzes images for NSFW content.
curl -X POST http://localhost:3000/api/v1/moderate/image \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"image": "base64_encoded_image"}'
Process multiple items in a single request.
curl -X POST http://localhost:3000/api/v1/moderate/batch \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{"items": [{"type": "text", "content": "Hello"}, {"type": "image", "content": "base64_image"}]}'
- Build the project:
npm run build
- Set environment variables
- Ensure Redis is available
- Start the server:
npm start