This project is a secure chat application built using JavaScript, React, HTML, CSS, and Node.js. The application includes real-time messaging, user authentication, and a content moderation system that ensures the safety of messages and images using AI-based checks. This project was developed as part of the QueenB X AppsFlyer - BeSafe Hackathon 2025.
- Socket.io Integration: Real-time communication between users is facilitated through
socket.io, ensuring instant message delivery and updates. - Conversation Management: Users can maintain multiple conversations, and messages are sorted based on the latest interaction.
- AI-Based Safety Checks: Messages and images are checked for inappropriate content using OpenAI's API and Google Cloud Vision.
- Text Content Safety: The
checkContentSafetyfunction analyzes text messages for offensive or harmful content. Messages deemed unsafe are flagged. - Image Content Safety: Uploaded images are analyzed for nudity or inappropriate content using Google Cloud Vision and OpenAI's moderation tools. Images related to swimsuits or beach scenes are also flagged.
- Fallback Mechanism: If a user chooses to ignore the content warning, the message is sent to a trusted adult's email address, provided during the sign-up process.
- Multer for File Handling: The application uses
multerfor handling file uploads, storing them securely in a designated directory.
- Nodemailer for Email Alerts: If a user ignores a content warning, an email notification is sent to a trusted adult with details of the flagged content.
- JWT Authentication: Secure user authentication using JSON Web Tokens (JWT) for session management.
- Registration and Login: Users can register and log in with secure password hashing using
bcryptjs.
- Node.js
- Version 20.x or higher required (latest LTS recommended)
- npm
- Version 10.x or higher required (get the latest by running
npm install -g npm@latest --no-optional)
- Version 10.x or higher required (get the latest by running
To get started with this project, you need to clone the repository to your local machine:
git clone (https://github.com/RomiPolaczek/BeSafeHackathon2025.git)- Navigate to the server directory:
cd server - Install server dependencies:
npm install
- Navigate to the client directory:
cd ../client - Install client dependencies:
npm install
- Create a
.envfile in the root directory. - Add the following variables:
OPENAI_API_KEY=your_openai_api_key GOOGLE_APPLICATION_CREDENTIALS=path_to_your_google_credentials.json
- Register or log in to access the chat application.
- Start a conversation with any registered user.
- Upload images or send text messages, which will be automatically checked for safety.
- Frontend: React, HTML, CSS
- Backend: Node.js, Express, Socket.io
- Database: Not yet implemented (planned for future versions)
- File Handling: Multer
- AI Content Moderation: OpenAI API, Google Cloud Vision
- Email Notifications: Nodemailer