How nst-sdc/screentime-recoder works
Project type and purpose
• This is a full-stack “Screen Time Recorder” application with three primary parts:
• A Browser Extension (collects real-time screen and gaze data)
• A React Frontend (“client” folder) for the user dashboard
• A Node.js/Express Backend API (“server” folder) with data storage and AI processing
• Purpose: monitor user screen usage and eye movements, analyze focus via AI tools, store results, and display analytics.
File structure
• Top-level folders:
• client/ – React SPA (components, pages, services, contexts)
• extension/ – browser extension (background.js, content.js, popup)
• server/ – Express REST API (config, controllers, models, routes, services, middleware, utils)
• Config and infra files: .env.example, package.json, Vercel/Railway hints, Docker (if added later)
• Notable patterns:
• Server uses MVC (models/controllers/routes) + service/util layers
• Frontend uses React Context for auth + service layer for API calls
• Extension injects scripts and sends data to the backend API
Extract architecture details from the README
• Tech stack: React, Node.js/Express, MongoDB/PostgreSQL (TBD), JWT/Firebase Auth, OpenCV/MediaPipe/Tesseract AI tools
• Features mapped to components: screen monitoring (extension), eye tracking (extension + AI libs on server?), focus analytics (server), personalized dashboard (frontend)
a. Main components to represent:
1. Browser Extension
2. Frontend React App
3. Backend API Server
4. Database (MongoDB/PostgreSQL)
5. Authentication Service (JWT or Firebase Auth)
6. AI Processing Modules (OpenCV, MediaPipe, Tesseract, optionally external AI service like Gemini)
7. (Optional) Notification/Reminder service (email/SMS or push)
b. Relationships & interactions:
• Extension → collects screen and eye data → sends payload over HTTPS to Backend API
• Backend → invokes AI Modules for OCR & eye-tracking analysis → writes processed records to Database
• Frontend → uses Auth Service to obtain token → calls Backend API for dashboards, reminders, analytics
• Backend → triggers Reminder Service or push notifications based on rules
c. Architectural patterns & design principles:
• Layered architecture (Presentation, API, Business Logic, Data Access)
• MVC on server side (Models, Controllers, Routes)
• Separation of concerns: extension handles capture, server handles processing+storage, client handles visualization
• Use of Context/Service abstractions in React for state & API
• React.js (client components, contexts, pages)
• Express.js & Node.js (controllers, middleware, routes)
• MongoDB or PostgreSQL (models/data)
• JWT / Firebase Auth
• OpenCV, MediaPipe, Tesseract modules (as server-side services)