Skip to content

Pharmacy-Storage Management System ๐Ÿš€ A system that connects pharmacies with drug storage facilities, allowing efficient ordering, stock management, and communication.

Notifications You must be signed in to change notification settings

youssefrramdan/Graduation-Project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿš€ Pharmacy-Storage System

๐ŸŒŸ Overview

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.


๐ŸŒ Deployment

The project is deployed using Koyeb at the following link: ๐Ÿ”— https://pflow.koyeb.app

๐ŸŒ Access the Live Application

๐Ÿ”— https://pflow.koyeb.app

๐Ÿ“ฉ Postman API Collection

You can test the API using Postman Workspace:

๐Ÿ”— Postman Workspace


๐Ÿ”ฅ Features

โœ… 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.


๐Ÿ›  Technologies Used

โš™ Backend

  • ๐ŸŸข Node.js
  • โšก Express.js

๐Ÿ’พ Database

  • ๐Ÿƒ MongoDB
  • ๐Ÿ”ด Mongoose

๐Ÿ”ง Version Control

  • ๐Ÿ”ด Git
  • ๐ŸŸก GitHub

๐Ÿ“ฆ Other Tools

  • ๐Ÿ”ด Postman (API Testing)

๐Ÿš€ Deployment

  • ๐Ÿ”ด Koyeb (Hosting Service)
  • ๐Ÿ“Š Monitoring & Logging

โšก Installation

1๏ธโƒฃ Clone the Repository

git clone https://github.com/youssefrramdan/Graduation-Project.git
cd pharmacy-storage-system

2๏ธโƒฃ Install Dependencies

npm install

3๏ธโƒฃ Set Up Environment Variables

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.

4๏ธโƒฃ Run the Application

npm run start:dev

The server will run at http://localhost:8000.


๐Ÿ“Œ API Endpoints

User Routes (/api/v1/users)

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)

Authentication Routes (/api/v1/auth)

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

Prescription Analysis Endpoint (/api/v1/drugs/prescription/analyze)

POST /api/v1/drugs/prescription/analyze

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 provided
  • 408: Request timeout
  • 500: Analysis failed or invalid API response

โš  Error Handling

The application supports global error handling for:

  • โŒ Unhandled Promise Rejections
  • โŒ Uncaught Exceptions
  • โŒ Invalid Routes

๐Ÿค Contributing

Contributions are welcome! Feel free to fork the repository and submit pull requests.


๐Ÿ“œ License

This project is licensed under the MIT License.


About

Pharmacy-Storage Management System ๐Ÿš€ A system that connects pharmacies with drug storage facilities, allowing efficient ordering, stock management, and communication.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •