SafSoc is an intelligent message safety analysis platform built with React and Express.js that leverages OpenAI's API to evaluate message content for safety concerns in real-time. The platform provides immediate feedback on potentially unsafe content, helping users maintain respectful and secure communication.
Untitled.mov
Untitled.4.mov
- Real-time Message Analysis: Instant evaluation of message safety using OpenAI's advanced AI models
- Smart Feedback System: Contextual warnings with detailed explanations and improvement suggestions
- Visual Alerts: Red popups for unsafe messages with clear explanations
- Suggestion System: Provides constructive feedback for improving message safety
- Simple Interface: Clean, intuitive design for message input and feedback
- Instant Feedback: Real-time safety analysis as you type
- Message History: View current session message history
- Clear Chat: Option to clear chat history
- Universal Compatibility: Works across all major websites (at present it works only on X,LinkedIn,Safsoc)
- Context-aware Analysis: Considers website context when evaluating messages
- Seamless Integration: Works naturally with existing website interfaces
- Detection: It detects the text if we click on enter from keyboard
The diagram above illustrates the basic workflow of SafSoc:
- User enters a message
- Message is sent to the backend
- OpenAI API analyzes the message content
- If safe, no red message is displayed
- If unsafe, a red warning popup appears with feedback and suggestions
- Modern React with Hooks
- Tailwind CSS for responsive design
- ShadcnUI components for consistent UI
- Aceternity UI for certain components
- RESTful API architecture
- OpenAI integration
- Message safety analysis
- Error handling middleware
- Node.js (v14 or higher)
- npm or yarn
- OpenAI API key
- Modern web browser- Clone the Repository
git clone https://github.com/prudh-vi/safsoc.git
cd safsoc- Install Dependencies
# Install frontend dependencies
npm install- Start Development Server
# Start frontend
npm run dev- Open Chrome/Firefox
- Navigate to Extensions
- Enable Developer Mode
- Load unpacked extension from
/extensiondirectory or click on Extension Source
POST /api/messages
Body: {
message: string,
user: string
}
Response: {
message: string,
safetyAnalysis: "SAFE" | string
}GET /api/messages
Query: {
lastMessageId: number
}
Response: {
messages: Array<{
message: string,
user: string,
timestamp: number
}>,
lastMessageId: number
}DELETE /api/messages/clear
Response: {
success: boolean
}- Input Sanitization: Protection against harmful content
- Content Analysis: Real-time safety evaluation
- Warning System: Clear visual feedback for unsafe content
- Improvement Suggestions: Helpful tips for content improvement
The application implements comprehensive error handling:
- Network connectivity issues
- API rate limiting
- Server errors
- Safety check failures
