An application for managing SMD components, BOM imports, and device assignments.
- Management of SMD component inventory
- BOM import in CSV format
- DigiKey API integration for product information
- Device assignment for components
- Analysis of missing parts for device production
- Responsive user interface
- Python 3.8 or higher
- Flask
- SQLAlchemy
- Redis (optional for improved caching)
- python-dotenv
- Clone repository:
git clone https://github.com/AnimaI/SMD-Manager.git
cd SMD-Manager- Create and activate virtual environment:
python3 -m venv venv
source venv/bin/activate
# On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Configure
.envfile:
cp .env.example .env
# Edit .env with your settings
- Start application:
python3 app.py- Clone repository:
git clone https://github.com/AnimaI/SMD-Manager.git
cd SMD-Manager- Configure .env file:
cp .env.example .env
# Edit .env with your settings
- Start Docker Compose:
docker-compose up -d-
Install the application following Option 1 steps 1-4 in your desired location.
-
Create a systemd service file:
sudo nano /etc/systemd/system/smd-manager.service- Add the following configuration (adjust all paths and user/group settings to match your environment):
[Unit]
Description=SMD Manager Service
After=network.target redis-server.service
Requires=redis-server.service
[Service]
# Replace with actual user/group that should run the service
# For a system-wide installation, consider using a dedicated user
User=REPLACE_WITH_ACTUAL_USER
Group=REPLACE_WITH_ACTUAL_GROUP
# Replace with the actual path to your SMD-Manager installation
WorkingDirectory=REPLACE_WITH_PATH_TO_SMD_MANAGER
Environment="PATH=REPLACE_WITH_PATH_TO_SMD_MANAGER/venv/bin"
# Redis configuration (if using Redis)
Environment="REDIS_HOST=localhost"
Environment="REDIS_PORT=6379"
Environment="REDIS_DB=0"
# Path to your .env file with settings
EnvironmentFile=REPLACE_WITH_PATH_TO_SMD_MANAGER/.env
# Path to the Python interpreter in your virtual environment
ExecStart=REPLACE_WITH_PATH_TO_SMD_MANAGER/venv/bin/python3 app.py
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
- Reload systemd, enable and start the service:
sudo systemctl daemon-reload
sudo systemctl enable smd-manager
sudo systemctl start smd-manager- Check service status:
sudo systemctl status smd-manager- View logs:
sudo journalctl -u smd-manager -fWhile the application works without Redis (using in-memory caching), Redis provides better caching performance for DigiKey API calls.
Ubuntu/Debian:
# Install Redis
sudo apt update
sudo apt install redis-server
# Edit the configuration to enable as a service
sudo nano /etc/redis/redis.conf
# Change 'supervised no' to 'supervised systemd'
# Restart and enable Redis
sudo systemctl restart redis-server
sudo systemctl enable redis-serverCentOS/RHEL/Fedora:
# Install Redis
sudo yum install redis
# Start and enable Redis
sudo systemctl start redis
sudo systemctl enable redisVerify Redis is running:
redis-cli ping
# Should respond with PONG- Update your
.envfile with Redis settings:
REDIS_HOST=localhost
REDIS_PORT=6379
REDIS_DB=0
-
If using the systemd service method, ensure these values are included in the service file as shown in the example above.
-
Reload systemd and restart the service:
sudo systemctl daemon-reload
sudo systemctl restart smd-managerYou can check if the application is using Redis by looking at the logs:
sudo journalctl -u smd-manager | grep "Redis cache"If functioning correctly, you should see: "Redis cache enabled"
The application supports CSV files with the following format:
Device,Device Name v1.0
DigiKey-No,Quantity
311-24.3KCRCT-ND,5
CKN10502-ND,10
...
The application uses the DigiKey API for product information. To use this:
- Register for DigiKey API access: https://developer.digikey.com/
- Obtain Client ID and Client Secret
- Add the credentials to the
.envfile
- The application should be operated behind a reverse proxy like Nginx
- In production,
FLASK_DEBUG=Falseshould be set - API keys should be set as environment variables
If you like this project and want to support future work, I would appreciate a donation:
bc1qkz29mjsyn5k4hwezf7gxg4gnleh85k0wnm8htd
animai@getalby.com (Bitcoin Lightning)
This project is licensed under the GNU General Public License v3.0 - see the LICENSE file for details. This means you can freely use, modify and distribute this software, but if you distribute derivative works, you must make them available under the same license (GPL-3.0) and provide the source code.

