AuraMatch

byBADSHAH KHAN

Act as a Principal Software Architect and Full-Stack Mobile Engineer. I want to build a Minimal Viable Product (MVP) for a highly secure, localized "Social Dating & Incognito Voice Matching" app tailored for the Pakistani market, inspired by Nudge and AARS Innovations. Do NOT write any UI design, styling, or CSS code. Instead, design a robust, production-grade MVP functional architecture, technical workflow, and database schema. The application uses React Native (Expo) for the frontend, Firebase (Firestore & Cloud Functions) for the backend, and Agora.io for WebRTC real-time voice communications. --- ### 1. MVP SCOPE & FUNCTIONAL SPECIFICATION The MVP must support exactly three high-impact, functional flows: 1. **Intentional "Nudge" Matchmaking:** Instead of swiping, users can browse cards containing specific user prompts/icebreakers. They must spend a "Nudge token" (limited daily supply) to request a connection. 2. **Incognito Random Voice Matching:** An anonymous 1-on-1 voice queue matching system with gender filters. 3. **Dual-Opt-In Identity Reveal:** During the anonymous call, users must both click "Reveal" to exchange full profiles. --- ### 2. CORE WORKFLOWS & LOGICAL STATE MACHINES #### Workflow A: The Incognito Voice Matching Pipeline Design a step-by-step logic gate and connection state machine for the voice queue: - **State 1: Queue Entry:** User requests a match with parameters: `userId`, `userGender`, `targetGenderPreference`. - **State 2: Matchmaking Engine (FIFO Queue):** Explain the priority-matching algorithm using Firestore. How does it pair User A and User B where: - `UserA.targetGenderPreference === UserB.userGender` AND `UserB.targetGenderPreference === UserA.userGender`. - **State 3: Call Initialization:** Trigger Agora RTC token generation via a Firebase Cloud Function, assigning both users to a unique `roomId`. - **State 4: The 180-Second Call State:** Start a 3-minute timer. During this, user profiles, avatars, and real names are hidden behind generic placeholders. - **State 5: The "Reveal" Consent Gate:** - If both users tap "Reveal" before the timer ends -> Transition to **"Matched" State** (unlock chat, exchange real user profiles). - If the timer expires or either user hangs up before mutual consent -> Transition to **"Destroy Room" State** (disconnect call, wipe queue status, return to dashboard). #### Workflow B: The Nudge-Chat Request Loop - User A views User B's prompt-based profile card. - User A taps "Nudge" -> Deducts 1 token from User A's daily `tokenBalance` -> Writes to `nudgeRequests` database. - User B receives a Push Notification. - User B accepts -> Unlocks direct chat. User B declines -> Request is deleted, token is NOT refunded to prevent spamming. --- ### 3. BACKEND & DATABASE ARCHITECTURE (FIRESTORE SCHEMA) Provide a complete, structured, JSON-like NoSQL database schema for Google Cloud Firestore to support this MVP. Explicitly list the fields, types, and document relations for: 1. **`users` (Collection):** - Essential fields for verification, gender, location, daily nudge tokens, and privacy flags. 2. **`voice_queue` (Collection):** - Active users waiting for a call. Fields must track timestamp, connection status, room reference, and matching criteria. 3. **`calls` (Collection):** - Active call sessions, Agora channel IDs, and individual reveal consents. 4. **`nudges` (Collection):** - Tracks incoming requests, statuses (pending/accepted/rejected), and initiator details. 5. **`conversations` & `messages` (Sub-collections):** - Chat structure after matches are secured. --- ### 4. OUTPUT REQUIREMENTS - Provide the complete architectural workflows described step-by-step. - Provide the exact Firebase database structures with data types (e.g., string, boolean, timestamp, reference). - Outline the backend logic required for the Firebase Cloud matching function in pseudo-code. - Do NOT include any visual layouts, Tailwind configurations, React Native screen components, color schemes, or buttons. Focus entirely on structural, workflow, and backend database design.

Landing
Landing

Comments (0)

No comments yet. Be the first!

Project Tasks

No tasks generated yet.

Tasks will appear here as requirements are defined.

Landing design preview
Landing: View Info
Login: Sign In
Queue: Set Gender Filter
Queue: Enter Voice Queue
Call: Join Anonymous Call
Call: View Timer
Call: Tap Reveal
Call: Wait Mutual Consent
Profile: View Revealed Profile
Call: Room Destroyed
Call: End Call Early
Dashboard: Return Home
Landing design preview
Landing: View Info
Login: Sign In
Queue: Set Gender Filter
Queue: Enter Voice Queue
Call: Join Anonymous Call
Call: View Timer
Call: Tap Reveal
Call: Wait Mutual Consent
Profile: View Revealed Profile
Call: Room Destroyed
Call: End Call Early
Dashboard: Return Home