TetherAI is a comprehensive shelter management platform that combines deep-learning architectures with AI-analyzed recommendations to optimize resource allocation, location, improvement of local shelter operations here in Toronto.
- Overview
- Features
- Detailed Functionality
- Tech Stack
- Architecture
- Installation
- Development Setup
- Deployment
- API Documentation
- Machine Learning Model
- Frontend Components
- Database Schema
- Environment Variables
- Troubleshooting
- Contributing
- License
TetherAI provides real-time shelter occupancy predictions and intelligent resource allocation recommendations. The platform uses historical data, weather patterns, and machine learning algorithms to predict shelter capacity needs and generate actionable insights for shelter managers.
- Precise, real-time shelter occupancy predictions
- AI-powered resource allocation recommendations
- Interactive dashboard with analytics
- User authentication and personalized shelter tracking
- Alert system for critical capacity issues
- Weather, qualitative trend, sector type, & geographic data integration for predictive modeling
- Intelligent Web-scraping for relevant user-services, radially optimized to nearest shelter
- Match Score System for User Need + Shelter Services Fit
- Real-time shelter statistics and metrics
- Critical alert monitoring
- Utilization rate tracking
- Historical data visualization
- Interactive grid and table views
- Intelligent resource allocation suggestions
- Capacity utilization analysis
- Action item generation
- Severity-based alerting system
- Personalized shelter management
- Secure authentication system
- Personalized shelter tracking
- User-specific alerts and notifications
- Role-based access control
- Historical shelter occupancy data
- Weather data correlation
- Real-time data processing
- Predictive modeling integration
Functionality: Secure user authentication and authorization
- Registration: Users can create accounts with email verification
- Login: JWT-based authentication with token refresh
- Session Management: Persistent login sessions with automatic token renewal
- Password Security: Bcrypt hashing with salt rounds
- Access Control: Role-based permissions for different user types
Functionality: Real-time data processing and visualization
- Data Aggregation: Collects shelter data from multiple sources
- Real-time Updates: Live data refresh every 30 seconds (configurable)
- Metric Calculation: Automatic computation of utilization rates, capacity percentages
- Trend Analysis: Historical data comparison and pattern recognition
- Alert Generation: Automatic alerts for critical capacity issues
Functionality: Machine learning-based occupancy forecasting
- Model Integration: TensorFlow/Keras neural network for predictions
- Data Preprocessing: Historical data cleaning and feature engineering
- Weather Correlation: Integration of weather data for improved accuracy
- Multi-horizon Forecasting: 7-day, 14-day, and 30-day predictions
- Confidence Intervals: Uncertainty quantification for predictions
Functionality: Intelligent resource allocation suggestions
- Capacity Analysis: Real-time capacity utilization assessment
- Resource Optimization: Staffing and supply recommendations
- Severity Classification: Critical, warning, and normal status categorization
- Action Items: Specific, actionable recommendations for shelter managers
- Priority Ranking: Recommendations sorted by urgency and impact
Functionality: Proactive notification and monitoring
- Threshold Monitoring: Automatic detection of capacity thresholds
- Escalation Logic: Progressive alert levels based on severity
- Notification Delivery: Email, in-app, and SMS notifications
- Alert Resolution: Tracking and management of alert status
- Custom Thresholds: User-configurable alert parameters
Components: Main analytics and control center
- Analytics Cards: Real-time metrics display with hover effects
- View Toggle: Grid and table view switching with smooth transitions
- Search & Filter: Advanced filtering by status, capacity, and location
- Sort Options: Multiple sorting criteria (name, utilization, capacity)
- Auto-refresh: Configurable automatic data refresh
- Keyboard Shortcuts: Ctrl+R (refresh), Ctrl+G/T (view toggle), Ctrl+F (search)
Components: Individual shelter tracking and management
- Shelter Cards: Detailed shelter information with status indicators
- Utilization Bars: Visual progress bars with animated fills
- Status Indicators: Color-coded status with icons (Critical, Warning, Normal)
- Add to Favorites: One-click shelter tracking for users
- Quick Actions: Rapid access to shelter-specific functions
Components: Intelligent suggestion display and interaction
- Recommendation Cards: Detailed AI suggestions with severity levels
- Action Items: Step-by-step implementation guidance
- Severity Badges: Visual severity indicators with color coding
- Interactive Elements: Clickable recommendations with detailed explanations
- Feedback System: User feedback collection for recommendation improvement
Components: Personal shelter tracking and preferences
- My Shelters: Personalized shelter list with custom notes
- Alert Preferences: Customizable notification settings
- Profile Settings: User account management and preferences
- Data Export: Export functionality for personal shelter data
Components: Comprehensive alert management
- Alert Dashboard: Overview of all active and resolved alerts
- Alert Details: Detailed information for each alert
- Resolution Tracking: Mark alerts as resolved with notes
- Alert History: Historical alert data and trends
- Filter Options: Filter alerts by type, severity, and date
Functionality: Centralized request handling and routing
- Request Validation: Input sanitization and validation
- Rate Limiting: API rate limiting to prevent abuse
- CORS Management: Cross-origin resource sharing configuration
- Error Handling: Comprehensive error handling and logging
- Response Formatting: Standardized API response format
Functionality: Real-time data processing and transformation
- Data Validation: Input data validation and cleaning
- Aggregation: Data aggregation from multiple sources
- Transformation: Data format conversion and normalization
- Caching: Intelligent caching for improved performance
- Real-time Updates: WebSocket connections for live updates
Functionality: Automated ML model management and inference
- Model Loading: Dynamic model loading and versioning
- Preprocessing: Real-time data preprocessing for predictions
- Inference Engine: Fast prediction generation
- Model Monitoring: Performance tracking and model health
- Auto-retraining: Automated model retraining with new data
Functionality: Comprehensive data persistence and retrieval
- CRUD Operations: Complete create, read, update, delete operations
- Query Optimization: Optimized database queries for performance
- Data Relationships: Complex data relationships and joins
- Backup Management: Automated database backup and recovery
- Migration System: Database schema migration management
Functionality: Comprehensive security implementation
- Authentication: JWT-based user authentication
- Authorization: Role-based access control
- Input Sanitization: SQL injection and XSS prevention
- Rate Limiting: API abuse prevention
- Audit Logging: Comprehensive security audit trails
Functionality: Live data processing and visualization
- WebSocket Integration: Real-time data streaming
- Live Updates: Automatic UI updates without page refresh
- Performance Metrics: Real-time performance monitoring
- User Activity Tracking: Anonymous usage analytics
- System Health Monitoring: Application health and status
Functionality: Advanced forecasting and trend analysis
- Time Series Analysis: Historical pattern recognition
- Seasonal Decomposition: Seasonal trend identification
- Anomaly Detection: Unusual pattern detection
- Confidence Intervals: Prediction uncertainty quantification
- Model Ensemble: Multiple model combination for accuracy
Functionality: Multi-source data aggregation
- API Integration: External API data fetching
- Data Synchronization: Real-time data synchronization
- Format Conversion: Multiple data format support
- Error Recovery: Robust error handling and recovery
- Data Quality: Automated data quality assessment
Functionality: System performance and scalability
- Caching Strategy: Multi-level caching implementation
- Database Optimization: Query optimization and indexing
- CDN Integration: Static asset delivery optimization
- Load Balancing: Request distribution and load management
- Resource Monitoring: System resource usage tracking
Functionality: Enhanced user interaction and accessibility
- Responsive Design: Mobile-first responsive layout
- Accessibility: WCAG compliance and screen reader support
- Keyboard Navigation: Full keyboard accessibility
- Loading States: Comprehensive loading and error states
- Progressive Enhancement: Graceful degradation for older browsers
- Weather Data: Integration with weather APIs for correlation
- Geocoding Services: Address to coordinate conversion
- Notification Services: Email and SMS notification integration
- Analytics Platforms: Google Analytics and custom analytics
- Monitoring Tools: Application performance monitoring
- CSV Export: Data export in CSV format
- JSON API: RESTful API for data access
- Bulk Operations: Batch data processing capabilities
- Data Validation: Import data validation and cleaning
- Format Support: Multiple data format support
- Authentication Providers: OAuth integration options
- Payment Processing: Payment gateway integration
- Communication Tools: Slack and email integration
- Reporting Tools: Advanced reporting and analytics
- Backup Services: Cloud backup and storage integration
- Node.js - Runtime environment
- Express.js - Web application framework
- MongoDB - NoSQL database
- Mongoose - MongoDB object modeling
- JWT - Authentication tokens
- Python - Machine learning model integration
- TensorFlow/Keras - Neural network models
- Pandas - Data processing
- NumPy - Numerical computations
- React.js - User interface library
- JavaScript (ES6+) - Modern JavaScript features
- CSS3 - Advanced styling with animations
- HTML5 - Semantic markup
- Context API - State management
- Fetch API - HTTP requests
- Render - Cloud hosting platform
- Git - Version control
- npm - Package management
- Shell scripts - Build automation
- CSV/JSON - Data formats
- Geocoding APIs - Location services
- Weather APIs - Environmental data
- Machine Learning Models - Predictive analytics
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ Frontend │ │ Backend │ │ ML Pipeline │
│ (React.js) │◄──►│ (Node.js) │◄──►│ (Python) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
│ │ │
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
│ User Browser │ │ MongoDB │ │ Data Storage │
│ │ │ Database │ │ (CSV/JSON) │
└─────────────────┘ └─────────────────┘ └─────────────────┘
- Frontend: React components with modern UI/UX
- Backend: RESTful API with Express.js
- Database: MongoDB with Mongoose ODM
- ML Pipeline: Python-based prediction models
- Deployment: Render cloud platform
- Node.js (v16 or higher)
- Python (v3.8 or higher)
- MongoDB (local or cloud instance)
- Git
# Clone the repository
git clone https://github.com/yourusername/tetherai.git
cd tetherai
# Install dependencies
npm install
cd frontend && npm install
cd ../backend && npm install
# Set up Python environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
# Start development servers
npm run devcd backend
npm install
npm run devcd frontend
npm install
npm start# Install MongoDB locally or use MongoDB Atlas
# Update connection string in backend/.envCreate .env files in both frontend and backend directories:
Backend (.env)
MONGODB_URI=mongodb://localhost:27017/tetherai
JWT_SECRET=your_jwt_secret_here
PORT=5000
NODE_ENV=development
Frontend (.env)
REACT_APP_API_URL=http://localhost:5000
REACT_APP_ENV=development
The application is configured for deployment on Render with the following services:
- Web Service - Main application
- Background Worker - ML model processing
- Database - MongoDB instance
# Build script execution
./build.sh
# Clear cache if needed
./clear-cache.shMONGODB_URI=your_production_mongodb_uri
JWT_SECRET=your_production_jwt_secret
NODE_ENV=production
PORT=10000
POST /api/auth/register - User registration
POST /api/auth/login - User authentication
GET /api/auth/verify - Token verification
GET /api/predictions - Get shelter predictions
GET /api/shelter-locations - Get shelter locations
POST /api/user-shelters - Add shelter to user list
GET /api/user-shelters - Get user's shelters
GET /api/recommendations - Get AI recommendations
POST /api/alerts - Create new alert
GET /api/alerts - Get user alerts
{
"success": true,
"data": {},
"message": "Operation completed successfully"
}- Type: Neural Network (LSTM/GRU)
- Framework: TensorFlow/Keras
- Input Features: Historical occupancy, weather data, time series
- Output: Predicted shelter occupancy
cd backend/ML-LLM-hybrid-recommendation-system
python modelling.pycd backend/ML-LLM-hybrid-recommendation-system/Preprocessing
python preprocess.pymodel.h5- Trained neural network modelrecommendation.json- ML-based recommendationsrecommendation_llm.json- LLM-enhanced recommendations
- DashboardTabs - Main navigation and layout
- DashboardContent - Analytics and predictions display
- RecommendationsContent - AI recommendations interface
- YourSheltersContent - User's tracked shelters
- AlertsContent - Alert management system
- LoadingSpinner - Multiple loading animation types
- Toast - Notification system
- Map - Interactive shelter location display
- Heatmap - Data visualization component
- Modern CSS with glassmorphism effects
- Responsive design for all screen sizes
- Advanced animations and transitions
- Accessibility-compliant interface
{
username: String,
email: String,
password: String (hashed),
createdAt: Date,
updatedAt: Date
}{
name: String,
address: String,
capacity: Number,
currentOccupancy: Number,
coordinates: {
latitude: Number,
longitude: Number
}
}{
userId: ObjectId,
shelterId: ObjectId,
type: String,
severity: String,
message: String,
createdAt: Date,
resolved: Boolean
}{
userId: ObjectId,
shelterName: String,
address: String,
capacity: Number,
addedAt: Date
}MONGODB_URI - MongoDB connection string
JWT_SECRET - Secret key for JWT tokens
NODE_ENV - Environment (development/production)
PORT - Server port number
CORS_ORIGIN - Allowed CORS origins
LOG_LEVEL - Application logging level
API_RATE_LIMIT - Rate limiting configuration
Frontend Build Errors
# Clear node_modules and reinstall
rm -rf node_modules package-lock.json
npm installBackend Connection Issues
# Check MongoDB connection
mongo --eval "db.runCommand('ping')"ML Model Loading Errors
# Verify Python dependencies
pip install -r requirements.txt
python -c "import tensorflow as tf; print(tf.__version__)"Deployment Issues
# Clear Render cache
./clear-cache.sh
# Rebuild application
./build.sh# Enable debug logging
DEBUG=* npm run dev- Enable gzip compression
- Implement caching strategies
- Optimize database queries
- Use CDN for static assets
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
- Use ESLint for JavaScript linting
- Follow React best practices
- Maintain consistent code formatting
- Write meaningful commit messages
# Run frontend tests
cd frontend && npm test
# Run backend tests
cd backend && npm testThis project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Check the troubleshooting section
- Review the API documentation
- Contact the development team
- Complete UI/UX redesign with modern styling
- Enhanced dashboard with analytics
- Improved AI recommendations system
- Added keyboard shortcuts and QoL features
- Implemented auto-refresh functionality
- Initial release with basic functionality
- Shelter prediction system
- User authentication
- Basic dashboard interface