Giter Site home page Giter Site logo

drugdispensaryapi's Introduction

Drug Dispensary API Documentation
Introduction
Welcome to the Drug Dispensary API! This API provides functionality for managing patients, drugs, and prescriptions within a drug dispensary system. It supports user authentication, drug management, and retrieval of patient and drug information.

Base URL
The base URL for all API endpoints is http://localhost:3030/.

Authentication
To access certain endpoints, user authentication is required. The API uses JSON Web Tokens (JWT) for authentication. Include the generated token in the Authorization header of your requests.

Example

plaintext
Authorization: Bearer YOUR_GENERATED_TOKEN
Endpoints
1. User Authentication
1.1 Authenticate User
Endpoint: POST /auth
Description: Authenticates a user (patient or admin) based on provided SSN and password.
Request Body:
SSN (string): Social Security Number of the user.
password (string): User password.
Response:
If successful, returns a JWT token and user type.
Example Response:

json
{
  "accessToken": "YOUR_GENERATED_TOKEN",
  "userType": "user"
}
Authentication: Not required.
2. User Management
2.1 Create User
Endpoint: POST /addUser
Description: Registers a new patient.
Request Body:
SSN (string): Social Security Number of the patient.
fname (string): First name of the patient.
lname (string): Last name of the patient.
dob (string): Date of birth of the patient.
phone (string): Phone number of the patient.
email (string): Email address of the patient.
address (string): Address of the patient.
gender (string): Gender of the patient.
password (string): Password for the patient account.
Response:
If successful, redirects to the login page.
Authentication: Not required.
3. Profile Management
3.1 Get User Profile
Endpoint: GET /profile
Description: Retrieves the profile information of the authenticated user.
Response:
Returns user profile information.
Example Response:

json
{
  "SSN": "123456789",
  "Fname": "John",
  "Lname": "Doe",
  "phone": "123-456-7890",
  "dob": "1990-01-01",
  "email": "[email protected]",
  "password": "hashed_password",
  "address": "123 Main St, City",
  "gender": "Male"
}
Authentication: Required.
3.2 Get User Profile by SSN
Endpoint: GET /getProfile/:SSN
Description: Retrieves the profile information of a user by SSN.
Response:
Returns user profile information.
Example Response:

json
{
  "SSN": "123456789",
  "Fname": "John",
  "Lname": "Doe",
  "phone": "123-456-7890",
  "dob": "1990-01-01",
  "email": "[email protected]",
  "address": "123 Main St, City",
  "gender": "Male"
}

Authentication: Required.

drugdispensaryapi's People

Contributors

winstone-were avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.