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 |
PharmaNear/
├── backend/ # Node.js & Express server
│ ├── config/ # DB connection & Passport/Auth config
│ ├── controllers/ # Request handling logic
│ ├── models/ # Mongoose Schemas (Medicine, Pharmacy, Stock)
│ ├── routes/ # API Endpoints
│ └── middleware/ # Auth & Error handling
├── frontend/ # React + Vite application
│ ├── src/
│ │ ├── components/ # Reusable UI (Navbar, Map, Search)
│ │ ├── pages/ # View components (Home, Dashboard)
│ │ └── api/ # API service calls
│ └── public/ # Static assets
└── .env.example # Template for environment variables
## 🚀 Getting Started
Follow these steps to set up and run the project locally.
### Prerequisites
- **Node.js** (v18 or higher) - [Download here](https://nodejs.org/)
- **MongoDB** (local or cloud instance) - [MongoDB Atlas](https://www.mongodb.com/atlas) for cloud setup
- **Git** - [Download here](https://git-scm.com/)
### 1. Clone the Repository
```bash
git clone https://github.com/your-username/pharmanear.git
cd pharmanear
Create .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:
1.Fork the Project.
2.Create your Feature Branch (git checkout -b feature/AmazingFeature).
3.Commit your Changes (git commit -m 'Add some AmazingFeature').
4.Push to the Branch (git push origin feature/AmazingFeature).
5.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.