A modern slot-based platform connecting university students for collaborative activities, powered by real-time communication and AI-driven content moderation.
UniSlot is a comprehensive platform designed to enhance university life by enabling students to create and join time-bound activity slots. Whether forming project teams, organizing sports activities, arranging ride-shares, or creating study groups, UniSlot facilitates meaningful connections through an intuitive interface and intelligent moderation.
- Secure Authentication: Firebase phone OTP verification
- Real-time Communication: Socket.IO powered instant messaging
- AI Moderation: Hugging Face-powered profanity detection
- Admin Dashboard: Comprehensive monitoring and analytics
- Responsive Design: Seamless experience across all devices
- 10 Activity Categories
- Project Teams - Collaborate on academic projects
- Sports - Organize athletic activities
- Ride Share - Coordinate cost-effective transportation
- Study Groups - Form exam preparation sessions
- Social Hangout - Casual meetups and networking
- Music & Arts - Creative collaborations
- Food & Dining - Group meals and food events
- Gaming - Gaming sessions and tournaments
- Photography - Photo walks and projects
- Volunteering - Community service initiatives
- Real-time Chat: Instant messaging within activity slots
- Smart Moderation: AI-powered content filtering with confidence scoring
- Message Tracking: Complete audit trail of all communications
- Participant Management: Dynamic slot capacity and member tracking
- Search & Filter: Efficient discovery of relevant activities
- Admin Analytics: Comprehensive moderation statistics and insights
- Node.js 14.x or higher
- npm or yarn
- Firebase account
- Hugging Face API key (free tier available)
- Clone the repository
git clone https://github.com/Dhuvie/unislot.git
cd unislot- Install dependencies
# Install backend dependencies
npm install
# Install frontend dependencies
cd client
npm install
cd ..- Configure Firebase
Create a Firebase project at console.firebase.google.com
Backend Configuration:
- Go to Project Settings → Service Accounts
- Generate new private key
- Create
.envin root directory:
PORT=5000
JWT_SECRET=your_secure_random_string
# Firebase Admin SDK
FIREBASE_PROJECT_ID=your_project_id
FIREBASE_PRIVATE_KEY="your_private_key"
FIREBASE_CLIENT_EMAIL=your_service_account_email
# Hugging Face API
HUGGINGFACE_API_KEY=hf_your_api_keyFrontend Configuration:
- Go to Project Settings → General
- Add web app and copy config
- Create
client/.env:
REACT_APP_FIREBASE_API_KEY=your_api_key
REACT_APP_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com
REACT_APP_FIREBASE_PROJECT_ID=your_project_id
REACT_APP_FIREBASE_STORAGE_BUCKET=your_project.appspot.com
REACT_APP_FIREBASE_MESSAGING_SENDER_ID=your_sender_id
REACT_APP_FIREBASE_APP_ID=your_app_id- Set up Firebase services
Enable the following in Firebase Console:
- Authentication → Phone (Sign-in method)
- Firestore Database (Start in test mode for development)
Create Firestore indexes:
Collection: slots
- category (Ascending), createdAt (Descending)
- status (Ascending), createdAt (Descending)
Collection: messages
- slotId (Ascending), timestamp (Ascending)
- moderation.isProfane (Ascending), timestamp (Descending)
Collection: flaggedMessages
- slotId (Ascending), timestamp (Descending)
- Get Hugging Face API Key
- Sign up at huggingface.co
- Go to Settings → Access Tokens
- Create new token with read permissions
Development Mode:
npm run devThis starts:
- Backend server:
http://localhost:5000 - Frontend app:
http://localhost:3000
Production Build:
cd client
npm run buildunislot/
├── server/ # Backend application
│ ├── config/ # Configuration files
│ │ └── firebase.js # Firebase Admin initialization
│ ├── routes/ # API endpoints
│ │ ├── auth.js # Authentication routes
│ │ ├── slots.js # Slot management
│ │ ├── chat.js # Chat messages
│ │ ├── users.js # User profiles
│ │ └── admin.js # Admin endpoints
│ ├── services/ # Business logic
│ │ └── profanityDetection.js # AI moderation
│ └── index.js # Server entry point
├── client/ # Frontend application
│ ├── public/ # Static assets
│ └── src/
│ ├── components/ # React components
│ │ ├── PhoneAuth.js # Authentication
│ │ ├── Dashboard.js # Main dashboard
│ │ ├── CreateSlot.js # Slot creation
│ │ ├── SlotDetails.js # Slot view & chat
│ │ ├── Navbar.js # Navigation
│ │ └── Admin.js # Admin dashboard
│ ├── config/ # Configuration
│ │ └── firebase.js # Firebase client config
│ ├── App.js # Main app component
│ └── index.js # Entry point
├── package.json # Backend dependencies
└── README.md # This file
POST /api/auth/verify-phone # Verify phone OTP and create/login user
GET /api/auth/profile/:uid # Get user profile
PUT /api/auth/profile/:uid # Update user profile
GET /api/slots # Get all slots (with filters)
GET /api/slots/:id # Get specific slot
POST /api/slots # Create new slot
POST /api/slots/:id/join # Join a slot
POST /api/slots/:id/leave # Leave a slot
DELETE /api/slots/:id # Delete a slot
GET /api/chat/:slotId # Get messages for a slot
POST /api/chat/:slotId # Save a message
GET /api/admin/messages # Get all messages with moderation info
GET /api/admin/flagged-messages # Get flagged messages
GET /api/admin/stats # Get moderation statistics
DELETE /api/admin/flagged-messages/:id # Delete flagged message
join-slot # Join a slot's chat room
send-message # Send a chat message
receive-message # Receive a chat message
message-moderated # Receive moderation feedback
users/
{
id: string,
phoneNumber: string,
username: string,
university: string,
major: string,
createdAt: timestamp
}slots/
{
title: string,
description: string,
category: string,
maxParticipants: number,
currentParticipants: number,
participants: [{id, name, joinedAt}],
location: string,
dateTime: timestamp,
creatorId: string,
creatorName: string,
tags: [string],
requirements: [string],
status: 'open' | 'full',
createdAt: timestamp
}messages/
{
slotId: string,
message: string,
userId: string,
username: string,
timestamp: timestamp,
moderation: {
isProfane: boolean,
confidence: number,
checkedBy: 'huggingface' | 'rule-based',
checkedAt: timestamp
}
}flaggedMessages/
{
slotId: string,
originalMessage: string,
userId: string,
username: string,
timestamp: timestamp,
moderation: {
isProfane: true,
confidence: number,
suggestion: string,
checkedBy: 'huggingface' | 'rule-based',
checkedAt: timestamp
}
}- Runtime: Node.js
- Framework: Express.js
- Real-time: Socket.IO
- Authentication: Firebase Admin SDK, JWT
- Database: Cloud Firestore
- AI/ML: Hugging Face Inference API
- Framework: React 18
- Routing: React Router v6
- HTTP Client: Axios
- Real-time: Socket.IO Client
- Icons: Lucide React
- Date Handling: date-fns
- Styling: Pure CSS with CSS Variables
- Model: parsawar/profanity_model_3.1 (Hugging Face)
- Fallback: Rule-based detection system
- Features: Confidence scoring, real-time moderation
- Phone number verification via Firebase
- JWT token-based API authentication
- Environment variable protection
- Firestore security rules (configure for production)
- Input validation and sanitization
- XSS prevention through React
- CORS configuration
Access the admin dashboard at /admin (available from login page)
Features:
- Real-time moderation statistics
- View all messages with confidence scores
- Monitor flagged content
- Track AI vs rule-based detection usage
- Message audit trail
Using Test Phone Numbers (Free):
- Go to Firebase Console → Authentication → Sign-in method
- Scroll to "Phone numbers for testing"
- Add test number:
+1 650 555 3434with code123456 - Use in app without SMS charges
- Deploy to Heroku, Railway, or any Node.js hosting
- Set environment variables
- Configure production Firestore rules
- Build:
cd client && npm run build - Deploy to Netlify, Vercel, or Firebase Hosting
- Update CORS settings in backend
- Email notifications for slot updates
- Calendar integration (Google Calendar, Outlook)
- Advanced AI sentiment analysis
- User reputation system
- Mobile app (React Native)
- Push notifications
- File sharing in chats
- Video chat integration
- Recurring slots
- University verification system
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Your Name - Initial work
- Firebase for authentication and database services
- Hugging Face for AI moderation capabilities
- Socket.IO for real-time communication
- React community for excellent documentation
For support, open an issue in the repository.