A full-stack real-time network security monitoring platform built with React, Node.js, and MongoDB.
- Real-Time Traffic Monitoring: Live network traffic visualization with WebSocket streaming
- Threat Detection System: Signature-based detection for malicious IPs and suspicious ports
- Automated Response Mechanism: IP blocking, rate limiting, and alert notifications
- Role-Based Authentication: JWT-based auth with Admin/User roles
- Interactive Dashboard: Live charts, threat feeds, and comprehensive monitoring
- Historical Data: Alert history with filtering and export capabilities
- React 18 with TypeScript
- Tailwind CSS for styling
- Recharts for data visualization
- Socket.IO client for real-time updates
- React Router for navigation
- Node.js with Express.js
- Socket.IO for real-time communication
- MongoDB with Mongoose ODM
- JWT authentication
- bcryptjs for password hashing
- Node.js (v16 or higher)
- MongoDB (local or cloud instance)
- npm or yarn
- Clone the repository
git clone <your-repo-url>
cd securenet-monitoring- Install dependencies
# Install frontend dependencies
npm install
# Install backend dependencies
cd server
npm install
cd ..- Environment Setup
Create a
.envfile in the root directory:
MONGODB_URI=mongodb://localhost:27017/securenet
JWT_SECRET=your-super-secret-jwt-key-here
JWT_EXPIRE=24h
PORT=3001-
Start MongoDB Make sure MongoDB is running on your system.
-
Run the application
Start the backend server:
cd server
node index.jsStart the frontend development server:
npm run devThe application will be available at:
- Frontend: http://localhost:5173
- Backend API: http://localhost:3001
A default admin user is created automatically:
- Email: admin@securenet.com
- Password: admin123
- Role: Admin
SecureNet/
βββ src/ # React frontend
β βββ components/ # Reusable components
β β βββ Auth/ # Authentication components
β β βββ Charts/ # Chart components
β β βββ Dashboard/ # Dashboard components
β β βββ Layout/ # Layout components
β β βββ Threats/ # Threat-related components
β β βββ Traffic/ # Traffic monitoring components
β βββ contexts/ # React contexts
β βββ pages/ # Page components
β βββ services/ # API services
β βββ App.tsx # Main app component
βββ server/ # Node.js backend
β βββ models/ # MongoDB models
β βββ routes/ # API routes
β βββ middleware/ # Custom middleware
β βββ services/ # Business logic services
β βββ sockets/ # Socket.IO handlers
β βββ index.js # Server entry point
βββ public/ # Static assets
βββ package.json # Dependencies and scripts
POST /api/auth/register- User registrationPOST /api/auth/login- User loginGET /api/auth/me- Get current user
GET /api/traffic- Get traffic dataGET /api/traffic/stats- Get traffic statistics
GET /api/alerts- Get alerts with filteringPATCH /api/alerts/:id/status- Update alert status
GET /api/responses- Get response historyPOST /api/responses- Create new response (Admin only)
subscribe-to-traffic- Subscribe to traffic updatessubscribe-to-threats- Subscribe to threat updates
traffic-update- Real-time traffic datathreat-detected- New threat detected
- User authentication and role management
- Network traffic data with timestamps, IPs, ports, protocols
- Security alerts with severity levels and status
- Automated response actions and their results
- Real-time metrics and KPIs
- Live traffic visualization
- Recent threats feed
- System status indicators
- Live and historical traffic data
- Protocol and status filtering
- Bandwidth usage charts
- Export functionality
- Active threat management
- Geographic threat mapping
- Severity-based filtering
- Status updates
- Automated response triggers (Admin only)
- Response history and status
- Action configuration
- Historical alert data
- Advanced filtering and search
- Date range selection
- CSV export
- JWT-based authentication
- Role-based access control
- Password hashing with bcrypt
- Input validation and sanitization
- CORS configuration
- Secure headers
- Create components in appropriate directories
- Add API routes in
server/routes/ - Update MongoDB models if needed
- Add Socket.IO events for real-time features
- Frontend: React Testing Library
- Backend: Jest with Supertest
- Database: MongoDB Memory Server for testing
npm run build
# Deploy dist/ folder# Set environment variables
# Deploy server/ directory- MongoDB Atlas (recommended)
- Self-hosted MongoDB instance
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE file for details
For issues and questions:
- Create an issue on GitHub
- Check the documentation
- Review the code comments
Built with Yafet-Yilma for network security monitoring