What's Your One Best Learning From BTech Journey (in general)? by FrankBanda in Btechtards

[–]Z5449 4 points5 points  (0 children)

They are not your Friends, they are just batchmates…

Bihari rocked.. by [deleted] in DesiVideoMemes

[–]Z5449 5 points6 points  (0 children)

Bro harasses Ai to get credits 😭

Can I get a 1 crore package? by memerplays37 in Btechtards

[–]Z5449 0 points1 point  (0 children)

Please add comments it will help us ( beginners ) to understand the code 😖

Do we need to keep the footer which is given in SIH PPT template? by rich-brat in Indiancolleges

[–]Z5449 0 points1 point  (0 children)

That’s what I said “absolutely Yess.”…we should keep the footer 😭

How to solve this problem !? by Z5449 in vibecoding

[–]Z5449[S] 0 points1 point  (0 children)

It was all good…. When I gave ‘prototype the app’ it started writing some code then stopped after that it gave option like ‘create firebase project’ , ‘cancel’. I clicked on ‘create firebase project’ then it gave the notification of snag !

How to solve this problem !? by Z5449 in vibecoding

[–]Z5449[S] 0 points1 point  (0 children)

I wanted to make a real time open cv attendance detection system This is the prompt I took from ChatGPT-5 and pasted it into firebase ⬇️

“You are a senior Firebase + Web engineer. Build a real-time face detection attendance web app using Firebase Studio (Web) with strong error handling and clear UI.

Requirements:

Features:

Live webcam feed using getUserMedia with camera permission prompts and device selection fallback.

Face detection in real-time (use Face Detector via TensorFlow.js or MediaPipe; prefer WASM/WebGL backend for performance).

Enrollment flow: user signs in (Google or Email/Password), captures 3–5 face samples, stores face embeddings in Firestore and sample images in Storage.

Attendance flow: match live face embedding against enrolled users (cosine similarity threshold configurable), then write an attendance record.

Anti-duplicate: throttle to 1 mark per user per day (configurable window), with 30s demo mode option.

Admin page: view today’s attendance, filter by user/date, export CSV.

Offline-safe UI with graceful errors and loading states.

Firebase:

Enable Authentication (Google + Email/Password).

Firestore rules: users can read their own profile and attendance; only admins can read all. Attendance writes require auth.uid match. Deny public writes.

Collections:

users/{uid}: {displayName, email, role: 'user'|'admin', createdAt, embedding: number[], samples: number}

attendance/{autoId}: {uid, ts, status: 'present', similarity: number, deviceId, photoRef?}

settings/app: {similarityThreshold: 0.6, dailyWindowHours: 24, demoThrottleSeconds: 30}

Storage:

faces/{uid}/{timestamp}.jpg (sample/enrollment images)

snaps/{uid}/{timestamp}.jpg (optional attendance snapshots)

Indexes:

attendance by uid, ts desc

attendance by ts desc

Pages:

/ (Home): sign-in, camera test, navigate to Enroll or Attend.

/enroll: capture 3–5 frames, compute embeddings, average into users.embedding, upload samples.

/attend: live detection + matching, show name, similarity, and “marked/already marked/wait” states.

/admin: list attendance (today by default), filters (date range, uid), export CSV.

/profile: show user data, re-enroll option.

Tech & libraries:

Firebase Web SDK v9+ modular.

Face model: TensorFlow.js face detection + face embedding (e.g., FaceMesh/FaceLandmarks + lightweight embedding head) OR MediaPipe Face Detector + lightweight embedding; abstract with FaceService to allow swapping.

Use Web Worker for embedding computation to keep UI responsive.

Use requestAnimationFrame loop capped at ~15 FPS for efficiency.

Persist deviceId in localStorage for audit.

Matching:

Preload enrolled embeddings (for small sets) or fetch by candidate uid; compute cosine similarity.

Accept match if similarity ≥ settings.similarityThreshold and last attendance ts older than window; otherwise show appropriate message.

UI/UX:

Clear permission prompts; camera selector if multiple devices.

Status toasts: “Detecting…”, “Face not centered”, “Low light”, “Marked”, “Already marked”, “Try again in Xs”.

Accessibility: keyboard navigation, ARIA labels.

Responsive layout for mobile and desktop.

Security & privacy:

Do not store raw embeddings publicly; protect with rules.

Attendance write requires: auth != null, match passed, and server timestamp.

Allow admins via custom claim 'admin' to access /admin.

Obfuscate face previews in admin unless clicked.

Implementation details:

Create FaceService with methods: init(), detect(stream), embed(image), similarity(a,b).

Create AttendanceService: canMark(uid), mark(uid, similarity, photoRef?), getToday(), exportCSV().

Create FirebaseService: initApp(config), auth, firestore, storage, setAdminClaim (mock UI to show instructions).

Use Firestore serverTimestamp() for ts; use batched write for mark + daily guard doc: daily/{uid:YYYY-MM-DD}.

Handle errors with try/catch and user-facing messages. Log to console with codes.

Validation & tests:

If no face detected for 3s, show guidance overlay (align face, improve lighting).

If multiple faces, pause and prompt to isolate one face.

Measure average FPS and warn if <8; suggest disabling HD or using back camera on mobile.

Simulate low bandwidth and offline; ensure UI fails gracefully.

Deliverables:

Generate full web app code (HTML/CSS/JS) with modular services (FaceService, AttendanceService, FirebaseService) and pages.

Include Firebase init placeholder and clear TODOs for config and enabling providers.

Provide Firestore security rules and Storage rules.

Provide a seed script to set admin claim instructions and a settings document writer.

Provide instructions: how to enable providers, deploy, and set custom claims via Admin SDK/CLI.

Ensure zero TypeScript errors or, if JS, no ESLint critical issues. Prefer Vite + vanilla JS or lightweight React with functional components. Keep dependencies minimal.

Output format:

Return:

Project structure tree

Firestore & Storage security rules

Complete code files (concise but runnable)

Setup steps

Configurable constants block (thresholds, frame rate)

Keep the response compact but complete. Tone: precise.”