Run FeeLink (choose one option)
Here are some example screenshots of FeeLink in action:
python3 start_simple.py
python3 start_feelink.pyLink** is a peer-to-peer messaging platform that combines real-time emotion detection and personalized wellness recommendations. Built for emergency scenarios where traditional communication infrastructure may be compromised.
- π§ Rule-based Emotion Classification - Keyword matching for emotion detection
- π± Comprehensive Mood Advisor - 700+ wellness recommendations across all emotions
- π Real-time Analytics Dashboard - Track communication patterns and emotional health
- πΌοΈ Smart Image Compression - OpenCV-powered optimization for faster P2P transfers
- οΏ½ Message Summarization - Condenses long messages while preserving meaning
- π True P2P Communication - Direct peer-to-peer messaging without servers
- π¨ Futuristic UI - Glass morphism design with neon accents and smooth animations
FeeLink combines P2P messaging with emotion-aware wellness recommendations using simple but effective rule-based classification and TF-IDF summarization.
Required Software:
- Python 3.8+
- Node.js 14+ (optional, for frontend development)
- Git
# 1. Clone the repository
git clone https://github.com/your-username/feelink.git
cd feelink
# 2. Create Python virtual environment
python -m venv venv
.\venv\Scripts\activate
# 3. Install Python dependencies
pip install flask opencv-python scikit-learn flask-cors
# 4. Run FeeLink (choose one option)
# Option 1: Simple & Reliable (Recommended)
python start_simple.py
# Option 2: Full Featured (with dependency checking)
python start_feelink.py
# Option 3: Double-click for Windows users
# Just double-click: start_feelink.bat# 1. Clone the repository
git clone https://github.com/5quidL0rd/OSCMiniHack.git
cd OSCMiniHack
# 2. Create and activate a Python virtual environment
python3 -m venv venv
source venv/bin/activate
# 3. Install Python dependencies individually
pip install -r backend/requirements.txt
pip install flask
pip install flask-cors
pip install numpy
pip install scikit-learn
pip install opencv-python
# 4. Install Node.js frontend dependencies
cd frontend
npm install --legacy-peer-deps
cd ..
# 5. Run FeeLink
python3 start_simple.py
- Start the server using the commands above
- Open your browser and go to:
http://localhost:5000 - Begin chatting - Your unique P2P ID will be generated automatically
- Connect with friends by sharing your ID or entering theirs
FeeLink provides multiple startup options for maximum convenience:
The most reliable way to start FeeLink - just works every time!
python start_simple.pyFeatures:
- β No dependency checking - just starts the backend
- β Works on all operating systems
- β Serves frontend at http://localhost:5000
- β Perfect for development and demos
Advanced startup with smart dependency detection:
python start_feelink.pyFeatures:
- π Checks Python and Node.js dependencies
- π Starts Flask backend (always)
- βοΈ Starts frontend dev server (if Node.js available)
- π Provides detailed startup status
- π Multiple access URLs
For Windows users who prefer GUI interaction:
- Just double-click the
start_feelink.batfile - Opens a terminal window with startup progress
- Uses the simple script internally for reliability
Traditional PowerShell/Bash scripts for advanced users:
- Windows:
.\scripts\start_all.ps1 - Linux/Mac:
./scripts/start_all.sh
FeeLink uses a hybrid architecture combining a lightweight Flask backend for emotion processing with client-side P2P communication.
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
β Web Browser β β Flask Backend β β Web Browser β
β β β β β β
β βββββββββββββ β β βββββββββββββββ β β βββββββββββββ β
β β PeerJS ββββΌβββββΌβββ€ AI Engine β β β β PeerJS β β
β β P2P Conn β β β β β β β β P2P Conn β β
β βββββββββββββ β β β β’ Classifierβ β β βββββββββββββ β
β β β β β’ Rewriter β β β β
β βββββββββββββ β β β β’ Advisor β β β βββββββββββββ β
β β UI ββββΌβββββΌβββ€ β’ Analytics β β β β UI β β
β β Futuristicβ β β β β’ Compressorβ β β β Futuristicβ β
β βββββββββββββ β β βββββββββββββββ β β βββββββββββββ β
βββββββββββββββββββ ββββββββββββββββββββ βββββββββββββββββββ
User A Server (AI Only) User B
Technology: Simple keyword dictionary matching
Implementation:
# From classifier.py
def classify_text(text: str) -> Tuple[str, float, List[str]]:
"""Classify text using keyword matching."""
text_lower = text.lower()
emotion_scores = {}
matched_keywords = []
# Check each emotion dictionary
for emotion, keywords in EMOTION_KEYWORDS.items():
matches = [kw for kw in keywords if kw in text_lower]
if matches:
emotion_scores[emotion] = len(matches) / len(text.split())
matched_keywords.extend(matches)
# Return highest scoring emotion
if emotion_scores:
best_emotion = max(emotion_scores, key=emotion_scores.get)
confidence = min(emotion_scores[best_emotion] * 2, 1.0)
return best_emotion, confidence, matched_keywords
return 'normal', 0.5, []Keyword Database:
EMOTION_KEYWORDS = {
'happy': {"happy", "joy", "excited", "great", "awesome", "π", "π", "π"},
'sad': {"sad", "depressed", "crying", "tears", "π’", "π", "π"},
'angry': {"angry", "mad", "furious", "rage", "hate", "π ", "π‘", "π€¬"},
'scared': {"scared", "afraid", "terrified", "worried", "π¨", "π°", "π±"}
}Technology: TF-IDF based extractive summarization
Implementation:
# From summarizer.py
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.pairwise import cosine_similarity
class ExtractiveSummarizer:
def summarize(self, text: str, max_sentences: int = 2) -> str:
sentences = self._split_sentences(text)
if len(sentences) <= max_sentences:
return text
# Calculate TF-IDF scores
vectorizer = TfidfVectorizer(stop_words='english')
tfidf_matrix = vectorizer.fit_transform(sentences)
# Calculate sentence scores
sentence_scores = np.array(tfidf_matrix.sum(axis=1)).flatten()
# Select top sentences
top_indices = sentence_scores.argsort()[-max_sentences:][::-1]
top_indices.sort() # Maintain original order
return ' '.join([sentences[i] for i in top_indices])Implementation: Static dictionary lookup with randomized selection
Database Structure:
# From mood_advisor.py - 700+ tips across all emotions
MOOD_ADVICE = {
'angry': {
'immediate': [
"Take 5 deep breaths - inhale for 4, hold for 4, exhale for 6",
"Step away from the screen for 2 minutes and look out a window",
"Drink a full glass of cold water slowly",
"Do 10 jumping jacks or push-ups to release tension",
# ... 50+ more immediate tips
],
'daily_habits': [
"Get 7-8 hours of quality sleep - anger often stems from tiredness",
"Stay hydrated - drink at least 8 glasses of water daily",
"Exercise for 20+ minutes to release built-up stress hormones",
# ... 40+ more daily habits
],
'communication': [
"Use 'I feel...' statements instead of 'You always...'",
"Take a 24-hour pause before responding to frustrating messages",
# ... 30+ more communication tips
]
},
'sad': { /* 100+ tips */ },
'scared': { /* 100+ tips */ },
'happy': { /* 100+ tips */ },
'normal': { /* 100+ tips */ }
}
def get_mood_advice(emotion: str, confidence: float) -> Dict:
"""Return 2-3 random tips from each category."""
advice = MOOD_ADVICE.get(emotion, MOOD_ADVICE['normal'])
return {
'immediate': random.sample(advice['immediate'], min(3, len(advice['immediate']))),
'habits': random.sample(advice['daily_habits'], min(2, len(advice['daily_habits']))),
'communication': random.sample(advice['communication'], min(2, len(advice['communication'])))
}Location of 700+ Tips: All wellness recommendations are hardcoded in backend/python-ai/mood_advisor.py lines 8-140, organized by emotion type with immediate actions, daily habits, and communication strategies.
In-Memory Storage:
# From analytics.py
class EmotionAnalytics:
def __init__(self):
# Simple list storage: {user_id: [emotion_data, ...]}
self.emotion_data = defaultdict(list)
def log_emotion(self, user_id: str, emotion: str, confidence: float):
"""Store emotion data with timestamp."""
self.emotion_data[user_id].append({
'timestamp': datetime.now(),
'emotion': emotion,
'confidence': confidence
})
def get_emotion_trends(self, user_id: str, days: int = 1):
"""Calculate percentage breakdown of emotions."""
recent_data = [entry for entry in self.emotion_data[user_id]
if entry['timestamp'] > datetime.now() - timedelta(days=days)]
emotions = [entry['emotion'] for entry in recent_data]
return {emotion: round((emotions.count(emotion) / len(emotions)) * 100, 1)
for emotion in set(emotions)} if emotions else {}Technology: OpenCV with fixed compression settings
Implementation:
# From compressor.py
import cv2
def compress_image(image_bytes, quality=70):
"""Basic JPEG compression using OpenCV."""
# Convert bytes to numpy array
nparr = np.frombuffer(image_bytes, np.uint8)
img = cv2.imdecode(nparr, cv2.IMREAD_COLOR)
# Compress with fixed quality setting
encode_param = [int(cv2.IMWRITE_JPEG_QUALITY), quality]
result, compressed_img = cv2.imencode('.jpg', img, encode_param)
return compressed_img.tobytes()Results: Typically 60-80% size reduction with quality=70 setting
Implementation:
// Frontend P2P connection using PeerJS
class AIChat {
constructor() {
this.peer = new Peer(this.generateId());
this.connection = null;
}
connect() {
const friendId = document.getElementById('friendId').value;
this.connection = this.peer.connect(friendId);
this.setupConnection(this.connection);
}
async sendMessage() {
// Process message through Flask API first
const analysis = await this.analyzeMessage();
// Send processed data via P2P
this.connection.send({
text: analysis.summary,
emotion: analysis.classification,
timestamp: new Date().toLocaleTimeString()
});
}
}Message Flow:
- User types message β Flask API processes β Classification + Summarization
- Processed message sent directly peer-to-peer via WebRTC
- Both users see summarized message + emotion tags
- Analytics updated in browser memory
CSS Technologies:
- Glass Morphism:
backdrop-filter: blur(20px)with translucent backgrounds - CSS Grid: Responsive three-column layout
- CSS Animations: Smooth transitions and hover effects
- Custom Properties: CSS variables for consistent theming
Design Features:
- Neon Color Palette: Blue (#00d4ff), Purple (#b19cd9), Pink (#ff006e)
- Gradient Backgrounds: Multi-layered radial gradients
- Interactive Elements: Hover animations, loading states, smooth scrolling
- Mobile-First: Responsive design for all screen sizes
feelink/
βββ backend/
β βββ python-ai/ # Main Flask application
β β βββ app.py # Flask server with API endpoints
β β βββ classifier.py # Emotion classification engine
β β βββ tone_rewriter.py # Message tone transformation
β β βββ mood_advisor.py # Wellness recommendation system
β β βββ analytics.py # Real-time emotion analytics
β β βββ summarizer.py # Message summarization
β β βββ compressor.py # Image compression utilities
β β βββ static/
β β βββ index.html # Frontend UI (futuristic design)
β βββ cpp-mesh/ # Future: C++ mesh networking
β βββ rust-alt/ # Future: Rust alternative backend
βββ frontend/ # Development frontend (optional)
βββ docs/ # Documentation and presentations
βββ scripts/ # Utility scripts
| Endpoint | Method | Purpose | Input | Output |
|---|---|---|---|---|
/api/classify |
POST | Emotion classification | {text, user_id} |
{label, score, matched, rewrite_suggestions} |
| /api/summarize | POST | Message summarization | {text} | {summary, sentences} |
| /api/compress | POST | Image compression | FormData(image) | Compressed image blob |
| /api/mood-advice | POST | Wellness recommendations | {emotion, confidence, user_id} | {advice: {immediate, habits, insights}} |
| /api/analytics | GET | Emotion analytics | ?user_id=X&days=N | {emotion_breakdown, insights, total_messages} |
# Classify emotion
response = requests.post('/api/classify', json={
'text': 'I am so frustrated with this project!',
'user_id': 'user_123'
})
# Returns: {"label": "angry", "score": 0.85, "matched": ["frustrated"]}
# Get mood advice
response = requests.post('/api/mood-advice', json={
'emotion': 'angry',
'confidence': 0.85,
'user_id': 'user_123'
})
# Returns comprehensive wellness suggestions-
Emotion Classification Test:
Happy: "I'm so excited about this!" Sad: "I feel really depressed today" Angry: "This is so frustrating!" Scared: "I'm terrified about the presentation" Normal: "Let's meet at 3pm" -
Tone Transformation Test:
- Input negative message β Select tone β Verify improved output
-
P2P Connection Test:
- Open two browser tabs β Share IDs β Send messages
-
Analytics Test:
- Send multiple messages with different emotions
- Check analytics panel for updated charts
# Enable Flask debug mode (auto-reload on changes)
export FLASK_DEBUG=1 # Linux/Mac
set FLASK_DEBUG=1 # Windows CMD
# Run with verbose logging
python backend/python-ai/app.py --debugFROM python:3.9-slim
WORKDIR /app
COPY backend/python-ai/ .
RUN pip install flask opencv-python scikit-learn flask-cors
EXPOSE 5000
CMD ["python", "app.py"]- Heroku: Simple web app deployment
- AWS EC2: Full server control
- Google Cloud Run: Serverless container deployment
- DigitalOcean App Platform: Managed hosting
# Production configuration
FLASK_ENV=production
FLASK_DEBUG=0
PORT=5000
HOST=0.0.0.0- Fork the repository
- Create feature branch:
git checkout -b feature/amazing-feature - Make changes and test thoroughly
- Commit:
git commit -m 'Add amazing feature' - Push:
git push origin feature/amazing-feature - Create Pull Request
- Python: Follow PEP 8 guidelines
- JavaScript: Use modern ES6+ syntax
- CSS: Use consistent naming conventions
- Comments: Document complex algorithms and AI logic
This project is licensed under the MIT License - see the LICENSE file for details.
Built for emergency communication scenarios with simple but effective emotion-aware messaging and wellness recommendations.
"ModuleNotFoundError: No module named 'cv2'"
pip install opencv-python"Port 5000 already in use"
# Kill existing process
taskkill /f /im python.exe # Windows
pkill -f python # Linux/Mac"PeerJS connection failed"
- Check browser console for WebRTC errors
- Ensure both users are on same network or use STUN servers
- Try refreshing both browser tabs
"Emotion classification not working"
- Verify all Python dependencies installed
- Check Flask logs for import errors
- Test classifier independently:
python -c "from classifier import classify_text; print(classify_text('test'))"
- Memory Usage: Analytics system keeps last 1000 entries per user
- CPU Usage: Classification is lightweight (simple keyword matching)
- Network: Images compressed 60-80% for faster P2P transfer
- Browser: Tested on Chrome, Firefox, Safari, Edge
For questions, issues, or collaboration opportunities:
- GitHub Issues: Create an issue
- Email: your-email@domain.com
- Discord: YourDiscord#1234
FeeLink: Where Emergency Communication Meets Emotional Intelligence πβ¨


