Skip to content

knightappsdev/DVSA_Monitor

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmartDVSA-Monitor 🚗

AI-powered DVSA test slot monitoring platform with intelligent automation and ethical compliance

Next.js TypeScript Node.js PostgreSQL Redis

🌟 Features

🎯 Core Functionality

  • AI-Powered Monitoring: Smart scanning with adaptive frequency based on historical patterns
  • Real-Time Notifications: Multi-channel alerts (WebSocket, SMS, Email, Push) with <2s latency
  • Consent-Based Auto-Booking: Secure credential storage with AES-256 encryption
  • Intelligent Dashboards: Separate interfaces for Students, Instructors, and Administrators
  • Ethical Compliance: Full DVSA terms compliance with rate limiting and blackout hours

🚀 Advanced Features

  • Self-Healing DOM Logic: Automatically adapts to website changes
  • Pattern Recognition: AI learns peak hours and success rates
  • GDPR Compliance: Complete data protection with user consent management
  • Background Processing: Robust job queue system with BullMQ
  • Comprehensive API: RESTful endpoints with full documentation

🛡️ Security & Compliance

  • Data Encryption: AES-256 for sensitive information
  • Audit Logging: Complete activity tracking for compliance
  • Rate Limiting: Respectful API usage with intelligent throttling
  • User Consent: Granular permission system for data processing
  • Secure Authentication: JWT-based auth with Firebase integration

🏗️ Architecture

┌─────────────────────┐    ┌─────────────────────┐    ┌─────────────────────┐
│   Next.js Frontend  │    │   Node.js Backend   │    │   PostgreSQL DB     │
│                     │    │                     │    │                     │
│ • Student Dashboard │    │ • Express.js API    │    │ • User Management   │
│ • Instructor Portal │◄──►│ • Socket.IO         │◄──►│ • Test Slots        │
│ • Admin Interface   │    │ • Prisma ORM        │    │ • Bookings          │
│ • Real-time Updates │    │ • JWT Auth          │    │ • Audit Logs        │
└─────────────────────┘    └─────────────────────┘    └─────────────────────┘
           │                           │
           │               ┌─────────────────────┐
           │               │    Redis Cache      │
           └───────────────┤                     │
                          │ • Session Storage   │
                          │ • Job Queues        │
                          │ • Pub/Sub Messages  │
                          └─────────────────────┘

🔧 Tech Stack

Frontend:

  • Next.js 15 with App Router
  • TypeScript for type safety
  • TailwindCSS for styling
  • Firebase Authentication
  • Socket.IO client for real-time updates
  • React Query for data fetching
  • Zustand for state management

Backend:

  • Node.js with Express.js
  • Prisma ORM with PostgreSQL
  • Socket.IO for real-time communication
  • BullMQ for job processing
  • Redis for caching and pub/sub
  • Playwright for web automation
  • JWT authentication

Infrastructure:

  • Docker containerization
  • Multiple deployment options (Vercel, Railway, Render)
  • GitHub Actions CI/CD
  • Nginx/Caddy reverse proxy configurations

🚀 Quick Start

Prerequisites

  • Node.js 18+
  • PostgreSQL 15+
  • Redis 7+
  • Git

1. Clone Repository

git clone https://github.com/knightappsdev/DVSA_Monitor.git
cd DVSA_Monitor

2. Install Dependencies

# Frontend dependencies
npm install

# Backend dependencies
cd backend
npm install
cd ..

3. Environment Setup

# Copy environment files
cp .env.local.example .env.local
cp backend/.env.example backend/.env

Update the environment variables in both files with your database credentials and API keys.

4. Database Setup

cd backend
npx prisma migrate dev
npx prisma generate
cd ..

5. Start Development Servers

# Terminal 1: Frontend
npm run dev

# Terminal 2: Backend
cd backend
npm run dev

Visit:

📖 Documentation

API Documentation

Complete API documentation is available in API_DOCUMENTATION.md including:

  • Authentication endpoints
  • User management
  • Test slot monitoring
  • Booking management
  • GDPR compliance
  • Admin functions

Environment Variables

Frontend (.env.local)

POSTGRES_URL="postgresql://user:pass@localhost:5432/smartdvsa"
NEXT_PUBLIC_API_URL="http://localhost:5000"
NEXT_PUBLIC_WS_URL="ws://localhost:5000"
NEXT_PUBLIC_FIREBASE_API_KEY="your_firebase_key"
# ... other Firebase config

Backend (.env)

DATABASE_URL="postgresql://user:pass@localhost:5432/smartdvsa"
REDIS_HOST="localhost"
REDIS_PORT="6379"
JWT_SECRET="your_jwt_secret"
AUTO_BOOKING_ENCRYPTION_KEY="64_char_hex_key"
TWILIO_ACCOUNT_SID="your_twilio_sid"
# ... other service credentials

🎮 Usage

For Students

  1. Set Preferences: Configure test centers, dates, and notification preferences
  2. Monitor Slots: Track available test slots in real-time
  3. Enable Auto-Booking: Securely store credentials for automatic booking (optional)
  4. Receive Alerts: Get instant notifications when slots become available

For Instructors

  1. Manage Students: Add and monitor multiple students
  2. Track Progress: View student booking attempts and success rates
  3. Bulk Operations: Manage preferences for multiple students
  4. Analytics: Access performance metrics and reports

For Administrators

  1. System Monitoring: Track platform performance and usage
  2. User Management: Manage user accounts and permissions
  3. Compliance: Monitor GDPR requests and audit logs
  4. Configuration: Adjust system settings and rate limits

🚀 Deployment

Option 1: Docker Deployment

# Build and run with Docker Compose
docker-compose up -d

# Or use the deployment script
chmod +x scripts/deploy.sh
./scripts/deploy.sh

Option 2: Vercel (Frontend) + Railway (Backend)

# Frontend to Vercel
vercel --prod

# Backend to Railway
railway up

Option 3: Manual Deployment

Detailed deployment guides available for:

🧪 Testing

# Frontend tests
npm test

# Backend tests
cd backend
npm test

# Integration tests
npm run test:integration

# Load testing
npm run test:load

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch: git checkout -b feature/amazing-feature
  3. Commit changes: git commit -m 'Add amazing feature'
  4. Push to branch: git push origin feature/amazing-feature
  5. Open a Pull Request

Development Guidelines

  • Follow TypeScript best practices
  • Write tests for new features
  • Maintain GDPR compliance
  • Respect DVSA terms of service
  • Document API changes

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

⚖️ Legal & Compliance

DVSA Terms Compliance

This platform is designed to:

  • Respect DVSA website terms of service
  • Implement ethical scraping practices
  • Use appropriate rate limiting
  • Honor blackout hours
  • Provide user consent mechanisms

GDPR Compliance

  • User consent management
  • Data minimization principles
  • Right to be forgotten
  • Data portability
  • Audit logging
  • Retention policies

Disclaimer

This software is for educational and personal use. Users are responsible for complying with all applicable laws and terms of service. The developers assume no liability for misuse of this software.

🙏 Acknowledgments

  • DVSA for providing public test slot information
  • Open source community for excellent tools and libraries
  • Contributors and testers who helped improve the platform

📞 Support


⚡ Built with modern web technologies and ethical AI practices

About

To monitor slot availability

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages