Spaces:
Running

SameerArz commited on
Commit
eb66d76
·
verified ·
1 Parent(s): d82c543

You are VibeCoder — a full-stack production AI that builds modern, mobile-first, privacy-respecting web apps. Build a complete dating website called **SparkMeet** aimed at **Gen Z (ages 18–26)**. The deliverable must be a production-ready, accessible, performant, and secure full-stack app (frontend + backend + database + infra + tests + documentation). Use modern tech: React + TypeScript (Next.js recommended for SSR/edge), Tailwind CSS for styling, Prisma or an ORM for DB, PostgreSQL (or Supabase/PlanetScale), Redis for caching & rate limits, WebSocket (or Supabase Realtime) for chat, S3 (or equivalent) for images. Provide a runnable repo layout, README, and end-to-end tests.

Browse files

--- PRODUCT VISION
- Short pitch: SparkMeet — a playful, safe, swipeable dating app for Gen Z that focuses on authenticity, micro-vibes, and fast matches.
- Tone & Branding: playful, concise, inclusive. Use short microcopy and emojis sparingly. UI: rounded cards, neon gradient accents (pink/purple/teal), large tappable targets.
- Target: mobile-first progressive web app (works on desktop & mobile).

--- CORE MVP FEATURES (must implement)
1. Onboarding / Auth
- Email + password (strong password rules) + email verification.
- OAuth 2.0 options: Google & Apple (if available).
- Phone number + OTP or passwordless email as an option.
- Age verification (users must be >= 18) — soft: date of birth input; hard: optional ID/photo check flows.
2. Profile
- Multi-photo upload (max 10), photos stored on S3 with signed uploads.
- Bio, pronouns, location (city), age, interests (tag list), Spotify/Instagram optional links, study/work info.
- "Vibe badges" (fun little tags) and 3-sentence “Sparkline” — concise highlight visible in cards.
3. Discovery
- Swipe interface + grid/list mode.
- Filters: distance, age range, interests, online now.
- “Spark” mechanic: a paid or earned boost that increases visibility.
4. Matching
- Mutual likes create a Match — open match chat.
- Notification on match + celebratory modal/UI.
5. Chat
- Real-time messaging via WebSocket or WebRTC data channels.
- Read receipts, typing indicator, image support, message delete for own messages.
- Safety commands: report, block, mute.
6. Safety & Moderation
- Content moderation pipeline for images and text (automated + human queue).
- Report/Block flows, rate limiting, anti-spam heuristics.
7. Monetization (optional basic)
- Subscriptions (monthly) + in-app credits ("Sparks" to boost).
- Stripe integration for payments.
8. Notifications & Emails
- Push notifications (web push + mobile) and transactional emails.
9. Admin Dashboard
- User search, reports queue, content moderation, ban/unban, analytics.
10. Metrics & Analytics
- Event tracking (profile_view, like, match, message_sent, report_submitted) suitable for Mixpanel/Amplitude.

--- DESIGN & UI SYSTEM
- Component library: Button, Card, Avatar, Modal, Input, Toggle, Tag, Badge, Toast.
- Responsive breakpoints; mobile-first.
- Accessibility (a11y): proper aria labels, keyboard navigation, color contrast, focus states.
- Animations: subtle microinteractions on like/match using Lottie or CSS transforms.

--- DETAILED PAGE & UI COMPONENTS (with **every** button + exact behavior)

1) Landing / Home (unauthenticated)
- Buttons:
- `Sign Up` -> opens onboarding modal. Behavior: opens `/signup` route. Track event: `cta_signup_clicked`.
- `Log In` -> opens login modal. Behavior: `/login`. Track `cta_login_clicked`.
- `Learn More` -> scroll or route to features section. Track `cta_learn_more`.
- SEO meta tags and social preview.

2) Onboarding (Signup flow)
- Inputs: email, DOB, password OR OAuth flow buttons.
- Buttons:
- `Continue` (on each step) -> validate inputs client-side, call `/api/auth/signup/step` with payload, show loader, on success go next. Analytics `onboarding_step_completed` with properties {step, method}.
- `Use Google` / `Use Apple` -> trigger OAuth popup, on success complete onboarding server side and redirect to profile builder.
- `Back` -> navigate to previous step, save partial state in localStorage.
- `Skip` (for optional steps) -> store default values and continue.
- Validation: strong password rules, DOB => must be >= 18 else show friendly rejection modal with help.

3) Profile Builder
- Buttons:
- `Upload Photo` (per slot) -> open image picker, client validates file type/size, then uploads via signed URL to S3: PUT signed URL. After upload, POST `/api/users/{id}/photos` to register. Show progress and allow reorder. Immediately run image moderation; if blocked, notify user and remove photo.
- `Save Profile` -> PUT `/api/users/{id}` with full profile JSON. On success show toast "Profile saved".
- `Add Badge` -> opens tag selector modal; PUT update profile interests.
- `Preview Profile` -> open public view page; track `profile_preview`.
- Edge cases: network failure -> retry modal with retry/back options.

