Enterprise-grade cybersecurity platform for API protection, real-time attack detection, and threat intelligence visualization.
DevShield is a comprehensive SaaS solution designed to protect modern APIs from cyber threats, detect suspicious activities in real-time, and provide actionable security insights through an intuitive dashboard.
DevShield provides enterprise-level API security through:
- π API Protection: Intelligent request filtering, rate limiting, and authentication enforcement
- π― Attack Detection: Real-time threat identification using pattern recognition and behavioral analysis
- π Threat Visualization: Interactive dashboards with live security metrics and attack timelines
- π Alert System: Instant notifications for critical security events
- π Analytics: Comprehensive security insights and trend analysis
- API Gateway Protection: Intercepts and validates all API requests
- DDoS Mitigation: Advanced rate limiting and traffic pattern analysis
- SQL Injection Detection: Pattern-based query validation
- XSS Prevention: Input sanitization and output encoding
- CSRF Protection: Token-based request verification
- JWT Authentication: Secure, stateless user authentication
- Role-Based Access Control (RBAC): Granular permission management
- Real-Time Dashboard: Live threat feed with WebSocket updates
- Attack Timeline: Visual representation of security events
- Threat Heatmap: Geographic visualization of attack sources
- Performance Metrics: API response times and system health
- Historical Analysis: Trend identification and pattern discovery
- Custom Alerts: Configurable notification rules
- Multi-Tenant Architecture: Isolated environments for each customer
- API Key Management: Secure credential generation and rotation
- Whitelist/Blacklist: IP and domain-based access control
- Audit Logging: Comprehensive security event tracking
- Compliance Reports: Export security data for regulatory requirements
βοΈ React 18+ with TypeScript
π¨ TailwindCSS / Material-UI
π Recharts / D3.js (Data Visualization)
π Socket.io Client (Real-time updates)
ποΈ Redux Toolkit (State Management)
π‘ Axios (HTTP Client)
π Node.js + Express.js
π TypeScript
ποΈ MongoDB + Mongoose
π Socket.io (WebSockets)
π JWT + Passport.js (Authentication)
β‘ Redis (Caching & Rate Limiting)
π§ Nodemailer (Email Notifications)
π§ͺ Jest + Supertest (Testing)
π³ Docker + Docker Compose
βοΈ AWS / Azure / GCP ready
π GitHub Actions (CI/CD)
π Prometheus + Grafana (Monitoring)
π ELK Stack (Logging)
- Node.js 18+ and npm/yarn
- MongoDB 5.0+
- Redis 6.0+ (for caching and rate limiting)
- Docker (optional, for containerized deployment)
1. Clone the Repository
git clone https://github.com/DIYA73/devshield-saas.git
cd devshield-saas2. Backend Setup
cd devshield-backend
npm install
# Create environment file
cp .env.example .env
# Configure your .env file:
# PORT=5000
# MONGODB_URI=mongodb://localhost:27017/devshield
# REDIS_URL=redis://localhost:6379
# JWT_SECRET=your_secure_secret_key
# NODE_ENV=development3. Frontend Setup
cd ../devshield-frontend
npm install
# Create environment file
cp .env.example .env
# Configure your .env file:
# REACT_APP_API_URL=http://localhost:5000
# REACT_APP_SOCKET_URL=http://localhost:50004. Start MongoDB and Redis
# Option A: Using Docker
docker-compose up -d mongodb redis
# Option B: Local installation
mongod
redis-server5. Run the Application
Backend (Terminal 1):
cd devshield-backend
npm run devFrontend (Terminal 2):
cd devshield-frontend
npm start6. Access the Application
Frontend: http://localhost:3000
Backend API: http://localhost:5000
Quick Deploy with Docker Compose:
docker-compose up -dThis will start:
- Frontend (React) on port 3000
- Backend (Node.js) on port 5000
- MongoDB on port 27017
- Redis on port 6379
devshield-saas/
βββ devshield-frontend/ # React TypeScript Frontend
β βββ src/
β β βββ components/ # Reusable UI components
β β βββ pages/ # Page components
β β βββ features/ # Redux slices
β β βββ services/ # API services
β β βββ utils/ # Helper functions
β β βββ hooks/ # Custom React hooks
β β βββ types/ # TypeScript definitions
β β βββ App.tsx # Main app component
β βββ public/
β βββ package.json
β βββ tsconfig.json
β
βββ devshield-backend/ # Node.js TypeScript Backend
β βββ src/
β β βββ controllers/ # Request handlers
β β βββ models/ # MongoDB schemas
β β βββ routes/ # API routes
β β βββ middleware/ # Custom middleware
β β βββ services/ # Business logic
β β βββ utils/ # Helper functions
β β βββ config/ # Configuration files
β β βββ validators/ # Input validation
β β βββ server.ts # Express app setup
β βββ tests/ # Unit & integration tests
β βββ package.json
β βββ tsconfig.json
β
βββ backend/ # Legacy or alternative backend
βββ screenshots/ # Project screenshots
βββ docker-compose.yml # Container orchestration
βββ .gitignore
βββ README.md
βββ LICENSE
Client Request
β
API Gateway (Express)
β
Rate Limiter (Redis)
β
Authentication (JWT)
β
Input Validation
β
Threat Detection Engine
β
Business Logic
β
Database (MongoDB)
β
Response + Logging
- Request Analysis: Parse HTTP headers, body, and parameters
- Pattern Matching: Check against known attack signatures
- Behavioral Analysis: Compare against user baseline behavior
- Risk Scoring: Calculate threat level (0-100)
- Action Determination: Allow, block, or flag for review
- Logging & Alerting: Record event and notify if critical
POST /api/auth/register # Create new account
POST /api/auth/login # User login
POST /api/auth/logout # User logout
POST /api/auth/refresh-token # Refresh JWT
POST /api/auth/forgot-password # Password reset
POST /api/shield/protect # Enable protection for an API
GET /api/shield/status # Check protection status
PUT /api/shield/config # Update security rules
DELETE /api/shield/disable # Disable protection
GET /api/threats # List detected threats
GET /api/threats/:id # Get threat details
POST /api/threats/:id/review # Mark threat as reviewed
POST /api/threats/:id/whitelist # Add to whitelist
GET /api/analytics/dashboard # Dashboard metrics
GET /api/analytics/timeline # Threat timeline
GET /api/analytics/heatmap # Geographic threat map
GET /api/analytics/export # Export security reports
connect # Client connection
threat:detected # Real-time threat alert
metrics:update # Live dashboard update
attack:blocked # Attack prevention notification
Run Backend Tests:
cd devshield-backend
npm test # Run all tests
npm run test:watch # Watch mode
npm run test:coverage # Coverage reportRun Frontend Tests:
cd devshield-frontend
npm testEnd-to-End Tests:
npm run test:e2e- Request Processing: <50ms average latency
- Threat Detection: <100ms analysis time
- WebSocket Updates: <10ms real-time delivery
- Horizontal Scaling: Load balancer ready
- Database Optimization: Indexed queries, connection pooling
- Caching Strategy: Redis for frequently accessed data
- CDN Integration: Static asset delivery optimization
- Environment variables configured
- Database backups automated
- SSL/TLS certificates installed
- Rate limiting configured
- Monitoring alerts set up
- Logging infrastructure ready
- Security headers enabled
- CORS policies configured
- API documentation published
- Frontend: Vercel, Netlify, AWS Amplify
- Backend: AWS EC2, DigitalOcean, Heroku, Render
- Database: MongoDB Atlas, AWS DocumentDB
- Cache: Redis Cloud, AWS ElastiCache
- Monitoring: Datadog, New Relic, Sentry
GitHub Actions workflow automatically:
- β Runs TypeScript type checking
- β Executes unit and integration tests
- β Performs security vulnerability scanning
- β Builds production bundles
- β Deploys to staging/production
- β Runs smoke tests post-deployment
We welcome contributions! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
Development Guidelines:
- Write TypeScript (strict mode)
- Follow ESLint/Prettier configuration
- Write tests for new features
- Update documentation
- Follow conventional commits
- Core API protection
- Basic threat detection
- Real-time dashboard
- User authentication
- Machine learning-based anomaly detection
- Advanced DDoS mitigation
- Multi-region deployment
- Custom rule engine
- Mobile app (React Native)
- Blockchain-based audit logs
- AI-powered threat prediction
- Integration marketplace
This project is licensed under the MIT License - see the LICENSE file for details.
Diya
- GitHub: @DIYA73
- LinkedIn: [https://www.linkedin.com/in/didi-86b00329a]
- OWASP Top 10 security guidelines
- Node.js security best practices
- Open-source security community
- Contributors and supporters
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: diyaismail7@gmail.com
β If you find DevShield useful, please consider starring the repository!
π‘οΈ Securing APIs, one request at a time.