Browse by type
Simpler Stock Management is a web application designed to help manage warehouse and shop stock efficiently. The application provides features for searching, sorting, updating, and transferring stock items between the warehouse and shops. Data is stored in a local SQLite3 database.
Warning: This is a beta release. Deploy to production at your own risk (see the steps in Security, below). The app MUST NOT be run without a TLS-terminating reverse proxy, such as NGINX, in front of it.
This is an entire rewrite of the earlier (pre-V5) 'Simple Stock Management' app, from scratch. Little-used functionality has been removed and the code is now simpler and more maintainable. The earlier legacy version is now unmaintained, however the code may still be accessed in the legacy_v4 branch.
~~Live demo available below.~~
A focused AI security review (carried out over two passes) was undertaken for the v5.3.0-beta release. The issues it identified, including a stored cross-site scripting (XSS) flaw, a broken access-control check on item creation, an insecure direct object reference on transfer cancellation, and spreadsheet formula injection on export, have been fixed, and defence-in-depth measures added (a Content-Security-Policy, HTTPS/secure-cookie hardening, read-only stock endpoints, output escaping in the dashboard and notification emails, and non-revealing API error messages). See the release notes for the full list.
A further AI security review for the v5.4.0-beta release found two low-risk issues, both now fixed: the warehouse, shop and transfer lists could be sorted by any database field, which let a shop user work out which items other shops had requested and roughly how much stock they held; and the Pipfile named a deprecated third-party dotenv package instead of python-dotenv.
A further AI security review for the v5.5.0-beta release found no high or medium severity issues. Acting on its low-risk findings, the release removes every address, page and API action the app does not use (including the browsable API and Django's built-in password reset by email pages, which nothing in the app linked to), adds a three-strikes lockout to the change password pages, stops notification emails being written to the log file, limits the size of spreadsheet uploads, keeps every quantity within what the database and spreadsheets store exactly, names a missing environment variable at startup instead of crashing, and fixes two timing problems with cancelling and sending transfer requests. A further review of the release's own changes found no new issues.
This is not a substitute for a professional third-party audit, and the app has not undergone one. Undiscovered vulnerabilities may still exist. Please continue to deploy conservatively:
DEBUG=False it sets secure cookies, HSTS and HTTPS redirection, and trusts the X-Forwarded-Proto header to tell it which requests arrived over HTTPS, so the proxy must set that header itself rather than pass on the client's (in NGINX, proxy_set_header X-Forwarded-Proto $scheme;). Protections added at the proxy, such as the admin IP restriction below, also do not apply to requests that reach gunicorn directly.nginx
location /admin/ {
allow 203.0.113.10; # your IP address
deny all;
# plus the same proxy settings as your main location block, e.g.
proxy_pass http://unix:/home/django/ssm-gunicorn.socket;
}
If you are behind Cloudflare's proxy (highly recommended), NGINX sees Cloudflare's addresses rather than yours, so also tell it to trust Cloudflare's published ranges and read your real address from the CF-Connecting-IP header. This may be accomplished by running the following bash command:
```bash
{ for ip in $(curl -s https://www.cloudflare.com/ips-v4) $(curl -s https://www.cloudflare.com/ips-v6); do echo "set_real_ip_from $ip;"; done; echo "real_ip_header CF-Connecting-IP;"; } | sudo tee /etc/nginx/conf.d/cloudflare-realip.conf
sudo nginx -t && sudo systemctl reload nginx
```
ALLOW_PW_CHANGE in the .env file). A wrong current password counts as a failed login, so three in a row log the user out and lock the account, as at the login page; the admin section's change password page works the same way.If you'd like to discuss options to have this application installed and/or maintained on your behalf, or just have comments or suggestions, feel free to get in touch github@danbright.uk.
The live demo is currently unavailable.
If anyone genuinely wants to see this in action and cannot get it running for some reason, ping me and I'll deploy an instance.


The backend is still Django Rest Framework, while the frontend is now plain old jQuery, rather than relying on ReactJS with all its dependencies. The frontend is now integrated into the Django app, as opposed to the previous standalone frontend UI.
cd into that directory.python -c 'from django.core.management.utils import get_random_secret_key; print(get_random_secret_key())'.Set up your forwarding (reverse proxy) web server, and configure 'systemd' to run gunicorn. As an example: by creating this file /etc/systemd/ssm-gunicorn.service with this content:
- Terminate TLS at the reverse proxy and ensure it sets the X-Forwarded-Proto header itself, replacing any value sent by the client (see Security). With DEBUG=False the app enables secure cookies and HTTPS redirection and relies on this header (via SECURE_PROXY_SSL_HEADER) to recognise secure requests; without it you may see redirect loops or cookies that fail to set.
- The app sends a Content-Security-Policy that allow-lists the jQuery and Bootstrap CDN hosts referenced by the templates. If you change those CDN URLs, update CONTENT_SECURITY_POLICY in ssm/settings.py to match.
- Do the database migrations, i.e., from the project root run: python manage.py makemigrations, python manage.py makemigrations stock_manager, then python manage.py migrate.
- When upgrading to a release whose notes say it changes the database (v5.4.0-beta and v5.5.0-beta do), back up the database, then run python manage.py makemigrations stock_manager and python manage.py migrate again.
- Start the 'systemd' service, and enable at boot: systemctl start ssm-gunicorn and systemctl enable ssm-gunicorn.
- Create the superuser, i.e., from the project root run: python manage.py createsuperuser.
- Login to the admin section with your superuser (e.g., https://your-site.domain/admin) and create your superadmin user, warehouse manager user, and shop users.
- Assign the 'staff status' permission to the warehouse manager user.
- Still in the admin section, create the 'managers', 'shop_users' and 'receive_mail' user groups.
- It's recommended to assign all 'SSM | App Configuration' permissions to the 'managers' group.
- Assign the warehouse manager user to the 'managers' group, the shop users to the 'shop_users' group, and those managers who you wish to receive notification emails to the 'receive_mail' group.
- Still in the admin section, head to SSM > App Configuration > Configuration Options to switch on/off uploads, upload deletions, notification emails and shop user cancellations, and to set the maximum upload size.
- Shop users cannot cancel a transfer request once they have sent it, unless 'Allow shop user cancellations' is switched on. It is off by default, because managers may be emailed the request and dispatch it before they see a cancellation in the app. Managers can always cancel.
- If you wish to use the notification email feature, you'd need an account with a mail provider. The installation des
$ claude mcp add simple-stock-management \
-- python -m otcore.mcp_server <graph>