A customization and automation layer built on top of Snipe-IT that transforms the default asset tracker into a fully branded Vector Asset Management platform — complete with a dark theme, AI-powered chatbox assistant, admin AI settings panel, Docker orchestration, and automated theming scripts.
This repository contains all the patch scripts, Docker configuration, and theme files needed to deploy and brand a self-hosted Vector Asset Management instance. Each script is designed to be run inside the running container to apply its changes, making the entire setup reproducible and re-runnable (idempotent).
Base platform: Snipe-IT (open-source IT asset management) Branding: Vector Asset Management / Vector Solutions AI Engine: Claude (Anthropic) Deployment: Docker Compose
- Full dark UI applied via custom CSS injected directly into the database settings
- GitHub-inspired color palette (
#0D1117base,#161B22sidebar,#21262Dcards) - CSS custom properties (variables) for consistent theming across all components
- Covers: navbar, sidebar, tables, cards, forms, modals, buttons, badges, alerts, pagination, dropdowns, date pickers, Select2, and more
- Dark mode set as the default for all new users (no manual toggle needed on first load)
- Available in both Python (
update_theme.py) and PHP (update_theme.php) variants
- Floating chat button (fixed, bottom-right) on every page of the application
- Gradient icon with live connection status dot (green = connected, red = error, amber = busy)
- Draggable chat panel — reposition anywhere on screen by dragging the header
- Fetches live data from the asset management API in parallel before each AI response:
- Always fetched: Hardware (500 items), Users (200), Licenses, Locations, Departments, Categories, Manufacturers, Models, Status Labels, Companies
- Conditionally fetched based on query keywords: Accessories, Consumables, Components, Suppliers
- Powered by
claude-haiku-4-5-20251001— fast, cost-efficient responses - Streamed to a scrollable message window with markdown rendering (bold, inline code)
- Quick-action chips on the welcome message: "Summarize all assets", "Show unassigned hardware", "List licenses & usage", etc.
- Settings drawer within the panel to enter/update the Anthropic API key (stored in
localStorage) - API key auth status shown inside the panel (green checkmark when configured)
- New section injected into the Snipe-IT Admin Settings page (
/settings) - Configure Anthropic API key from within the app — no file editing required
- Test Connection button — live-tests the key against the Anthropic API and shows result
- Clear button to revoke a stored key
- Connection status badge (Connected / Auth failed / Not configured) with color-coded indicator
- API key stored in browser
localStorage— never logged or sent to the server - Fully idempotent: re-running the patch removes and re-injects the block cleanly
- Displays the site name as a styled heading beneath the logo on the login screen
- Falls back to "Vector Asset Management Tool" if no site name is configured
- Logo padded and sized correctly (
max-height: 80px) for clean presentation - Works with or without a logo configured in Admin Settings
- Patches the theme-toggle JavaScript so dark mode is the default on first visit
- Only sets the preference if
localStoragedoes not already have one — respects user preference on subsequent visits - Single-line patch, safe to re-apply
- Converts the Vector Solutions logo (
.webp) to a64×64PNG favicon - Saves directly to the Snipe-IT public uploads path
- Uses PHP GD library (included in the Snipe-IT Docker image)
- Generates a fresh OAuth bearer token for the admin user (ID 1) directly via PDO
- Finds the personal access OAuth client, creates a new
oauth_access_tokensrecord - Outputs
TOKEN:andTOKEN_ID:for use by other scripts (e.g.,inject_chat.pyreads this) - Token is set to expire in 100 years — persistent across container restarts
docker-compose.ymlspins up the full stack with a single command- Two services:
mysql(MySQL 8.0) +vector-asset-management(Snipe-IT latest) - Named volumes for data persistence:
mysql-data(database),vector-data(uploads/files) - Environment loaded from
.env— credentials never hardcoded in the compose file - Both services set to
restart: unless-stoppedfor production reliability
| File | Language | Purpose |
|---|---|---|
docker-compose.yml |
YAML | Spins up MySQL + Vector Asset Management containers |
.env |
ENV | Database credentials and app config (not committed) |
update_theme.py |
Python | Injects full dark theme CSS via MySQL connector |
update_theme.php |
PHP | Injects full dark theme CSS via PDO (run inside container) |
patch_darkmode.py |
Python | Sets dark mode as the default on first page load |
patch_login.py |
Python | Brands the login page with site name heading |
patch_ai_settings.py |
Python | Injects AI settings panel into the Admin Settings page |
inject_chat.py |
Python | Injects the floating AI chatbox widget on all pages |
gen_api_token.php |
PHP | Generates an OAuth bearer token for the admin user |
make_favicon.php |
PHP | Converts the Vector Solutions logo to a PNG favicon |
- Docker & Docker Compose
- PHP (inside container, for
.phpscripts) - Python 3 +
mysql-connector-python(for.pyscripts run against the DB directly) - Anthropic API key (console.anthropic.com)
docker-compose up -dWait ~60 seconds for Snipe-IT to finish its first-time setup.
# PHP variant (run inside container)
docker exec -it vector-asset-management php /tmp/update_theme.php
# OR Python variant (run from host with DB access)
python3 update_theme.pydocker exec -it vector-asset-management python3 /tmp/patch_darkmode.pydocker exec -it vector-asset-management python3 /tmp/patch_login.pydocker exec -it vector-asset-management python3 /tmp/patch_ai_settings.pydocker exec -it vector-asset-management python3 /tmp/inject_chat.pydocker exec -it vector-asset-management php /tmp/make_favicon.phpAPP_ENV=production
APP_DEBUG=false
APP_KEY=base64:<your-laravel-app-key>
APP_URL=http://<your-server-ip>:8000
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=vector_asset_db
DB_USERNAME=vector_asset
DB_PASSWORD=vector_pass
MAIL_DRIVER=log- Open the app at
http://localhost:8000 - Go to Admin → Settings
- Scroll to Vector AI Assistant — Configuration
- Paste your Anthropic API key and click Save Key
- Click Test Connection to verify
The key is stored in your browser's localStorage only — it is never sent to the server or stored in the database.
vector-asset-management/
├── docker-compose.yml # Container orchestration
├── .env # Credentials (gitignored)
├── .gitignore
│
├── Theme & UI
│ ├── update_theme.py # Dark theme via Python/MySQL
│ ├── update_theme.php # Dark theme via PHP/PDO
│ ├── patch_darkmode.py # Force dark mode default
│ └── make_favicon.php # Favicon from logo
│
├── Login & Branding
│ └── patch_login.py # Branded login page
│
└── AI Integration
├── patch_ai_settings.py # Admin settings panel
├── inject_chat.py # Floating chatbox widget
└── gen_api_token.php # OAuth token for API access
Full rebrand to Vector Asset Management
- Renamed all Docker container names, service names, and volume names from
snipe-*tovector-* - Updated all database credentials (
snipeit→vector_asset_db,vector_asset,vector_pass) - Updated MySQL host references in all PHP/Python scripts (
snipe-mysql→vector-mysql) - Renamed Python variable
snipe_token→vam_tokenand JS variable_vsSnipe→_vsToken - Updated all code comments from "Snipe-IT token" to "Vector Asset Management token"
- Repository moved to
D3c3pt1c0nCyber/Vector-Asset-Management
AI Chatbox & Admin Settings
- Added
inject_chat.py— floating AI chatbox widget on every page- Draggable panel, live status dot, quick-action chips, markdown rendering
- Parallel API data fetching (hardware, users, licenses, locations, departments, and more)
- Powered by
claude-haiku-4-5-20251001
- Added
patch_ai_settings.py— Anthropic API key configuration in Admin Settings- Save, Test Connection, and Clear buttons
- Live connection status badge with color-coded indicator
- Fully idempotent (safe to re-run)
- Added
gen_api_token.php— generates OAuth bearer token for API access- Used by
inject_chat.pyto authorize live data fetches - Token valid for 100 years, persists across restarts
- Used by
Initial Release
- Added
docker-compose.yml— full Docker stack (MySQL 8.0 + Snipe-IT latest) - Added
update_theme.py/update_theme.php— full dark theme CSS injection- GitHub-inspired palette with CSS custom properties
- Covers all UI components: navbar, sidebar, tables, forms, modals, badges, dropdowns, etc.
- Added
patch_darkmode.py— sets dark mode as default on first visit - Added
patch_login.py— branded login page with site name heading and logo sizing - Added
make_favicon.php— converts Vector Solutions logo to favicon
.envis gitignored — never commit credentials- Anthropic API key lives in browser
localStorageonly — not stored server-side - OAuth tokens are scoped to read-only API endpoints
- All patch scripts are idempotent — safe to re-run without duplicating changes
MIT — free to use, modify, and distribute.