This is a full-stack Online Pharmacy System designed to ease the sale of medications and includes user authentication, order processing, product management, and payment integration. It features a modular backend with a separate MongoDB container for database storage. The backend is built with Node.js and Express, while the frontend will be implemented separately.
- Authentication: User login, signup, and JWT-based authorization.
- Order Management: Ability to create, update, and view orders.
- Product Management: CRUD operations for pharmacy products.
- Payment Integration: Integration with payment providers.
- Alternative Medicine: Suggesting alternatives for medicines.
- Wishlist: Users can add products to their wishlist.
- Cart: Add and manage products in the cart.
- Error Handling & Validation: Includes custom error handling middleware and Joi validation for inputs.
- Backend: Node.js, Express.js
- Database: MongoDB (via Mongoose)
- Containerization: Docker (for backend and MongoDB)
- Validation: Joi
- Authorization: JWT (JSON Web Tokens)
- Docker: You need Docker installed to run the application in containers.
- Node.js & npm (optional for local dev).
-
Clone the repository:
git clone https://github.com/MustafaShokry/online-pharmacy-system.git cd online-pharmacy-system -
Install dependencies (if not using Docker):
npm install
-
Start the app (local):
npm run dev
Start using Docker Compose:
docker-compose up --buildThis will start the backend on
http://localhost:3000and MongoDB on port27017.
To stop the containers:
docker-compose down.
├── src
│ ├── config # MongoDB connection, environment config
│ ├── modules # Feature-based modules (auth, orders, products, etc.)
│ │ └── auth
│ │ ├── auth.controller.js
│ │ ├── auth.service.js
│ │ ├── auth.routes.js
│ │ └── auth.model.js
│ ├── middleware # Error handling, validation, etc.
│ ├── utils # Utility functions
│ └── app.js # Express app setup
├── index.js # Entry point
├── Dockerfile
├── docker-compose.yml
├── .env
└── README.md