Skip to content

giovannimirulla/MedExpress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MedExpress

University Project for Drug Delivery


screenshot


How to run the project

Requirements

  • Java 21

Run the project

  1. Download .jar from MedExpress Releases
  2. Run the jar with the command java -jar <file>.jar

Test Users

Below are the test users you can use to access the application:

  • Patient:

    • Email: patient@gmail.com
    • Password: Qwertyuiop123.
  • Driver:

    • Email: driver@gmail.com
    • Password: Qwertyuiop123.
  • Doctor:

    • Email: doctor@gmail.com
    • Password: Qwertyuiop123.
  • Pharmacy 1:

    • Email: pharmacy1@gmail.com
    • Password: Qwertyuiop123.
  • Pharmacy 2:

    • Email: pharmacy2@gmail.com
    • Password: Qwertyuiop123.

Documentation

For a complete overview of the project, you can refer to the detailed documentation available in PDF format:
Detailed Documentation

Swagger

The Swagger UI is available at the following URL: http://localhost:8080/swagger-ui/index.html

Reference Documentation

For further reference, please consider the following sections:

Guides

The following guides illustrate how to use some features concretely:

Maven Parent overrides

Due to Maven's design, elements are inherited from the parent POM to the project POM. While most of the inheritance is fine, it also inherits unwanted elements like <license> and <developers> from the parent. To prevent this, the project POM contains empty overrides for these elements. If you manually switch to a different parent and actually want the inheritance, you need to remove those overrides.


Screenshot

Search drugs

screenshot


Dashboard

screenshot


Order details

screenshot


Design Patterns

GRASP Patterns

1. Controller

2. Information Expert

3. Creator

4. High Cohesion

  • JwtUtil: Focuses exclusively on JWT token management. JwtUtil.java
  • JwtFilter: Handles security related to JWT tokens. JwtFilter.java

5. Low Coupling

  • UserRepository: Uses the MongoRepository interface to reduce coupling between the persistence layer and the rest of the application. UserRepository.java
  • IconRepository: Uses the MongoRepository interface to manage icons. IconRepository.java

6. Polymorphism

  • CustomUserDetails: Implements the UserDetails interface to handle different types of users. CustomUserDetails.java

7. Indirection

  • JwtFilter: Acts as an intermediary between HTTP requests and authentication logic, delegating token validation to JwtUtil. JwtFilter.java
  • SocketIOController: Uses SocketIOServer to mediate between WebSocket clients and application logic. SocketIOController.java

8. Protected Variations

  • MongoRepository: Protects the application from changes in persistence logic by abstracting database operations. UserRepository.java
  • JwtUtil: Shields the application from the implementation details of JWT token management. JwtUtil.java

9. Pure Fabrication

  • JwtUtil: A utility class created to handle JWT token logic, not representing a domain concept. JwtUtil.java
  • ModelMapperConfig: Provides a singleton configuration for object mapping, unrelated to domain concepts. ModelMapperConfig.java

GoF Patterns

Creational Patterns

  1. Singleton:
    • The ModelMapperConfig class uses the @Bean annotation to create a singleton instance of ModelMapper. This ensures that only one instance of ModelMapper is created and shared across the application. ModelMapperConfig.java

Structural Patterns

  1. Facade:
    • The JwtUtil class acts as a facade for JWT operations, providing a simplified interface for generating and validating tokens. JwtUtil.java

Behavioral Patterns

  1. Observer:

    • The SocketIOServer in SocketIOController uses event listeners (addConnectListener, addDisconnectListener, addEventListener) which are typical of the Observer pattern, where changes in state are communicated to interested parties. SocketIOController.java
  2. Strategy:

    • The Order class uses enums like StatusDoctor, StatusPharmacy, and StatusDriver to define different strategies for handling order statuses. Order.java

To DO

Uses Cases

  • UC1: User Registration - @giovannimirulla
  • UC2: Pharmacy Registration - @agatarosselli
  • UC3: Search for a drug - @giovannimirulla
  • UC4: Order drug - @agatarosselli
  • UC5: Request a prescription - @agatarosselli
  • UC6: Autorize a prescription - @agatarosselli & @giovannimirulla
  • UC7: Communicate authorization status - @agatarosselli & @giovannimirulla
  • UC8: Manage evasion and status order registration - @giovannimirulla
  • UC9: Take charge of the order - @giovannimirulla
  • UC10: Track delivery status - @giovannimirulla
  • UC11: Track priority orders - @giovannimirulla

Frontend

  • Home - Search drugs page - @giovannimirulla
  • Swagger - @giovannimirulla
  • Search drug - @giovannimirulla
  • Drug details - @giovannimirulla
  • Login - @giovannimirulla
  • Sign up pharmacy - @giovannimirulla
  • Sign up user - @giovannimirulla
  • Order drug - @giovannimirulla
  • Dashboard pharmacy - @giovannimirulla
  • Dashboard patient - @giovannimirulla
  • Dashboard doctor - @giovannimirulla
  • Dashboard driver - @giovannimirulla
  • Dashboard drugs - @agatarosselli
  • Priority - @agatarosselli

Tests

  • UC1 Test - @mariachiara98
  • UC2 Test - @mariachiara98
  • UC3 Test - @mariachiara98
  • UC4 Test - @mariachiara98
  • UC5 Test - @mariachiara98
  • UC6 Test - @mariachiara98
  • UC7 Test - @mariachiara98
  • UC8 Test - @mariachiara98
  • UC9 Test - @mariachiara98
  • UC10 Test - @mariachiara98
  • UC11 Test - @mariachiara98