PharmaNear is a full-stack web application designed to bridge the gap between users searching for specific medicines and nearby pharmacies that stock them. It offers an intuitive search experience for users and a secure admin dashboard for pharmacy owners to manage inventory and profile details efficiently.
🌐 Live Demo: https://pharmanear-frontend.onrender.com
- 🔍 Smart Medicine Search: Search for medicines by name, dosage, and quantity.
- 🗺️ Interactive Map: View nearby pharmacies on a real-time map powered by Leaflet, showing stock status, prices, and availability.
- ⚡ Instant Results: Get real-time updates on medicine availability, pricing, and pharmacy details.
- 🔐 Secure Authentication: Dedicated login and signup for pharmacy accounts with JWT-based security.
- 📦 Inventory Management: Easily add, edit, or remove medicines, including stock quantities and pricing.
- 🏠 Profile Management: Update pharmacy information such as address, city, state, license number, and GPS coordinates for accurate location mapping.
| Layer | Technology | Key Libraries/Tools |
|---|---|---|
| Frontend | React (Vite) | React Router, Leaflet, React Icons |
| Backend | Node.js + Express | MongoDB, Mongoose, JWT, CORS |
| Database | MongoDB | Mongoose ODM (Models: Medicine, Pharmacy, Stock) |
| Styling | CSS | Modular, component-based styles |
| Deployment | Render | Full-stack deployment with static file serving |
Follow these steps to set up and run the project locally.
- Node.js (v18 or higher) - Download here
- MongoDB (local or cloud instance) - MongoDB Atlas for cloud setup
- Git - Download here
git clone https://github.com/your-username/pharmanear.git
cd pharmanearCreate .env files in both frontend/ and backend/ directories.
VITE_BACKEND_URL=http://localhost:5000PORT=5000
MONGO_URL=mongodb://localhost:27017/pharmanear
JWT_SECRET=your_super_secure_jwt_secret_key_here
CORS_ORIGIN=http://localhost:5173Note: Replace
your_super_secure_jwt_secret_key_herewith a strong, unique secret. For production, use environment variables provided by Render.
cd backend
npm install
npm start # or node server.jsThe backend will run on http://localhost:5000.
cd ../frontend
npm install
npm run devThe frontend will run on http://localhost:5173.
- Open http://localhost:5173 in your browser.
- For pharmacy admin features, sign up or log in as a pharmacy owner.
- User Search: Enter medicine details on the home page and click "Search Nearby" to view pharmacies on the map.
- Pharmacy Management: Log in as a pharmacy owner to add medicines, update stock, and edit profile details.
- Map Interaction: Click on map markers to view pharmacy details, including contact info and stock status.
Contributions are welcome! Please follow these steps:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature-name. - Commit your changes:
git commit -m "Add your feature". - Push to the branch:
git push origin feature/your-feature-name. - Open a Pull Request.
Please ensure your code follows the project's style guidelines and includes tests where applicable.
This project is licensed under the MIT License.
- Project Link: https://github.com/your-username/pharmanear
- Live Demo: https://pharmanear-frontend.onrender.com
- Issues: Open an issue on GitHub for bugs or feature requests.