A comprehensive real-time client-server application for multi-tenant data management and analytics
Features β’ Architecture β’ Quick Start β’ Documentation
This project demonstrates advanced socket programming concepts through a real-time multi-tenant management system. Multiple client instances can simultaneously connect to a central server to manage data records, perform statistical operations, and communicate via integrated chat functionality.
The system implements a scalable multi-client architecture where:
- Server: Acts as the central data hub and coordination engine
- Clients: Represent different tenant instances managing their datasets
- Real-time Communication: Powered by WebSocket connections for instant data synchronization
- Multi-client Socket Management with automatic connection tracking
- Real-time Database Operations using Microsoft SQL Server
- Statistical Computing Engine for data performance analytics
- Live Chat System with message broadcasting
- CSV Bulk Import support for efficient data entry
- Modern React Interface with Material-UI components
- Interactive Data Management with form validation
- Real-time Data Visualization through dynamic tables
- Statistical Operations Dashboard (Average, Min, Max, Sort)
- File Upload Integration for CSV data imports
- Live Chat Integration for client communication
- Average: Calculate and display performance averages for all records with IDs
- Sort: Rank records by performance metrics
- Max: Identify top-performing records in the dataset
- Min: Find records needing attention or improvement
- Visit: Quick data inspection with detailed reporting
βββββββββββββββββββ WebSocket/HTTP βββββββββββββββββββββ
β React Client β βββββββββββββββββββΊ β Node.js Server β
β (Faculty UI) β β (Express + IO) β
βββββββββββββββββββ βββββββββββββββββββββ
β β
β β
ββββββΌβββββ ββββββΌββββββββ
βMaterial β β SQL Serverβ
βUI + CSS β β Database β
βββββββββββ ββββββββββββββ
- Handshake: Client connects to server via Socket.IO
- Registration: Faculty details stored in database
- Data Exchange: Student records transmitted in real-time
- Operations: Statistical queries processed server-side
- Results: Computed data returned to requesting client
- Node.js 16+ and npm
- Microsoft SQL Server with Windows Authentication
- Git for cloning the repository
-
Clone the repository
git clone https://github.com/erfan-nourbakhsh/SocketSync.git cd SocketSync
-
Setup the Server
cd Server npm install # Configure database connection in app.js (lines 27-32) npm start
-
Setup the Client
cd ../Client npm install npm start
-
Access the Application
- Server:
http://localhost:8080
- Client:
http://localhost:3000
- Multiple clients can connect simultaneously
- Server:
The system uses three main tables:
- faculties: Client connection and faculty information
- students: Personal details and academic records
- courses: Subject-wise grades and performance data
Event | Direction | Description |
---|---|---|
sendFacultyName |
Client β Server | Register faculty name |
sendStudents |
Client β Server | Add individual student |
sendStudentsCSV |
Client β Server | Bulk import via CSV |
Average |
Client β Server | Request GPA calculations |
Sort |
Client β Server | Request ranked student list |
Max/Min |
Client β Server | Request performance extremes |
first_name,last_name,national_code,id_number,course1,grade1,course2,grade2,course3,grade3,course4,grade4,course5,grade5
John,Doe,1234567890,STU001,Math,85,Physics,92,Chemistry,78,Biology,88,English,90
- Express.js: Web application framework
- Socket.IO: Real-time bidirectional communication
- msnodesqlv8: Microsoft SQL Server integration
- crypto: UUID generation for unique identifiers
- React 18: Modern component-based UI framework
- Material-UI v5: Professional design system
- Socket.IO Client: WebSocket client implementation
- Papa Parse: CSV file processing
- SweetAlert2: Enhanced user notifications
Edit Server/app.js
to configure your SQL Server connection:
var config = {
database: "YOUR_DATABASE_NAME",
server: "YOUR_SERVER_NAME",
driver: "msnodesqlv8",
options: { trustedConnection: true }
};
The client connects to localhost:8080
by default. Update the socket connection in Client/src/App.js
if needed:
const newSocket = io(`http://your-server-url:8080/`);
- Faculty members can communicate instantly
- Message persistence during session
- User identification with faculty names
- Broadcast messaging to all connected clients
- GPA Calculations: Automatic average computation
- Ranking System: Student performance sorting
- Statistical Insights: Min/max performance identification
- Data Export: Results formatted for further analysis
- CSV Import: Bulk student data upload
- Form Validation: Comprehensive input checking
- Error Handling: Graceful failure management
- Success Notifications: User feedback system
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Here's how you can help:
- π΄ Fork the repository
- πΏ Create a feature branch (
git checkout -b feature/amazing-feature
) - πΎ Commit your changes (
git commit -m 'Add amazing feature'
) - π€ Push to the branch (
git push origin feature/amazing-feature
) - π Open a Pull Request
- π€ Author: Erfan Nourbakhsh
- π Project Link: https://github.com/erfan-nourbakhsh/SocketSync
- π Issues: Report bugs or request features
- πΌ LinkedIn: erfan-nourbakhsh