A complete Next.js frontend for a hyperlocal marketplace platform that connects customers with nearby shops and local businesses. This is a modern, responsive web application built with TypeScript, Tailwind CSS, and Firebase Authentication.
- Firebase Authentication with Google Login & Phone OTP
- Role-based access control (Customer, Seller, Admin)
- Protected routes with automatic redirects
- Geolocation-based Shop Discovery: Find nearby shops using browser location
- Product Search & Filtering: Search products by name, category, or shop
- Shop & Product Details: Detailed pages with contact information
- WhatsApp Integration: Direct contact with shop owners
- Category Browsing: Browse products by categories
- Shop management interface
- Product inventory overview
- Sales statistics and analytics
- Add/edit products with image upload
- Complete system oversight
- Shop approval/rejection management
- Category management
- System activity logs and monitoring
- User management
- Framework: Next.js 15.3.3 with TypeScript
- Styling: Tailwind CSS (fully responsive)
- Authentication: Firebase Authentication
- State Management: React Context API
- HTTP Client: Axios
- Icons: Lucide React
- Routing: Next.js App Router with dynamic routes
- Node.js 18+
- npm or yarn
- Firebase project (for authentication)
-
Clone the repository
git clone https://github.com/Vivek8968/hyperlocal-frontend-allhands.git cd hyperlocal-frontend-allhands
-
Install dependencies
npm install # or yarn install
-
Environment Setup
Copy the example environment file:
cp .env.example .env.local
Update
.env.local
with your configuration:NEXT_PUBLIC_BACKEND_URL=https://your-backend-url.com NEXT_PUBLIC_FIREBASE_API_KEY=your_firebase_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_project.firebaseapp.com NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_project.appspot.com NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=123456789 NEXT_PUBLIC_FIREBASE_APP_ID=1:123456789:web:abcdef
-
Run the development server
npm run dev # or yarn dev
-
Open your browser Navigate to http://localhost:3000
For testing purposes, the application includes demo accounts:
- Phone: +1234567890
- Role: Customer
- Access: Browse shops, view products, contact sellers
- Phone: +1234567891
- Role: Seller
- Access: Manage shop, add/edit products, view analytics
- Phone: +1234567892
- Role: Admin
- Access: Full system access, manage shops, categories, users
src/
βββ app/ # Next.js App Router pages
β βββ admin/ # Admin dashboard
β βββ login/ # Authentication page
β βββ product/[id]/ # Product detail page
β βββ search/ # Search & filtering
β βββ seller/ # Seller dashboard
β βββ shop/[id]/ # Shop detail page
β βββ layout.tsx # Root layout
βββ components/ # Reusable UI components
β βββ Navbar.tsx # Navigation header
β βββ Footer.tsx # Site footer
β βββ ShopCard.tsx # Shop display card
β βββ ProductCard.tsx # Product display card
β βββ ProtectedRoute.tsx # Route protection
β βββ ...
βββ contexts/ # React contexts
β βββ AuthContext.tsx # Authentication state
βββ data/ # Mock data for development
β βββ mockData.ts # Sample shops, products, users
βββ lib/ # Utility libraries
β βββ api.ts # API client configuration
β βββ firebase.ts # Firebase configuration
β βββ types.ts # TypeScript type definitions
βββ styles/ # Global styles
βββ globals.css # Tailwind CSS imports
This frontend is designed to work with the FastAPI backend: π Backend Repository: https://github.com/Vivek8968/hyperlocalbymanus.git
/customer_service/shops
- Get nearby shops/seller_service/inventory
- Manage products/admin_service/shops
- Admin shop management/user_service/auth/verify-token
- User authentication
- Responsive Design: Works seamlessly on mobile and desktop
- Modern UI: Clean, professional design with Tailwind CSS
- Loading States: Smooth loading indicators for better UX
- Error Handling: Comprehensive error messages and fallbacks
- Accessibility: ARIA labels and keyboard navigation support
- JWT Token Management: Secure token storage and refresh
- Role-based Access Control: Granular permissions system
- Input Validation: Client-side and server-side validation
- Secure Headers: CORS and security headers configuration
The application includes comprehensive mock data for development:
- 6 Sample Shops with different categories and locations
- 20+ Products across electronics, grocery, fashion categories
- 3 User Roles with different permission levels
- System Activity Logs for admin monitoring
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main branch
The app can be deployed on any platform that supports Next.js:
- Netlify
- AWS Amplify
- Railway
- DigitalOcean App Platform
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with Next.js
- Styled with Tailwind CSS
- Icons by Lucide
- Authentication by Firebase
π Live Demo: [Coming Soon]
π§ Support: support@localmarket.com
π Issues: GitHub Issues