How manisha-athili/crime-safety-system works
Project type and purpose
• This is a client‑heavy, web‑based Crime and Reporting System.
• It uses static HTML/CSS/JS pages for the user interface and Firebase as a backend (hosting, authentication, database, possibly functions).
• Key user journeys: guest login/registration, submitting crime reports, viewing all reports with pagination & filters, viewing a map of incidents, sending feedback, and an officer dashboard for case management.
File structure
• Top‑level config:
• .firebaserc, firebase.json → Firebase hosting & services configurations
• package.json / node_modules → local dev tools or build scripts
• Frontend modules grouped in directories (each with its own HTML/CSS/JS):
• Authentication: loginIn/, signUp/
• Profile: profile/
• Crime reporting: crime-safety/reportForm/
• Reports listing: crime-safety/all_Reports/
• Officer view: officerDasboard/
• Feedback: feedback/
• Map/
• Shared UI: navbar/, pages/ (aboutUs, contactUs), index.html, script.js, style.css
• Data mocking: db.json (likely for json‑server in local dev)
• README indicates additional features: pagination, filters, sending confirmation emails, map UI, guest login, etc.
README for additional insights
• Two hard‑coded officer accounts for dashboard access
• Feature checklist: profile, pagination, guest login, mail notifications (signup complete), map UI, filters, feedback, report counts.
Main components & relationships
a. Frontend (hosted on Firebase Hosting)
• Authentication Module (loginIn/, signUp/) → Firebase Authentication
• User Profile Module (profile/)
• Crime Reporting Module (crime-safety/reportForm/) → writes to Firebase Database
• Reports Listing Module (crime-safety/all_Reports/) → reads from Firebase Database (with pagination & filters)
• Feedback Module (feedback/) → writes to Firebase Database
• Module (map/) → displays reports via Google Maps API + reads DB
• Officer Dashboard Module (officerDasboard/) → reads & updates cases in Firebase Database
• Shared UI Components (navbar/, pages/)
b. Backend (Firebase services)
• Firebase Hosting → serves the static site
• Firebase Authentication → user login/signup, officer login
• Firebase Realtime Database or Firestore → stores users, reports, feedback
• (Optional) Firebase Cloud Functions → send signup confirmation emails
c. External services
• Google Maps API → map visualization
• Email Service (via Cloud Functions or external SMTP)
Architectural patterns & design principles
• Modular Static Site Architecture: each feature lives in its own folder, clear separation of concerns
• BaaS model: Firebase handles hosting, auth, data storage, and serverless logic
• Client‑driven flows: front‑end code directly interacts with Firebase SDK
• Progressive enhancement: static pages enhanced with JS for dynamic behavior
Final checklist
• Distinct components for UI modules, backend services, and external services
• Real‑time or serverless interactions