This project is a Pharmacy-Storage Management System that connects pharmacies with storage facilities (drug stores). The system allows pharmacies to place orders from drug stores, manage their stock, and communicate efficiently.
The project is deployed using Koyeb at the following link: ๐ https://pflow.koyeb.app
๐ https://pflow.koyeb.app
You can test the API using Postman Workspace:
๐ Postman Workspace
โ Authentication: Login and registration for pharmacies and drug stores. โ User Management: Management of pharmacies, drug stores, and admin roles. โ Medicine Management: Add, update, and view medicines. โ Orders System: Create, track, and manage orders between pharmacies and drug stores. โ Location-based Search: Find the nearest drug store based on pharmacy location. โ Messaging System: Communication between pharmacies and drug stores. โ Reports & Analytics: Track orders, stock levels, and sales performance.
- ๐ข Node.js
- โก Express.js
- ๐ MongoDB
- ๐ด Mongoose
- ๐ด Git
- ๐ก GitHub
- ๐ด Postman (API Testing)
- ๐ด Koyeb (Hosting Service)
- ๐ Monitoring & Logging
git clone https://github.com/youssefrramdan/Graduation-Project.git
cd pharmacy-storage-system
npm install
Create a .env
file in the root directory and configure the following variables:
# Server Configuration
PORT=8000
NODE_ENV=development
# Database Configuration
DB_USER=your_database_username
DB_PASSWORD=your_database_password
DB_NAME=your_database_name
DB_URI=your_mongodb_connection_string
# JWT Configuration
JWT_SECRET_KEY=your_jwt_secret
JWT_EXPIRE_TIME=3d
# Email Configuration
EMAIL_USER=your_email@example.com
EMAIL_PASS=your_email_password
โ Make sure not to share these credentials publicly and add .env
to .gitignore
.
npm run start:dev
The server will run at http://localhost:8000
.
Method | Endpoint | Description |
---|---|---|
GET |
/ |
Get all users |
POST |
/ |
Create a new user (protected) |
GET |
/:id |
Get specific user |
PUT |
/:id |
Update user profile (protected) |
DELETE |
/:id |
Delete a user (protected) |
PATCH |
/changePassword/:id |
Change user password (protected) |
PATCH |
/activate/:id |
Activate a specific user (protected) |
Method | Endpoint | Description |
---|---|---|
POST |
/signup |
Register a new user (with file upload) |
GET |
/verify/:token |
Confirm email verification |
POST |
/login |
Login user |
POST |
/forgetpassword |
Request password reset |
POST |
/verifyResetCode |
Verify reset code |
PUT |
/resetPassword |
Reset password |
Description: ุชุญููู ุตูุฑ ุงูุฑูุดุชุงุช ุงูุทุจูุฉ ูุงุณุชุฎุฑุงุฌ ู ุนููู ุงุช ุงูุฃุฏููุฉ
Authentication: Required (Bearer Token)
Request:
- Method: POST
- Content-Type: multipart/form-data
- Body:
image
: ุตูุฑุฉ ุงูุฑูุดุชุฉ (jpeg, jpg, png)
Response Example:
{
"status": "success",
"message": "Prescription analyzed successfully",
"data": {
"imageUrl": "https://res.cloudinary.com/dqicm2ir2/raw/upload/v1750502532/prescriptions/image-1750502531848-photo.jpg",
"prescription": {
"patient": {
"name": "Patient Name",
"age": 30,
"gender": "Male"
},
"doctor": {
"name": "Dr. Doctor Name",
"license": "68237"
},
"prescriptionDate": "2022-10-17",
"medications": [
{
"name": "Diab Hamlo",
"dosage": "1mg",
"frequency": "Once a day",
"duration": "20 days"
},
{
"name": "Tab. Arvont",
"dosage": "1mg",
"frequency": "Once a day",
"duration": "30 days"
}
],
"additionalNotes": "k/c/o - Hypertension & Hypothyroid\nc/o - Fever since 3 days...",
"medicationsCount": 4
},
"apiResponse": {
"success": true,
"message": "Prescription processed successfully"
}
}
}
Error Responses:
400
: No prescription image provided408
: Request timeout500
: Analysis failed or invalid API response
The application supports global error handling for:
- โ Unhandled Promise Rejections
- โ Uncaught Exceptions
- โ Invalid Routes
Contributions are welcome! Feel free to fork the repository and submit pull requests.
This project is licensed under the MIT License.