A comprehensive pharmacy management desktop application
Features β’ Getting Started β’ Architecture β’ Database β’ Contributing
BioVera Pro is a full-featured desktop application designed to streamline pharmacy operations. Built with Java and JavaFX, it provides an intuitive interface for managing products, sales, suppliers, orders, clients, and employees β all backed by a MySQL database with role-based access control.
Whether you're running a small independent pharmacy or managing a larger operation, BioVera Pro gives you the tools to track inventory, process sales, manage supplier orders, and generate insightful reports β all from a single, polished desktop interface.
| Module | Description |
|---|---|
| π Authentication | Secure login system with role-based access (Admin / Employee) |
| π Dashboard | Real-time statistics and key performance indicators |
| π Product Management | Full CRUD for pharmaceutical products with barcode support and low-stock alerts |
| π Sales Management | Point-of-sale interface with automatic stock deduction and receipt generation |
| π¦ Order Management | Supplier order tracking with status workflow (Pending β Received β Cancelled) |
| π₯ Client Management | Client database with medical history tracking |
| π Supplier Management | Supplier directory with contact information |
| π€ User Management | Admin panel for managing system users and employees |
| π Reports & Export | Generate and export reports as PDF documents |
| ποΈ Database Backup | Built-in database backup functionality |
| π Activity Logs | Full audit trail of all system actions |
| π Notifications | Toast notification system for real-time user feedback |
| π Dark Mode | Toggle between light and dark themes |
| Technology | Purpose |
|---|---|
| Java 21 | Core language |
| JavaFX 21 | UI framework (FXML + CSS) |
| MySQL 8.0 | Relational database |
| MySQL Connector/J 8.0.33 | JDBC driver |
| OpenPDF 1.3.42 | PDF report generation |
| jpackage | Native Windows executable packaging |
Before running BioVera Pro, make sure you have the following installed:
| Requirement | Version | Link |
|---|---|---|
| JDK | 21+ | Download |
| MySQL | 8.0+ | Download |
| JavaFX SDK | 21 | Included in lib/lib/ |
git clone https://github.com/Raed-Jani/pharmacy_management_system.git
cd pharmacyStart your MySQL server, then run the provided SQL script:
mysql -u root -p < database/pharmacie_db.sqlThis will:
- Create the
pharmacie_dbdatabase with all required tables - Set up database indexes and optimized views
- Create MySQL users with appropriate privileges
- Insert sample data for testing
Note
Default database users created by the script:
| User | Password | Privileges |
|---|---|---|
admin_pharmacie |
admin_password_123 |
Full access |
employe_pharmacie |
employe_password_123 |
Limited access |
Open src/com/pharmacie/utils/DBConnection.java and set your MySQL root password:
private static final String DB_PASSWORD = "YOUR_MYSQL_PASSWORD"; // β Replace this- Open the project in IntelliJ IDEA
- Right-click the
resources/folder β Mark Directory as β Resources Root - Add all JARs from
lib/andlib/lib/to your module dependencies - Add VM options for JavaFX modules:
--module-path lib/lib --add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.base - Run
Launcher.java
# Compile
javac --release 21 \
-d out/production/pharmacie \
-cp "lib/mysql-connector-j-8.0.33.jar;lib/openpdf-1.3.42.jar;lib/lib/javafx.base.jar;lib/lib/javafx.controls.jar;lib/lib/javafx.fxml.jar;lib/lib/javafx.graphics.jar" \
-sourcepath src \
src/com/pharmacie/Launcher.java
# Run
java --module-path lib/lib \
--add-modules javafx.controls,javafx.fxml,javafx.graphics,javafx.base \
-cp "out/production/pharmacie;lib/mysql-connector-j-8.0.33.jar;lib/openpdf-1.3.42.jar" \
com.pharmacie.LauncherA PowerShell script is included to package the app as a native Windows .exe using jpackage:
.\Build_BioVera_Exe.ps1The executable will be generated at output_exe/BioVera Pro/BioVera Pro.exe.
You can also create a desktop shortcut:
.\Create_Desktop_Shortcut.ps1| Username | Password | Role |
|---|---|---|
admin |
password123 |
Administrator |
employe1 |
password123 |
Employee |
employe2 |
password123 |
Employee |
Warning
These are development credentials. Change all default passwords before deploying to a production environment.
The project follows a clean layered architecture (Model β DAO β Service β UI):
src/com/pharmacie/
β
βββ Launcher.java # Application entry point
βββ MainApp.java # JavaFX Application class
β
βββ model/ # π¦ Data models (POJOs)
β βββ Client.java
β βββ CommandeFournisseur.java
β βββ Fournisseur.java
β βββ LigneCommandeFournisseur.java
β βββ LigneVente.java
β βββ LogActivite.java
β βββ Produit.java
β βββ Utilisateur.java
β βββ Vente.java
β
βββ dao/ # ποΈ Data Access Objects (JDBC)
β βββ ClientDAO.java
β βββ CommandeFournisseurDAO.java
β βββ FournisseurDAO.java
β βββ LigneCommandeFournisseurDAO.java
β βββ LigneVenteDAO.java
β βββ LogActiviteDAO.java
β βββ ProduitDAO.java
β βββ UtilisateurDAO.java
β βββ VenteDAO.java
β
βββ service/ # βοΈ Business logic layer
β βββ AuthenticationService.java
β βββ DashboardStatisticsService.java
β βββ DatabaseBackupService.java
β βββ ExportService.java
β βββ GestionClientService.java
β βββ GestionCommande.java
β βββ GestionStock.java
β βββ GestionVente.java
β
βββ ui/ # π₯οΈ User interface layer
β βββ controller/ # FXML Controllers (12 screens)
β β βββ AccueilController.java
β β βββ BaseController.java
β β βββ ConsultationLogsController.java
β β βββ DashboardController.java
β β βββ GestionClientsController.java
β β βββ GestionCommandesController.java
β β βββ GestionFournisseursController.java
β β βββ GestionProduitsController.java
β β βββ GestionUtilisateursController.java
β β βββ GestionVentesController.java
β β βββ LoginController.java
β β βββ RapportsController.java
β βββ notification/
β βββ ToastNotification.java
β
βββ util/
β βββ ThemeManager.java # π¨ Light/Dark theme toggling
βββ utils/
β βββ DBConnection.java # π Database connection manager
βββ exception/ # β Custom exceptions
βββ ConnexionEchoueeException.java
βββ ProduitIntrouvableException.java
βββ StockInsuffisantException.java
The application uses 10 tables organized around core pharmacy operations:
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ
β Utilisateur β β Client β β Fournisseur β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ
β id_utilisateurβ β id_client β β id_fournisseur β
β login β β nom β β nom_societe β
β mot_de_passe β β prenom β β adresse β
β role β β telephone β β telephone β
ββββββββ¬ββββββββ β email β β email β
β β historique_ β ββββββββββββ¬ββββββββββββ
β β medical β β
β ββββββββ¬ββββββββ β
β β β
βΌ βΌ βΌ
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ
β Vente β β LigneVente β β CommandeFournisseur β
ββββββββββββββββ ββββββββββββββββ ββββββββββββββββββββββββ
β id_vente ββββββΆβ id_vente β β id_commande β
β date_vente β β id_produit β β date_creation β
β total_vente β β quantite β β date_reception β
β id_client β β prix_appliqueβ β statut β
β id_utilisateurβ ββββββββ¬ββββββββ β id_fournisseur β
ββββββββββββββββ β ββββββββββββ¬ββββββββββββ
β β
βΌ βΌ
ββββββββββββββββ ββββββββββββββββββββββββ
β Produit β β LigneCommande β
ββββββββββββββββ ββββββββββββββββββββββββ
β id_produit ββββββΆβ id_commande β
β nom β β id_produit β
β code_barre β β quantite_commandee β
β prix_unitaireβ β prix_achat β
β quantite_stockβ ββββββββββββββββββββββββ
β seuil_alerte β
ββββββββββββββββ
ββββββββββββββββ
β LogActivite β Tracks all system actions
ββββββββββββββββ for auditing purposes
β id_log β
β date_action β
β type_action β
β description β
βid_utilisateurβ
ββββββββββββββββ
Database views included for quick analytics:
| View | Purpose |
|---|---|
V_Produits_Alerte |
Products below their stock alert threshold |
V_CA_Journalier |
Daily revenue summary |
V_Top_Produits |
Best-selling products ranking |
pharmacie/
βββ src/ # Java source code
βββ resources/
β βββ fxml/ # FXML view definitions (11 screens)
β βββ css/ # Stylesheets (light & dark themes)
β βββ images/ # Application icons and assets
βββ database/
β βββ pharmacie_db.sql # Complete database setup script
βββ lib/
β βββ mysql-connector-j-8.0.33.jar
β βββ openpdf-1.3.42.jar
β βββ lib/ # JavaFX SDK JARs & native DLLs
βββ Build_BioVera_Exe.ps1 # Build native Windows executable
βββ Create_Desktop_Shortcut.ps1 # Create desktop shortcut
βββ app_icon.ico # Windows executable icon
βββ .editorconfig # Code style configuration
βββ .gitignore
βββ LICENSE
βββ README.md
This project is licensed under the MIT License.
Raed Jani β GitHub




