An industrial-grade MVP designed to bridge the gap between production engineering and supply chain execution through automated intelligence and BOM-driven workflows.
The Smart Procurement System (SPS) is a professional digital engine tailored for manufacturing environments. It transforms manual, error-prone procurement into a centralized, data-driven process. By integrating Bill of Materials (BOM) requirements directly with automated RFQ dispatching, SPS ensures that every component needed on the production floor is sourced with 100% traceability, optimized pricing, and minimal operational lag.
To provide a 360-degree view of the system's architecture and business value, the project is documented across four strategic pillars:
- Strategic Project Summary: Business case, ROI analysis, and current-state vs. future-state gap analysis.
- Solution Architecture: Deep dive into the N-Tier architecture, logic handlers, and component interactions.
- Database Design: ERD schemas and relational integrity constraints using SQLAlchemy ORM.
- Technology Rationale: Technical justification for the chosen stack (Streamlit, SQLite, SMTP Gateway).
.
├── database/ # DB connection & Session management (SQLAlchemy)
├── models/ # Data entities (BOM, RFQ, Vendor, User)
├── services/ # Business logic: RFQ Generation & SMTP Mailer
├── utils/ # PDF Generators & Data formatting helpers
├── views/ # Streamlit UI Components & Pages
├── rfq_archive/ # Local storage for generated PDF audit trails
├── .env.example # Environment configuration template
├── app.py # Application entry point
└── requirements.txt # Production dependencies
- BOM-Driven Intelligence: Automated derivation of procurement needs from complex production Bill of Materials.
- Automated RFQ Engine: Dynamic PDF generation and direct dispatch to vendors via secure SMTP protocols.
- Strategic Awarding Terminal: Multi-vendor bid comparison matrix for data-backed awarding decisions.
- Immutable Audit Trail: Full transparency and GRC compliance for every system action.
- Vendor Specialization: Intelligent vendor-to-material mapping to optimize sourcing quality.
graph TD
%% Input Layer
subgraph Input [Engineering Input]
BOM[Import BOM Data] --> PR[Generate Purchase Request]
end
%% Processing Layer
subgraph Core [SPS Core Engine]
RFQ[RFQ Logic Handler] --> PDF[PDF Export Service]
PDF --> SMTP[SMTP Dispatch Gateway]
end
%% Strategic Layer
subgraph Strategic [Awarding & Analysis]
Bids[Vendor Bid Collection] --> Matrix[Comparison Matrix]
Matrix --> Decision[Awarding Decision]
end
%% Connections
PR --> RFQ
RFQ --> PDF
PDF --> SMTP
SMTP --> Bids
Bids --> Matrix
Matrix --> Decision
Decision --> Audit([System Audit Log])
%% Styling
style Core fill:#f9f9f9,stroke:#333,stroke-width:2px
style Strategic fill:#e1f5fe,stroke:#01579b
To ensure a seamless deployment, please verify that your environment meets the following requirements:
- Python 3.9+: The recommended stable version for library compatibility.
- Git: Required for version control and repository management.
-
Clone the Repository:
git clone [https://github.com/your-username/smart-procurement-system.git](https://github.com/your-username/smart-procurement-system.git) cd smart-procurement-system -
Initialize Virtual Environment: It is highly recommended to use a virtual environment to isolate project dependencies.
python -m venv venv # Activation for Windows: .\venv\Scripts\activate # Activation for Mac/Linux: source venv/bin/activate
- Initialize Environment Variables: Create your local configuration file from the provided template.
cp .env.example .env
- SMTP Integration: Open the
.envfile and update your email credentials.- Note: If using Gmail, you must generate and use an "App Password" instead of your primary account password to bypass security blocks and ensure successful RFQ dispatch.
# Upgrade package manager and install dependencies
python -m pip install --upgrade pip
pip install -r requirements.txt
# Launch the Streamlit User Interface
streamlit run app.pyIf you encounter issues during setup or execution, please refer to the following solutions:
- Dependency Installation Failure: Ensure your virtual environment (
venv) is active and thatpipis updated to the latest version. - SMTP/Email Authentication Error: Verify your
SENDER_EMAILandSENDER_PASSWORDin the.envfile. Double-check that "App Passwords" are enabled for your mail provider. - Database File Not Found: The system automatically initializes the
procurement.dbfile upon the first successful transaction; ensure the application has write permissions for the project directory.
- Phase 2 (Security): Role-Based Access Control (RBAC) & OAuth2 Integration.
- Phase 3 (Intelligence): Predictive Lead-Time Analytics using historical vendor performance.
- Phase 4 (Integration): Supplier Self-Service Portal for direct bid entry.
Digital Consultant: Mohammed Hlal LinkedIn: Mohammed Hlal Profile
This project is engineered to meet the highest standards of operational excellence and digital scalability in the procurement domain.