A comprehensive Next.js application that tracks available IND (Immigration and Naturalisation Service) appointments in the Netherlands and international expat centers, providing real-time notifications when appointments matching user preferences become available.
- Multi-Source Appointment Tracking: Monitors both official IND offices AND international expat centers
- 11 IND locations nationwide
- The Hague International Centre (THIC)
- Rotterdam International Center
- Intelligent Tiered Scraping:
- High-priority types (DOC, BIO): Every 5 minutes
- Low-priority types (VAA, TKV, UKR, FAM): Every 15 minutes
- Comprehensive coverage of ALL valid combinations
- Multi-Channel Notifications:
- Email notifications via SMTP
- Pushover push notifications
- Real-time WebSocket updates
- Booking Automation Helpers: Step-by-step visual guides for booking appointments
- Content Zone System: Monetization-ready widget/ad placement system
- Smart Notification Preferences:
- Multiple locations per preference (e.g., "AM,DH,ZW" or "ALL")
- Customizable days-ahead monitoring
- Do Not Disturb hours (respects quiet time)
- Minimum notification interval (prevents spam)
- Individual email/push toggles
- User Dashboard: View and filter all available appointments
- Account Management: Email verification, password reset, timezone settings
- Dark Mode Support: System-integrated theme switching
- Mobile Responsive: Fully optimized for iPhone SE to desktop
- Admin Dashboard with real-time statistics
- User Management: View, edit, delete users and their preferences
- Manual Scraper Triggers: Force immediate appointment checks
- Content Zone Management: Configure ads/widgets across 4 zones
- Notification Testing: Send test notifications
- Health Monitoring: Automated system health checks
- DOC - Document Collection (Pickup)
- BIO - Biometric Residence Permit
- VAA - Residence Endorsement Sticker (Return Visa)
- TKV - Return Visa
- UKR - Ukraine Proof of Residency
- FAM - Family Reunification
- AM - Amsterdam
- DH - Den Haag
- ZW - Zwolle
- DEN - Den Bosch
- UT - Utrecht
- HRL - Haarlem
- ROT - Rotterdam
- ZVH - Zaventem
- GRO - Groningen
- EIN - Eindhoven
- THE - The Hague
- THIC - The Hague International Centre
- RIC - Rotterdam International Center
- Next.js 16 with App Router
- React 19 with Server Components
- TailwindCSS 4 for styling
- next-themes for dark mode
- WebSocket for real-time updates
- Next.js API Routes (40+ endpoints)
- Custom Node.js Server (server.js) for WebSocket support
- Better-SQLite3 database (NOT MySQL - fully embedded)
- node-cron for scheduled tasks
- Playwright & Puppeteer for booking automation
- Nodemailer - SMTP email delivery
- Pushover API - Push notifications
- JWT - Authentication (with bcryptjs)
- Rate Limiting - Built-in API protection
- Node.js 20+
- SMTP email account (Gmail, SendGrid, Mailgun, etc.)
- Optional: Pushover account for push notifications
-
Clone and navigate to the project
cd /opt/ind-appointments -
Install dependencies
npm install
-
Create environment file
nano .env
Add the following configuration:
# Security (REQUIRED - generate strong random strings!) JWT_SECRET=your-super-secure-jwt-secret-min-32-characters-long # Email (REQUIRED - SMTP settings) SMTP_HOST=smtp.gmail.com SMTP_PORT=587 SMTP_USER=your-email@gmail.com SMTP_PASSWORD=your-app-password FROM_EMAIL=noreply@yourdomain.com FROM_NAME=IND Appointments # Application (REQUIRED) BASE_URL=http://localhost:3000 PORT=3000 # Push Notifications (OPTIONAL - for Pushover) PUSHOVER_API_TOKEN=your-pushover-api-token # Admin (OPTIONAL - for monitoring alerts) ADMIN_EMAIL=admin@yourdomain.com
-
Initialize the database
npm run db:init
Or manually:
node scripts/init-db.js
-
Create an admin user
node scripts/create-admin.js
Follow the prompts to create your admin account.
-
Start the development server
npm run dev
The application will be available at http://localhost:3000
npm run buildCreate the service file:
sudo nano /etc/systemd/system/ind-appointments.serviceAdd the following configuration:
[Unit]
Description=IND Appointments Tracker
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/ind-appointments
ExecStart=/usr/bin/node /opt/ind-appointments/server.js
Restart=always
RestartSec=10
StandardOutput=journal
StandardError=journal
Environment="NODE_ENV=production"
Environment="PORT=3000"
[Install]
WantedBy=multi-user.targetsudo systemctl daemon-reload
sudo systemctl start ind-appointments
sudo systemctl enable ind-appointments
sudo systemctl status ind-appointments# Follow live logs
journalctl -u ind-appointments -f
# View recent logs
journalctl -u ind-appointments -n 100- Sign up at
/signupand verify your email - Set notification preferences at
/preferences:- Choose appointment type (DOC, BIO, VAA, etc.)
- Select locations:
- Single:
AM(Amsterdam only) - Multiple:
AM,DH,UT(Amsterdam, Den Haag, Utrecht) - All:
ALL(all locations)
- Single:
- Set number of persons (1-6)
- Define days ahead to monitor (e.g., 90 days)
- Configure Do Not Disturb hours (e.g., 23:00 - 08:00)
- Set minimum notification interval (e.g., 60 minutes)
- Receive notifications when matching appointments appear
- Use booking helpers at
/autobookor/book-helperfor booking assistance
- Access admin dashboard at
/admin - Manage users at
/admin/users - Configure notifications at
/admin/notifications - Manage content zones at
/admin/content-zones(ad placements) - Manually trigger scraper:
curl -X POST http://localhost:3000/api/appointments \ -H "Authorization: Bearer YOUR_ADMIN_TOKEN"
GET /api/health- Health checkGET /api/appointments- List available appointments (with filters)GET /api/widget- Fetch content zone settingsPOST /api/login- User authenticationPOST /api/signup- User registrationPOST /api/verify-email- Email verificationPOST /api/forgot-password- Password reset requestPOST /api/reset-password- Password reset confirmationPOST /api/resend-verification- Resend verification email
GET /api/preferences- Get user notification preferencesPOST /api/preferences- Create notification preferencePUT /api/preferences- Update notification preferenceDELETE /api/preferences?id=X- Delete preferencePOST /api/preferences/unsubscribe- Unsubscribe from emailsGET /api/notifications/history- Notification logPOST /api/user/notification-credentials- Set Pushover keysPOST /api/user/timezone- Update timezonePOST /api/user/change-password- Change passwordPOST /api/user/change-email- Request email changePOST /api/verify-email-change- Confirm email change
GET /api/admin/stats- Dashboard statisticsGET /api/admin/users- List all usersGET /api/admin/users/:id- Get user detailsPUT /api/admin/users/:id- Update userDELETE /api/admin/users/:id- Delete userPOST /api/admin/users/bulk- Bulk user operationsGET /api/admin/users/:id/preferences- User's preferencesPOST /api/appointments- Manual scraper triggerGET /api/admin/widget- Get content zonesPUT /api/admin/widget- Update content zonesGET /api/admin/notifications/settings- Notification configPOST /api/admin/notifications/test- Send test notificationGET /api/admin/health- System health check
POST /api/book- Booking page handlerPOST /api/autobook- Autobook page handlerPOST /api/book-helper- Booking helper handlerPOST /api/automate-booking- Automated booking flow
The application uses Better-SQLite3 (embedded database, no MySQL server needed):
users- User accounts with roles and verification statusind_appointments- All appointments with source tracking (IND/THIC/RIC)notification_preferences- User alert settings (multiple per user)notification_log- Complete notification historyuser_notification_credentials- Pushover keys, WhatsApp numbersuser_saved_appointments- Bookmarked appointmentssystem_settings- System-wide configurationcron_job_log- Scraper execution history
- Development:
./data/ind_appointments.db - SQLite files: Automatically managed (includes
-shmand-walfiles)
npm run db:init # Initialize database
npm run db:reset # Reset database (WARNING: deletes all data)
node scripts/init-db.js # Manual initializationHigh Priority (every 5 minutes):
- DOC (Document Collection)
- BIO (Biometric)
Low Priority (every 15 minutes):
- VAA (Residence Sticker)
- TKV (Return Visa)
- UKR (Ukraine)
- FAM (Family Reunification)- IND API: 11 locations, 6 appointment types, 1-6 persons
- THIC API: The Hague International Centre
- Rotterdam IC: Uses TIMEBLOCKR system
- Comprehensive: Scrapes ALL valid combinations regardless of user preferences
- Checks new appointments against user preferences
- Respects Do Not Disturb hours (with midnight-spanning support)
- Enforces minimum notification intervals
- Batches multiple appointments into single notifications
- Logs all notification attempts
- Supports email and push channels
- Opens IND booking page with pre-filled parameters
- Provides step-by-step visual instructions
- Supports both IND and expat center URLs
- Copy-to-clipboard functionality
- Mobile-friendly interface
- 4 placement zones: Header, Sidebar, Footer, Between Appointments
- Admin-configurable HTML content
- Display mode control (desktop/mobile/both)
- Ad-blocker evasion with obfuscated classes
- Global and per-zone enable/disable
- Account Cleanup: Deletes unverified accounts after 30 days
- Old Data Removal: Cleans up old appointments and logs
- Health Monitoring: Hourly system health checks
- Error Alerting: Emails admin on critical failures
Users receive HTML-formatted emails containing:
- Number of new appointments found
- Details of up to 10 appointments (date, time, location, persons)
- Direct booking links (specific to appointment source)
- Preference management link
- One-click unsubscribe option
# Application logs
journalctl -u ind-appointments -f
# Database logs (SQLite query logs in console during dev)
npm run dev # Shows DB queries in development-- Check recent scraper runs
SELECT * FROM cron_job_log ORDER BY started_at DESC LIMIT 10;
-- View recent notifications
SELECT * FROM notification_log ORDER BY sent_at DESC LIMIT 20;
-- Count appointments by source
SELECT source, COUNT(*) FROM ind_appointments GROUP BY source;
-- Active users with preferences
SELECT u.email, COUNT(np.id) as prefs
FROM users u
JOIN notification_preferences np ON u.id = np.user_id
WHERE u.email_verified = 1
GROUP BY u.id;curl http://localhost:3000/api/health# Check database file exists
ls -lh data/ind_appointments.db*
# Reset database (WARNING: deletes all data)
npm run db:reset
# Initialize fresh database
npm run db:init- Verify SMTP credentials in
.env - For Gmail: Use an App Password
- Check notification logs:
SELECT * FROM notification_log WHERE success = 0 ORDER BY sent_at DESC;
- Test email manually via admin panel:
/admin/notifications
- Check application logs:
journalctl -u ind-appointments -f - Verify service is running:
systemctl status ind-appointments - Check cron job logs:
SELECT * FROM cron_job_log ORDER BY started_at DESC LIMIT 5;
- Manually trigger:
POST /api/appointments(admin token required)
- Ensure
server.jsis being used (not just Next.js dev server) - Check firewall allows WebSocket connections
- Verify
BASE_URLin.envis correct
- Verify
PUSHOVER_API_TOKENin.env - Check user has added their Pushover user key in
/settings - Test via admin panel:
/admin/notifications
- JWT Secret: Use a strong random string (32+ characters)
- HTTPS: Always use HTTPS in production
- Rate Limiting: Built-in API rate limiting (adjust in
lib/rate-limit.ts) - SQL Injection: Better-SQLite3 uses prepared statements (safe by default)
- XSS Protection: Content zones are admin-only, but sanitize if allowing user HTML
- CORS: Configured for same-origin by default
- Password Hashing: bcryptjs with 10 rounds
- Email Verification: Required for account activation
- Environment Variables: Never commit
.envfiles
npm run dev # Development server (with WebSocket)
npm run build # Production build
npm run start # Production server
npm run lint # ESLint
npm run type-check # TypeScript validation
npm run db:init # Initialize database
npm run db:reset # Reset database (deletes all data)/opt/ind-appointments/
βββ app/ # Next.js App Router pages
β βββ api/ # API routes (40+ endpoints)
β βββ admin/ # Admin dashboard pages
β βββ page.tsx # Homepage (appointment viewer)
β βββ login/ # Authentication pages
β βββ preferences/ # User settings
βββ lib/ # Core business logic
β βββ ind-api.ts # IND API scraper
β βββ expat-centers.ts # THIC/Rotterdam scrapers
β βββ notifications.ts # Multi-channel notifications
β βββ booking-automation.ts # Playwright automation
β βββ database.ts # SQLite wrapper
β βββ cron/ # Scheduled tasks
βββ components/ # React components
βββ database/ # SQL schemas and migrations
βββ scripts/ # Setup and maintenance scripts
βββ data/ # SQLite database files (gitignored)
βββ server.js # Custom Node server (WebSocket)
βββ .env # Environment configuration (gitignored)
# Test all appointment types
node test-all-thic-types.js
# Test expat center scrapers
node test-expat-scrapers.js
# Test IND API
node test-api.js
# Test booking automation
node test-automation.js- Fully responsive design (320px to 1920px+)
- Touch-friendly buttons and forms
- Optimized for iPhone SE, iPhone 12, and tablets
- Dark mode support
- Fast loading with Next.js optimizations
- Only app that tracks both IND AND expat centers (THIC, Rotterdam IC)
- Tiered scraping prioritizes high-demand appointment types
- Multi-location preferences (select multiple or ALL locations)
- Do Not Disturb hours with midnight-spanning support
- WebSocket real-time updates for instant appointment alerts
- Booking automation helpers with visual step-by-step guides
- Content zone monetization system with 4 placement zones
- Pushover integration for mobile push notifications
- Source tracking (know if appointment is from IND, THIC, or RIC)
- Comprehensive logging of every scrape, notification, and system event
- SMS notifications via Twilio
- Telegram bot integration
- WhatsApp notifications
- Progressive Web App (PWA)
- Native mobile apps (iOS/Android)
- Appointment availability predictions (ML)
- More expat center integrations
- Webhook support for custom integrations
- API documentation (OpenAPI/Swagger)
- Multi-language support (NL/EN)
This is an unofficial tool to help track IND appointment availability. Not affiliated with or endorsed by IND (Immigratie- en Naturalisatiedienst) or any expat centers.
For issues and questions:
- Check the logs:
journalctl -u ind-appointments -f - Review the health endpoint:
http://localhost:3000/api/health - Check database:
ls -lh data/ind_appointments.db* - Verify environment variables in
.env - Test SMTP settings via admin panel
- Built with Next.js 16 and React 19
- Uses Better-SQLite3 for embedded database
- Booking automation powered by Playwright
- Push notifications via Pushover
- Email delivery via Nodemailer