How alnasrstarsecurity-nss/nss-reporting works
What this project is (type + purpose)
From the file tree and README, this is a static, client-side web application for NSS (Al Nasr Star Security) reporting. It’s composed of multiple HTML pages, CSS stylesheets, and JavaScript files. There is no backend/server code in this repo (no server/, api/, package.json, etc.), so any persistence/authentication is either:
• purely client-side (e.g., localStorage), and/or
Data storage / API integration
• Search in js/*.js for: fetch(, XMLHttpRequest, axios, firebase, firestore, database, supabase, appwrite, URLs, API keys.
Authentication mechanism
• In auth.js, check whether it uses:
• Firebase Auth / OAuth providers
• A custom REST endpoint
• Hard-coded credentials
• localStorage/sessionStorage tokens
Shared state + navigation
• Does menu.html load the same scripts and rely on shared session state?
Entity model
• What objects exist? (Deviation, Violation, Patrolling report, Fire incident)
• What fields are captured and where they are saved/sent?
Relationships & interactions to highlight (data-flow centric)
For accuracy and usefulness, show primary user journeys as labeled flows:
Login / Session Establishment
• User enters credentials → auth.js → Auth Provider → token/session stored → redirect to menu.html or feature page
Create Deviation Report
• User opens Deviation.html → deviation.js loads → validates form → attaches metadata (user/time/location if present) → sends to Data Store/API → success UI state
Create Violation Report
• Same pattern via Violation.html + violation.js
Create Patrolling Report
• Patrolling.html + patrolling.js (may involve periodic logs/time entries—note if code shows timers/geolocation)
Fire/Incident
• If fire.js is invoked by one of the pages (or dynamically), show which page triggers it and its data sink
• “Authenticate”
• “Submit deviation report”
• “Store report record”
• “Read current user session”
• “Upload attachment” (if relevant)
Architectural patterns likely used (and how to represent them)
• Multi-Page Application (MPA): multiple HTML entry points, each with its own JS module.
• Feature-per-file JS modules: each report type has a dedicated script.
• Direct-to-service architecture (potentially): the browser may talk directly to Auth/DB services.
• showing each page/module separately (instead of one “Frontend” blob)
• showing external services as first-class nodes (since they replace an internal backend)
Checklist to ensure “best and most accurate”
• [ ] External dependencies are named exactly (vendor + product)
• [ ] Data objects are named (Deviation/Violation/Patrol/Fire) and shown going to storage
• [ ] Auth boundary is clear: what requires login, where tokens live, how pages enforce it