NEARBUY — MASTER AI DEVELOPMENT PROMPTS Project: NearBuy Slogan: Buy Nearby. Sell Anywhere. Technology: Next.js, TypeScript, GitHub, Cloudflare Target: Worldwide marketplace Design: Premium, modern, responsive, mobile-first. GLOBAL INSTRUCTION Use these rules for every development stage: - Build a real working application, not a static demo. - Inspect existing files before changing anything. - Preserve existing Cloudflare deployment. - Use TypeScript and clean, reusable components. - Make the interface responsive on Android, iPhone and desktop. - Do not delete working features. - Never expose API keys, passwords or secrets. - Do not use fake functionality where a real implementation is required. - Test every feature before moving to the next stage. - Explain which files you created or modified. - Give me commands to run and instructions to test. - Commit changes to GitHub in small stages. - Never deploy breaking changes directly to production. --- PHASE 1 — PROJECT FOUNDATION PROMPT 1: Inspect my existing project I have an existing Next.js application deployed on Cloudflare and connected to GitHub. Inspect the entire project structure. Identify: - Next.js version. - React version. - TypeScript configuration. - Existing deployment adapter. - Cloudflare configuration. - Existing routes and components. - Installed dependencies. - Existing errors. Do not modify anything yet. Give me a report and recommend the safest development approach for this existing project. PROMPT 2: Prepare the NearBuy foundation Turn my existing project into the foundation of a professional international marketplace called NearBuy. Use my existing working Cloudflare deployment setup. Create a clean application architecture with: - App routes. - Components. - Shared layouts. - Reusable UI elements. - Database integration folder. - Authentication folder. - API routes. - Utility functions. - Type definitions. Use TypeScript. Do not remove existing deployment configurations. PROMPT 3: Create NearBuy branding Create a professional brand identity. Brand name: NearBuy. Slogan: Buy Nearby. Sell Anywhere. Design: - Modern green and white branding. - Clean typography. - Professional shopping experience. - Location-inspired logo. - Rounded product cards. - Beautiful buttons. - Modern navigation. - Subtle animations. Make it look like a serious international technology company. --- PHASE 2 — HOMEPAGE DESIGN PROMPT 4: Build the homepage Build a beautiful, professional NearBuy homepage. Include: 1. NearBuy logo. 2. Search bar. 3. Location selector. 4. Categories. 5. Featured products. 6. Recently added products. 7. Nearby sellers. 8. Popular locations. 9. Promotional section. 10. Footer. Add a mobile navigation bar. Use responsive layouts. Make all buttons and navigation links functional. Use realistic sample products temporarily, clearly separated from production data. PROMPT 5: Product categories Create these categories: - Phones and electronics. - Vehicles. - Fashion. - Shoes. - Furniture. - Property. - Home appliances. - Computers. - Beauty. - Sports. - Baby products. - Tools and equipment. - Other items. Each category should have an icon, title and working filtering functionality. Allow users to browse products by category. PROMPT 6: Product cards Create reusable product cards. Each card must show: - Product picture. - Product name. - Price. - Currency. - Seller name. - Approximate location. - Distance from buyer. - Product condition. - Favourite button. Add a product details page when a card is clicked. Make the cards attractive on mobile and desktop. --- PHASE 3 — DATABASE AND BACKEND PROMPT 7: Connect Cloudflare D1 Set up Cloudflare D1 as the main marketplace database. Create database migrations for: 1. Users. 2. Products. 3. Product images. 4. Categories. 5. Locations. 6. Conversations. 7. Messages. 8. Favourites. 9. Reviews. 10. Reports. Create appropriate primary keys, foreign keys, indexes and timestamps. Use secure database queries. Generate TypeScript database types. Do not expose database credentials. PROMPT 8: User authentication Implement real user registration and login. Features: - Email registration. - Secure password hashing. - Login. - Logout. - Session management. - Forgot password. - Password reset. - Email verification. - User profile. Protect private pages. Never store plain-text passwords. Use an authentication solution compatible with our Cloudflare runtime and database. PROMPT 9: User profiles Build public seller profiles. Include: - Profile photograph. - Seller display name. - Country. - City or general area. - Member since. - Number of listings. - Seller ratings. - Verification status. - Active products. Allow users to edit their own profile. Never allow one user to edit another user's private account information. --- PHASE 4 — SELLING SYSTEM PROMPT 10: Post a product Build a complete product upload page. Allow sellers to: - Enter product name. - Select category. - Upload up to 10 photographs. - Enter price. - Select currency. - Write description. - Select condition. - Select country. - Select city. - Set approximate location. - Submit listing. Validate all required information. Save products to Cloudflare D1. PROMPT 11: Cloudflare R2 image storage Connect Cloudflare R2 for product image storage. Implement: - Secure image uploads. - Image validation. - Image size restrictions. - Image previews. - Multiple product images. - Secure upload authorization. - Image deletion when appropriate. Never expose private R2 credentials in frontend code. PROMPT 12: Manage my products Create a seller dashboard. Allow sellers to: - View their listings. - Edit products. - Delete products. - Mark products as sold. - Pause listings. - View enquiries. - View product statistics. Only the owner of a listing can modify it. --- PHASE 5 — LOCATION MARKETPLACE PROMPT 13: Location permission Implement browser geolocation. Ask users for permission before accessing their location. Allow users to: - Use current location. - Search for a city. - Select a country. - Enter a location manually. If location permission is denied, the marketplace must still work. Never reveal a seller's exact residential coordinates publicly. PROMPT 14: Nearby product discovery Build a nearby marketplace. Allow buyers to find products within: - 1 km. - 5 km. - 10 km. - 20 km. - 50 km. - 100 km. - Worldwide. Calculate distances correctly. Use latitude and longitude for geographic searching. Only show approximate seller locations publicly. PROMPT 15: Interactive marketplace map Integrate a suitable map provider. Create a map displaying nearby product markers. Features: - Zoom. - Search. - Product markers. - Product previews. - Distance filters. - Current location. - Nearby seller discovery. Clicking a product marker should open its product details. Use a map provider that supports international locations. --- PHASE 6 — BUYER AND SELLER COMMUNICATION PROMPT 16: Buyer and seller chat Create a real messaging system. Allow buyers and sellers to: - Start conversations. - Send messages. - View conversation history. - Receive new message notifications. - See message timestamps. - Block suspicious users. - Report abusive conversations. Use a suitable Cloudflare-compatible real-time messaging architecture. Protect conversations so only participants can access them. PROMPT 17: Contact seller Create a contact seller feature. Add: - Message seller. - Ask about product. - Negotiate price. - Arrange meetup. - Share optional meeting location. Do not automatically expose personal phone numbers. PROMPT 18: Live product demonstration Build a feature that allows sellers to demonstrate their products through live video. Support: - Start live session. - Join live session. - End session. - Live session status. - Product attached to live session. Use an appropriate video streaming provider. Do not simulate real video using static images. --- PHASE 7 — TRUST AND SAFETY PROMPT 19: Seller verification Create a seller verification system. Include: - Email verification. - Phone verification. - Optional identity verification. - Verification status. - Admin approval. Never display sensitive identity documents publicly. PROMPT 20: Reviews and ratings Allow buyers to rate sellers. Include: - Five-star ratings. - Written reviews. - Review dates. - Seller average rating. Only permit reviews from eligible buyers with genuine interactions. Prevent duplicate and abusive reviews. PROMPT 21: Reporting and moderation Create a reporting system. Users can report: - Fraudulent products. - Fake sellers. - Suspicious prices. - Counterfeit goods. - Abusive messages. - Inappropriate content. Create an administrator moderation dashboard. Allow administrators to investigate, suspend and remove listings. --- PHASE 8 — INTERNATIONAL MARKETPLACE PROMPT 22: Worldwide currencies Support international currencies. Include: - USD. - EUR. - GBP. - NGN. - CAD. - AUD. - ZAR. - GHS. - KES. Display prices using the correct currency format. Do not assume every user uses the same currency. Add optional currency conversion using a reliable exchange-rate provider. Clearly distinguish converted estimates from the seller's actual asking price. PROMPT 23: International countries and locations Support country and city selection worldwide. Include: - Country selector. - City selector. - Regional searching. - Location-based filters. - Country-specific currency. Design the database to support international expansion. PROMPT 24: Language support Prepare NearBuy for multiple languages. Start with: - English. - French. - Spanish. - Portuguese. Make the application easy to translate without duplicating pages. --- PHASE 9 — ADMINISTRATION AND BUSINESS PROMPT 25: Admin dashboard Create a secure administrator dashboard. Display: - Total registered users. - Total sellers. - Total buyers. - Total listings. - Active listings. - Sold listings. - Reported listings. - Suspended accounts. - Recent registrations. Allow authorized administrators to manage the marketplace. PROMPT 26: Monetization Prepare NearBuy for revenue generation. Create support for: - Featured listings. - Promoted products. - Seller subscriptions. - Business seller accounts. - Advertising placements. Keep ordinary marketplace browsing free. Do not charge users until payment integration is properly configured and tested. PROMPT 27: Payment integration Prepare a secure payment architecture. Support a payment provider suitable for the countries where NearBuy operates. Include: - Payment initialization. - Payment verification. - Transaction history. - Refund handling. - Webhook verification. Never trust frontend payment success messages. Do not store card details. Keep in-person cash payments available as an option. --- PHASE 10 — FINAL TESTING AND LAUNCH PROMPT 28: Security audit Audit the entire application. Check: - Authentication. - Authorization. - Database permissions. - File uploads. - API security. - Input validation. - Rate limiting. - Spam prevention. - Location privacy. - Admin permissions. - Secret management. Fix identified vulnerabilities before launch. PROMPT 29: Mobile optimization Optimize NearBuy for Android and iPhone. Test: - Small screens. - Large screens. - Slow internet. - Image loading. - Navigation. - Product uploads. - Location permissions. - Chat interface. Make the marketplace fast and easy to use. PROMPT 30: Final deployment Prepare NearBuy for production on Cloudflare. Check: - Build succeeds. - Database migrations are applied. - R2 storage works. - Environment variables are configured. - Authentication works. - Product uploads work. - Location searching works. - Messaging works. - Security checks pass. Connect deployment to GitHub. Deploy a preview first, test it, and only then promote it to production. Provide a final deployment report and list any remaining limitations. --- FINAL DEVELOPMENT INSTRUCTION Build NearBuy as a complete, professional international marketplace. Do not skip development stages. Do not claim that a feature is complete until it has been implemented and tested. Maintain a README.md with setup instructions, database migrations, environment variables and deployment instructions. At the end of every phase, summarize completed work and wait for my approval before proceeding to the next phase. The final product must be a real, functional marketplace, not just a visual prototype. NEARBUY — BUY NEARBY. SELL ANYWHERE.