4) Discovery / Swipe Screen (primary)
- Layout: central card with person profile; swipe gestures (touch, mouse drag) + buttons under the card.
- Buttons (explicit list with behavior):
- `X / Pass` button:
- UI: visible, accessible label `Pass`.
- Action: optimistic UI remove card, POST `/api/discovery/pass` payload {userId, targetId}. If response error, revert card and show error toast. Track `discovery_pass`.
- `Like` (heart):
- UI: toggleable, triggers animation.
- Action: optimistic UI mark liked. POST `/api/matches/like` with {fromUserId, toUserId}. If response returns `{match: true, matchId}`, open Match modal that prompts "You matched — Send a message". Create a conversation in DB and navigate to chat if user clicks. Track `discovery_like` with property {match: boolean}.
- `SuperSpark` (special):
- UI: uses Sparks credit or subscription. If user has credits, pressing consumes credit and sends a stronger signal. POST `/api/matches/superspark`. Show confirmation modal with microcopy and animation. Track `discovery_superspark`.
- `Info` (i icon):
- Opens detailed overlay with more profile fields and common interests. Track `discovery_info_open`.
- Swipe gestures:
- Right = Like, Left = Pass, Up = SuperSpark. On each gesture, call the same endpoints as corresponding buttons. Debounce swipes to prevent accidental repeats.

5) Profile Card (viewing someone)
- Buttons:
- `Message`:
- Enabled only if matched. If not matched, button text `Like to Match` and clicking performs like flow.
- If matched, opens chat window, focus input. Track `profile_message_open`.
- `Spark` icon on card:
- Behavior same as SuperSpark.
- `Report`:
- Opens report modal to select reason (harassment, nudity, fake profile, minors, spam). On submit: POST `/api/reports` with last messages & last 5 photos metadata. Immediately create moderation ticket, optionally auto-suspend if severe reason. Track `profile_report_submitted`.
- `Block`:
- POST `/api/users/{me}/block` -> server adds block and prevents recommendations/messages. Client hides the user and shows undo toast `User blocked`.
- `Follow` (if you want social features) — optional.

6) Chat / Messaging
- Buttons and behaviors:
- `Send` (text):
- Enabled when input non-empty. Action: optimistic append message to chat UI with temporary id, send over WebSocket `message_send` event and fallback to POST `/api/messages` if socket fails. On ACK replace temp id with real id. Track `message_sent` with length properties.
- Validation: check for banned words; block sending or flag if present.
- `Attach Photo`:
- Similar to profile photo upload; upload signed URL then send image message. Moderation pipeline runs; if flagged, remove message and notify both users if required.
- `Delete` (own message):
- Sends DELETE `/api/messages/{id}`; client hides message and shows "Message deleted". Server keeps audit copy for moderation but hides content from the other user.
- `Block/Report` (within chat):
- Same endpoints as profile, but attach last 10 messages to the report payload automatically.
- `Start Video Date`:
- If both agree, start WebRTC flow via signaling server. Button `Start Video` triggers call offer, sends push to other user; state in DB: `call_request`. Track `video_call_requested`.

7) Settings & Account
- Buttons:
- `Change Password` -> form with current/new/confirm and validation. POST `/api/auth/change-password`.
- `Delete Account` -> requires password confirm and shows 2-step modal. DELETE `/api/users/{id}` (soft delete: mark as deleted, anonymize). Provide grace period before permanent deletion.
- `Privacy Settings` toggles:
- `Show me in Discovery` toggle -> PUT `/api/users/{id}/privacy`.
- `Allow message from non-matches` toggle -> PUT.
- `Manage Subscription` -> links to billing portal (Stripe) or shows plan details.
- `Export My Data` -> triggers job and email with ZIP (GDPR request), track `data_export_requested`.

--- API DESIGN (examples)
- `POST /api/auth/signup` {email, password, dob} -> 201 {userId, nextStep}
- `POST /api/auth/login` {email, password} -> {token, refreshToken, expiresAt}
- `GET /api/discovery?cursor=...&filters=...` -> list of profiles
- `POST /api/matches/like` {fromUserId, toUserId} -> {match: boolean, matchId?: string}
- `POST /api/matches/superspark` {fromUserId, toUserId} -> {success, boostExpiresAt}
- `POST /api/messages` {conversationId, from, text, attachments[]} -> {messageId, createdAt}
- `POST /api/reports` {reporterId, targetId, reason, context: {messages[], photos[]}} -> {ticketId}
- `PUT /api/users/{id}` -> update profile
- `POST /api/uploads/signed-url` {filename, type} -> {url, key}

Include auth middleware (JWT + refresh tokens), RBAC for admin endpoints.

--- DATABASE SCHEMA (core tables)
- `users` (id, email, passwordHash, dob, displayName, pronouns, locationCity, createdAt, deletedAt, isBanned, lastActiveAt)
- `profiles` (userId FK, bio, sparkline, badges JSON, interests JSO

1 file changed +353
discovery.htmlAdded+353