Swap is a marketplace + social discovery app .
Users can:
- Browse and search listings without signing in
- Swipe like/dislike on listings (sign-in required)
- Create listings with up to 5 images
- Send offers to sellers
- Chat in real-time style conversations between buyer and seller
- Manage account/profile, listings, favorites, offers, messages, and notifications
The app is built with Next.js + Convex + Convex Auth, and uses shadcn UI components.
- Frontend: Next.js 16 (App Router), React 19, TypeScript, Tailwind CSS v4
- UI: shadcn-style components in
components/ui, Lucide icons - Backend: Convex (database, queries, mutations, file storage)
- Auth: Convex Auth with:
- GitHub OAuth
- Email/password with verification code (OTP)
- Email provider: Resend (verification email delivery)
- Public browsing
- Home browse view with categories and featured listings
- Search route with advanced filters (location, price, payment type, condition)
- Product details route with image gallery and thumbnail navigation
- Swipe mode
- Tinder-style listing deck
- Like/dislike persisted in
swipes - Owner notifications created for likes/dislikes
- Listing onboarding
- Multi-step form (
/onboarding/listing) - Egypt city dropdown
- Multi-file image upload (max 5)
- Multi-step form (
- Offers
- Buyer creates offer from listing page
- Seller sees received offers in account area
- Messaging
- Start conversation from listing
- Send/receive messages
- Conversation unread tracking
- Account area
- Profile editing (name, phone, profile image upload)
- My listings, favorites, offers, messages, settings
Main routes:
/home (browse + swap views)/searchresults with advanced filtering/products/[id]listing details page (dynamic slug route)/signinauth page/onboarding/listingcreate listing flow
Account routes:
/account/account/my-listings/account/favorites/account/offers/account/messages/account/settings/account/blog
Note:
- There is no static
/productspage. Use/products/[slug].
Defined in convex/schema.ts.
Tables:
users(from Convex Auth tables)listingsswipesoffersnotificationsconversationsmessages
Important listing fields:
slug,title,categoryId,priceEgp,locationimages[],summary,descriptionpaymentType,conditionlikeCount,dislikeCount,isPublished
convex/listings.tslistPublic,listMine,listFavorites,getBySlug,create,swipe
convex/offers.tscreate,listReceived,updateStatus
convex/messages.tsstartConversation,listMine,getMessages,sendMessage,markConversationRead
convex/notifications.tslistMine,markAllRead
convex/users.tsme,updateProfile
convex/files.tsgenerateUploadUrl
Configured in convex/auth.ts.
Providers:
- GitHub OAuth
- Password auth with email verification code
Email verification:
- 6-digit code generated server-side
- Sent via Resend API
- Code expiry: 10 minutes
Copy .env.example to .env.local and fill values:
CONVEX_DEPLOY_KEY(for production/preview deploys)AUTH_GITHUB_IDAUTH_GITHUB_SECRETAUTH_RESEND_KEYAUTH_EMAIL_FROM
next.config.ts already allows remote images from Unsplash and Convex storage hosts.
- Install dependencies
npm install- Add env vars
cp .env.example .env.localThen edit .env.local.
- Start development
npm run devThis runs both:
- Next frontend
- Convex backend
npm run dev- run frontend + backend in parallelnpm run dev:frontend- Next.js dev servernpm run dev:backend- Convex dev servernpm run predev- Convex warmup/setup workflow + dashboardnpm run build- production buildnpm run start- run production servernpm run lint- ESLint
app/Next.js routes and pagescomponents/shared UI and layout componentscomponents/ui/shadcn-style primitivesconvex/backend queries/mutations/auth/schemalib/categories, Egypt cities, helperspublic/static assets
-
Next dev lock error (
.next/dev/lock)- Another Next instance is running. Stop old process and restart.
-
next/imagehost not configured- Add host to
next.config.ts > images.remotePatterns.
- Add host to
-
Auth email sends but no sign-in
- Confirm
AUTH_RESEND_KEYandAUTH_EMAIL_FROMare valid. - Make sure provider config in
convex/auth.tsmatches your flow.
- Confirm
-
TypeScript/Convex errors after schema changes
- Restart Convex dev and regenerate types if needed:
npx convex dev- Guests can browse/search freely.
- Sign-in is required for:
- Swiping like/dislike
- Creating listings
- Sending offers/messages
- Swiping your own listing is ignored safely (no crash).
- Listing image upload supports up to 5 files.
Private project.