test
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
index.ts
https://special_server_waho--a432e13a383d11f0b03f9e149126039e.web.val.run
এই প্রজেক্টে একটি উন্নত রিয়েল-টাইম টাইমার সিস্টেম রয়েছে যা প্রতিটি ইউজারের IP address এর ভিত্তিতে আলাদা আলাদা টাইমার পরিচালনা করে।
- প্রতি 100ms এ আপডেট হয় মসৃণ প্রদর্শনের জন্য
- সার্ভার টাইমের সাথে সিঙ্ক্রোনাইজেশন
- রিফ্রেশ করলেও টাইমার সঠিক থাকে
- উন্নত IP detection (Cloudflare, proxy headers সহ)
- IP + User Agent এর combination দিয়ে unique identification
- প্রতিটি ইউজারের জন্য আলাদা 3-দিনের টাইমার
- প্রতি 30 সেকেন্ডে সার্ভার টাইমের সাথে সিঙ্ক
- ক্লায়েন্ট-সার্ভার টাইম ড্রিফট সংশোধন
/api/time-sync
endpoint দিয়ে টাইম সিঙ্ক্রোনাইজেশন
CREATE TABLE ip_visits_tracker_v2 ( id INTEGER PRIMARY KEY AUTOINCREMENT, ip_address TEXT NOT NULL UNIQUE, ip_hash TEXT NOT NULL, first_visit DATETIME NOT NULL, target_date DATETIME NOT NULL, last_access DATETIME DEFAULT CURRENT_TIMESTAMP, access_count INTEGER DEFAULT 1, user_agent TEXT, created_at DATETIME DEFAULT CURRENT_TIMESTAMP )
- প্রথম ভিজিট: নতুন IP এর জন্য 3 দিনের টাইমার সেট করা হয়
- পরবর্তী ভিজিট: একই IP এর জন্য আগের টাইমার ব্যবহার করা হয়
- রিয়েল-টাইম আপডেট: টাইমার প্রতি 100ms এ আপডেট হয়
- সার্ভার সিঙ্ক: প্রতি 30 সেকেন্ডে সার্ভার টাইমের সাথে মিলানো হয়
GET /
- মূল টাইমার পেজGET /api/time-sync
- সার্ভার টাইম সিঙ্ক্রোনাইজেশন
- Frontend: React 18.2.0 with TypeScript
- Backend: Val Town HTTP handler
- Database: SQLite
- Styling: Custom CSS with animations
- Time Management: Server-client synchronization
- IP spoofing প্রতিরোধের জন্য multiple header checking
- User Agent + IP combination দিয়ে unique identification
- Race condition handling for concurrent requests
- Fallback mechanisms for failed requests
- 100ms timer updates for smooth display
- Efficient database queries with proper indexing
- Client-side caching of server time offset
- Minimal DOM updates for better performance