A comprehensive MERN stack mobile phone information and comparison platform tailored for users in Pakistan. This website integrates a machine learning model for enhanced phone recommendations and features.
- User Authentication: Signup, login, and Google login (planned)
- Phone Browsing: Browse phones by price sections
- Product Comparison: Compare multiple phones side-by-side
- News & Blog: Professional news section with detailed pages
- Reviews: User reviews with detailed review pages
- Favorites Management: Save favorite products
- Admin Panel: Manage products, news, and reviews
- Additional Pages: Contact, About Us, Privacy Policy, Careers, Terms & Conditions, Warranty Check, Block Stolen Phone
- Floating Chatbot: AI-powered assistance for users
- Machine Learning Integration: AI model for personalized phone recommendations
- Responsive design for mobile and desktop
- Real-time data updates
- Secure authentication and data handling
- Admin controls for content management
- React (functional components with hooks)
- React Router for client-side routing
- Axios for API communication
- Context API for state management (authentication)
- CSS Modules for styling
- Vite for development and build
- Node.js with Express.js
- MongoDB with Mongoose for data modeling
- JWT for authentication
- bcrypt for password hashing
- Python with machine learning libraries
- Waitress API server for model serving
- Connected to MERN stack via REST API
phonefinder_website/
├── client/ # React frontend
│ ├── src/
│ │ ├── components/ # Reusable UI components
│ │ ├── pages/ # Main page components
│ │ ├── context/ # React Context (Auth)
│ │ ├── assets/ # Static assets
│ │ └── ...
│ ├── public/ # Public static files
│ └── package.json
├── backend/ # Express backend
│ ├── controllers/ # Route controllers
│ ├── models/ # Mongoose models
│ ├── routes/ # API routes
│ ├── index.js # Server entry point
│ └── package.json
└── README.md
phonefinderai-v6/ # Machine Learning Model (separate repo)
├── ... # Python ML code
└── ... # Waitress API server
- Node.js (v16 or higher)
- MongoDB
- Python (v3.8 or higher)
- Git
-
Clone both repositories into the same parent folder:
mkdir phonefinder_project cd phonefinder_project git clone https://github.com/zainlatif/phonefinder_website.git git clone https://github.com/zainlatif/phonefinderai-v6.git -
Setup Backend:
cd phonefinder_website/backend npm install # Configure MongoDB connection in index.js npm start
-
Setup Frontend:
cd ../client npm install npm run dev -
Setup Machine Learning Model:
cd ../../phonefinderai-v6 # Follow setup instructions in phonefinderai-v6 README # Typically: pip install -r requirements.txt # python app.py # or however the waitress server is started
Create .env files in backend and ML model directories as needed for database connections, API keys, etc.
The MERN stack communicates with the machine learning model via REST API calls served by the Waitress server. The ML model provides personalized recommendations based on user preferences and phone data.
/api/products- Product management/api/news- News CRUD/api/reviews- Review management/api/users- User authentication and profiles/api/recommendations- ML-powered recommendations (from ML model)
- Start the backend server
- Start the frontend development server
- Start the ML model API server
- Access the website at
http://localhost:5173(default Vite port)
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
For questions or support, please contact the development team.
Developer:
- GitHub: zainlatif
- LinkedIn: zainlatif702
Note: Keep both phonefinder_website and phonefinderai-v6 repositories in the same parent folder for proper integration and API communication.
- NewsDetail: Full news article view (dynamic route)
- Review: Reviews listing with pagination and admin controls
- ReviewDetail: Full review view (dynamic route)
- FavorateProduct: User's favorite products
- Blockphone: Instructions for blocking a stolen phone
- ContactUs: Contact form/info
- PrivacyPolicy: Privacy policy page
- Careers: Careers/jobs page
- TermCondition: Terms and conditions
- WarrantyCheck: Warranty check tool
- AboutUs: About the website/company
Components (src/components/):
- Header/Footer: Site navigation and footer
- Card: Product card
- Banner: Promotional or informational banner
- FloatingChatbot: Chatbot for user help
- NewsCard/ReviewCard: (Recommended) For professional card display in News/Review sections
Dynamic Pages/Props:
SectionProductsusessectionKeyparam for filteringNewsDetailandReviewDetailuse:idparam for fetching single item
- Express server (index.js)
- MongoDB via Mongoose for all data (users, products, news, reviews)
- Routes:
/api/products– Product CRUD/api/news– News CRUD, get all, get by ID/api/reviews– Review CRUD, get all, get by ID/api/users– Signup, login, get/update/delete user, manage favorites
- Connection:
- MongoDB URI from
.env - Server starts after successful DB connection
- MongoDB URI from
1. Clone the repository
2. Install dependencies:
cd backend
npm install
cd ../client
npm install3. Setup environment variables:
- Create
.envin backend with at least:MONGO_URI=your_mongodb_connection_string PORT=5000
4. Start backend:
cd backend
npm start5. Start frontend:
cd client
npm run dev6. Open in browser:
Visit http://localhost:5173 (or the port Vite shows) for the frontend.
Backend runs on http://localhost:5000 by default.
Note:
- For Google login, further setup is required (see earlier instructions).
- Admin features are visible only to users with the
adminrole. - All API endpoints are prefixed with
/api/.
This documentation provides a full technical summary for developers and maintainers of your MERN stack website.