A modern, responsive hyperlocal marketplace frontend built with Next.js 14, TypeScript, Tailwind CSS, and Firebase Authentication.
- Phone Number Login with OTP verification
- Google OAuth integration
- Session management with persistent login state
- Responsive authentication modals
- Product Catalog with category navigation
- Advanced Search with filter tabs (All/Shops/Products)
- Product Detail Pages with shop comparison
- Category & Subcategory browsing with filters
- Price Range, Brand, and Stock Status filters
- Sorting Options (Price, Rating, Newest)
- Responsive Design for all device sizes
- Lazy Loading for optimal performance
- SEO Optimization with meta tags and sitemaps
- 404 Error Handling with helpful navigation
- Loading States and smooth transitions
- Next.js 14 with App Router
- Image Optimization with lazy loading
- Code Splitting and bundle optimization
- Security Headers and CSP configuration
- Node.js 18.0 or higher
- npm or yarn
- Firebase Project with Authentication enabled
-
Clone the repository
git clone https://github.com/Vivek8968/localmarket-frontend.git cd localmarket-frontend
-
Install dependencies
npm install # or yarn install
-
Set up environment variables
cp .env.example .env.local
Edit
.env.local
with your Firebase configuration:NEXT_PUBLIC_FIREBASE_API_KEY=your_api_key NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN=your_domain NEXT_PUBLIC_FIREBASE_PROJECT_ID=your_project_id NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET=your_bucket NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID=your_sender_id NEXT_PUBLIC_FIREBASE_APP_ID=your_app_id
-
Run the development server
npm run dev # or yarn dev
-
Open your browser Navigate to http://localhost:3000
-
Create a Firebase Project
- Go to Firebase Console
- Create a new project or use existing one
-
Enable Authentication
- Navigate to Authentication > Sign-in method
- Enable Phone and Google providers
- Configure authorized domains
-
Get Configuration
- Go to Project Settings > General
- Copy the Firebase config object
- Add values to
.env.local
See FIREBASE_AUTH_SETUP.md for complete Firebase configuration instructions.
src/
βββ app/ # Next.js App Router
β βββ category/ # Category pages
β βββ product/ # Product detail pages
β βββ search/ # Search results page
β βββ globals.css # Global styles
β βββ layout.tsx # Root layout
β βββ page.tsx # Homepage
β βββ not-found.tsx # 404 page
β βββ sitemap.ts # SEO sitemap
β βββ robots.ts # SEO robots.txt
βββ components/ # Reusable components
β βββ auth/ # Authentication components
β βββ ui/ # UI components
β βββ Header.tsx # Main header
β βββ ProductCard.tsx # Product display
β βββ LazyImage.tsx # Optimized images
βββ contexts/ # React contexts
β βββ AuthContext.tsx # Authentication state
βββ lib/ # Utilities and config
β βββ firebase.ts # Firebase configuration
β βββ api.ts # API utilities
βββ types/ # TypeScript definitions
βββ index.ts # Type definitions
# Development
npm run dev # Start development server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
# Type checking
npm run type-check # Check TypeScript types
- Connect your GitHub repository to Vercel
- Add environment variables in Vercel dashboard
- Deploy automatically on push to main
- Build the project:
npm run build
- Upload the
.next
folder and other required files - Set environment variables
- Start with:
npm start
The application is fully responsive and optimized for:
- Mobile (320px+)
- Tablet (768px+)
- Desktop (1024px+)
- Large screens (1440px+)
- Firebase Authentication with secure token management
- Input validation and sanitization
- CSRF protection with Next.js built-in security
- Content Security Policy headers
- Secure session management
- Image lazy loading with Next.js Image component
- Code splitting with dynamic imports
- Bundle optimization with webpack
- Caching strategies for static assets
- SEO optimization with meta tags
The application includes:
- TypeScript for type safety
- ESLint for code quality
- Responsive design testing
- Authentication flow testing
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-feature
- Commit changes:
git commit -m 'Add new feature'
- Push to branch:
git push origin feature/new-feature
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For support and questions:
- Create an issue on GitHub
- Check the Firebase Auth Setup Guide
- Review the Implementation Summary
- User profiles and preferences
- Shopping cart functionality
- Order management
- Payment integration
- Real-time notifications
- Advanced analytics
- Multi-language support
Built with β€οΈ using Next.js, TypeScript, and Firebase