v0.12.1 - Updated the Readme.md file

This commit is contained in:
Javier
2026-01-26 11:49:27 -06:00
parent 21671d6bee
commit ac73045ef2
2 changed files with 141 additions and 80 deletions

219
README.md
View File

@@ -17,7 +17,7 @@ pip install flask werkzeug --break-system-packages
### 2. Initialize Database ### 2. Initialize Database
```bash ```bash
cd /home/claude/scanlook cd /path/to/scanlook
python database/init_db.py python database/init_db.py
``` ```
@@ -39,7 +39,7 @@ Access at: **http://localhost:5000**
## 📱 Accessing from Scanner Devices ## 📱 Accessing from Scanner Devices
For Zebra Android scanners or tablets on the same network: For Zebra MC9300 scanners or tablets on the same network:
1. Find your server's IP address: 1. Find your server's IP address:
```bash ```bash
@@ -55,11 +55,32 @@ For Zebra Android scanners or tablets on the same network:
--- ---
## 🏗️ Modular Architecture
ScanLook uses a modular system designed to grow into a full WMS. Modules can be enabled/disabled per user.
### Current Modules:
- **Counts** - Cycle Counts and Physical Inventory
### Planned Modules:
- Shipping
- Receiving
- Transfers
- Production
### Module Access
- Admins assign modules to users via User Management
- Users only see modules they have access to on the home screen
- Route guards prevent URL bypassing
---
## 👥 User Roles ## 👥 User Roles
### Owner (Level 1) ### Owner (Level 1)
- Super admin privileges - Super admin privileges
- Manage all admins - Manage all users (admins and staff)
- Access to all modules
- View all sessions across branches - View all sessions across branches
### Admin (Level 2) ### Admin (Level 2)
@@ -68,9 +89,10 @@ For Zebra Android scanners or tablets on the same network:
- Upload CURRENT baseline (refresh anytime) - Upload CURRENT baseline (refresh anytime)
- View real-time dashboard - View real-time dashboard
- Export variance reports - Export variance reports
- Manage staff users - Manage staff users and module assignments
### Staff/Counter (Level 3) ### Staff/Counter (Level 3)
- Access assigned modules only
- Select active count session - Select active count session
- Scan locations and lots - Scan locations and lots
- Enter weights - Enter weights
@@ -79,36 +101,36 @@ For Zebra Android scanners or tablets on the same network:
--- ---
## 🔄 Core Workflow ## 🔄 Core Workflow (Counts Module)
### Phase 1: Session Setup (Admin) ### Phase 1: Session Setup (Admin)
1. **Log in as admin** 1. **Log in as admin**
2. **Create new count session**: 2. **Navigate to Admin Console**
3. **Create new count session**:
- Session name: "January 17, 2026 - Daily Cycle Count" - Session name: "January 17, 2026 - Daily Cycle Count"
- Type: Cycle Count OR Full Physical Inventory - Type: Cycle Count OR Full Physical Inventory
3. **Upload MASTER baseline** CSV from NetSuite: 4. **Upload MASTER baseline** CSV from NetSuite:
- Format: `Item, Description, Lot Number, Location, Bin Number, On Hand` - Format: `Item, Description, Lot Number, Location, Bin Number, On Hand`
- Creates baseline version 1 5. Session status: **Active**
4. Session status: **Active** 6. Counters can now begin
5. Counters can now begin
### Phase 2: Counting (Staff) ### Phase 2: Counting (Staff)
1. **Log in as staff** 1. **Log in as staff**
2. **Select active session** 2. **Select Counts module** from home screen
3. **Scan location barcode** (e.g., R903B) 3. **Select active session**
- System marks location "in progress" 4. **Start a new bin** - scan or enter bin number
- Shows: "Counting R903B" 5. **Scan lot barcode**
4. **Scan lot barcode** 6. System checks lot against MASTER baseline:
5. System checks lot against MASTER baseline:
- ✅ **MATCH**: Expected here, location correct - ✅ **MATCH**: Expected here, location correct
- ⚠️ **WRONG LOCATION**: Lot exists but system says different location - ⚠️ **WRONG LOCATION**: Lot exists but system says different location
- ❌ **GHOST LOT**: Not in system at all - ❌ **GHOST LOT**: Not in system at all
6. **Enter weight** - 🔵 **DUPLICATE**: Lot already scanned (same or different location)
7. Save → returns to scan input (autofocus) 7. **Enter weight**
8. Repeat for all lots in location 8. Save → returns to scan input (autofocus)
9. Click **"Finish Location"** 9. Repeat for all lots in bin
10. Click **"Finish Location"** to finalize
### Phase 3: Admin Monitoring ### Phase 3: Admin Monitoring
@@ -155,8 +177,9 @@ Item,Description,Lot Number,Location,Bin Number,On Hand
- What counters validate against - What counters validate against
- Represents "what should have been there when we started" - Represents "what should have been there when we started"
**CURRENT Baseline**: **CURRENT Baseline** (Global):
- Admin can refresh unlimited times - Admin can refresh unlimited times
- Shared across all sessions
- Only affects admin dashboard/reporting - Only affects admin dashboard/reporting
- Counters never see it - Counters never see it
- Shows "where is it in the system NOW" - Shows "where is it in the system NOW"
@@ -170,16 +193,29 @@ Item,Description,Lot Number,Location,Bin Number,On Hand
- **Ghost Lot**: Scanned but not in baseline at all - **Ghost Lot**: Scanned but not in baseline at all
- **Missing/Phantom**: In baseline but not found during count - **Missing/Phantom**: In baseline but not found during count
### Blind Counting ### Duplicate Detection
- Counters don't see expected quantities - **Status 00**: First scan of lot (no duplicate)
- Prevents bias - **Status 01**: Duplicate in same location by same user
- Ensures honest count - **Status 03**: Found in different location
- **Status 04**: Both same location duplicate AND different location
### Count Types
**Cycle Count:**
- Shows expected lots for the bin
- Staff can see what should be there
- Good for regular inventory checks
**Full Physical Inventory:**
- Blind count (no expected list shown)
- Staff only sees what they've scanned
- Missing lots determined after finalization
### Real-Time Dashboard ### Real-Time Dashboard
- Active counters with current location - Active sessions with progress stats
- Progress by location - Location completion tracking
- Variance counts updating live - Variance counts updating live
- Dual view (MASTER vs CURRENT) after refresh - Dual view (MASTER vs CURRENT) after refresh
@@ -188,32 +224,38 @@ Item,Description,Lot Number,Location,Bin Number,On Hand
- Every scan timestamped with user - Every scan timestamped with user
- Soft deletes tracked - Soft deletes tracked
- Edits tracked with modified timestamp - Edits tracked with modified timestamp
- Baseline version tracking - Session archival (archived sessions are read-only)
--- ---
## 🗂️ Database Schema ## 🗂️ Database Schema
### Tables: ### Core Tables:
- **Users**: Authentication and role management - **Users**: Authentication and role management
- **Modules**: Available system modules
- **UserModules**: Per-user module access
- **CountSessions**: Count session metadata - **CountSessions**: Count session metadata
- **BaselineInventory_Master**: Morning baseline (never changes) - **BaselineInventory_Master**: Session-specific baseline (immutable)
- **BaselineInventory_Current**: Refreshable baseline (soft delete) - **BaselineInventory_Current**: Global refreshable baseline
- **LocationCounts**: Location-by-location progress - **LocationCounts**: Bin-by-bin progress tracking
- **ScanEntries**: Every lot scan with dual status tracking - **ScanEntries**: Every lot scan with status tracking
- **MissingLots**: Expected lots not found - **MissingLots**: Expected lots not found after finalization
### Indexes: ### Key Relationships:
Optimized for fast lookups on lot numbers, locations, and statuses. - Users → UserModules → Modules (many-to-many)
- CountSessions → BaselineInventory_Master (one-to-many)
- CountSessions → LocationCounts → ScanEntries (hierarchical)
--- ---
## 🔧 Technology Stack ## 🔧 Technology Stack
- **Backend**: Python 3.13 + Flask - **Backend**: Python 3.13 + Flask
- **Database**: SQLite - **Database**: SQLite (auto-initializes on first run)
- **Frontend**: HTML5 + CSS3 + Vanilla JavaScript - **Frontend**: HTML5 + CSS3 + Vanilla JavaScript
- **Templates**: Jinja2 - **Templates**: Jinja2
- **Icons**: Font Awesome 6.5
- **Deployment**: Docker (Linux)
--- ---
@@ -221,23 +263,37 @@ Optimized for fast lookups on lot numbers, locations, and statuses.
``` ```
scanlook/ scanlook/
├── app.py # Main Flask application ├── app.py # Main Flask application & routes
├── db.py # Database helper functions
├── utils.py # Decorators (login_required, role_required)
├── blueprints/
│ ├── counting.py # Counts module routes
│ ├── sessions.py # Session management routes
│ ├── users.py # User management routes
│ ├── data_imports.py # CSV upload routes
│ └── admin_locations.py # Admin location management
├── database/ ├── database/
│ ├── init_db.py # Database initialization │ ├── init_db.py # Database initialization & schema
│ └── scanlook.db # SQLite database (created) │ └── scanlook.db # SQLite database (created at runtime)
├── static/ ├── static/
│ ├── css/ │ ├── css/
│ │ ── style.css # Main stylesheet │ │ ── style.css # Base/desktop styles
└── js/ │ ├── mobile.css # Mobile overrides (360-767px)
└── main.js # Client-side JavaScript └── scanner.css # MC9300 scanner overrides (<360px)
│ ├── js/
│ │ └── main.js # Client-side JavaScript
│ ├── manifest.json # PWA manifest
│ └── sw.js # Service worker
└── templates/ └── templates/
├── base.html # Base template ├── base.html # Base template with navbar
├── login.html # Login page ├── login.html # Login page
├── home.html # Module selection (landing page)
├── admin_dashboard.html ├── admin_dashboard.html
├── staff_dashboard.html ├── staff_dashboard.html
├── manage_users.html
├── create_session.html ├── create_session.html
├── session_detail.html ├── session_detail.html
├── count_session.html ├── my_counts.html
└── count_location.html └── count_location.html
``` ```
@@ -245,7 +301,7 @@ scanlook/
## 🎨 Design Philosophy ## 🎨 Design Philosophy
**Mobile-First, Warehouse-Optimized:** **Desktop-First, Multi-Device Optimized:**
- High contrast dark theme for warehouse lighting - High contrast dark theme for warehouse lighting
- Large touch targets (44px minimum) - Large touch targets (44px minimum)
- Autofocus on scan inputs - Autofocus on scan inputs
@@ -253,52 +309,47 @@ scanlook/
- Visual feedback with color-coded statuses - Visual feedback with color-coded statuses
- Minimal typing required - Minimal typing required
**CSS Architecture:**
- `style.css` - Base/desktop styles (768px+)
- `mobile.css` - Phone overrides (360-767px)
- `scanner.css` - MC9300 scanner overrides (<360px)
**Color Coding:** **Color Coding:**
- ✅ Green: Perfect match - ✅ Green (`--color-success`): Perfect match
- ⚠️ Yellow: Wrong location - ⚠️ Yellow (`--color-warning`): Wrong location / Expected
- ❌ Red: Missing or ghost lot - ❌ Red (`--color-danger`): Missing or ghost lot
- 🔵 Blue: Weight variance - 🔵 Blue (`--color-duplicate`): Duplicate scan
- 🟠 Orange (`--color-orange`): Weight variance
--- ---
## 🚧 Current Status: Phase 1 Complete (MVP) ## 🐳 Docker Deployment
### ✅ Implemented: ```bash
- User authentication (3 roles) # Build
- Session creation docker build -t scanlook .
- MASTER baseline upload
- Location scanning
- Lot scanning with MASTER status
- Weight entry
- Basic dashboard
- Real-time progress tracking
- Mobile-optimized UI
### 🔜 Next Phases: # Run (preserves database between updates)
- **Phase 2**: CURRENT baseline refresh & dual status recalculation docker run -d \
- **Phase 3**: Missing lot detection, enhanced dashboard -p 5000:5000 \
- **Phase 4**: Excel export with multiple tabs -v /path/to/data:/app/database \
- **Phase 5**: Data retention automation, user management -e SCANLOOK_SECRET_KEY=your-secret-key \
- **Phase 6**: Docker deployment scanlook
```
**Important:** Only `/app/database` is volume-mounted to preserve data between container updates.
--- ---
## 📝 Development Notes ## 🔐 Security Considerations
### Default Accounts (Testing) - Passwords hashed with Werkzeug
All passwords should be changed in production!
### Security Considerations
- Passwords are hashed with Werkzeug
- Session management via Flask sessions - Session management via Flask sessions
- SQL injection prevention (parameterized queries) - SQL injection prevention (parameterized queries)
- Role-based access control
- Module-based access control with route guards
- Soft deletes preserve audit trail - Soft deletes preserve audit trail
### Data Retention
- Plan: Keep data for 30 days
- Nightly cleanup job (to be implemented)
- Archive old sessions
--- ---
## 🎯 Success Metrics ## 🎯 Success Metrics
@@ -319,6 +370,7 @@ All passwords should be changed in production!
## 💡 Future Enhancements ## 💡 Future Enhancements
- Additional WMS modules (Shipping, Receiving, Transfers, Production)
- Multi-branch support - Multi-branch support
- Direct NetSuite API integration - Direct NetSuite API integration
- Photo capture for variance proof - Photo capture for variance proof
@@ -328,7 +380,16 @@ All passwords should be changed in production!
--- ---
## 📧 Support ## 📝 Version History
- **v0.12.0** - Modular architecture with user-based module access
- **v0.11.x** - CSS refactoring, multi-device support, duplicate detection
- **v0.10.x** - Global CURRENT baseline, session archival
- **v0.9.x** - Core counting workflow, dual baseline system
---
## 🔧 Support
This is a custom internal tool. Contact your system administrator for support. This is a custom internal tool. Contact your system administrator for support.

2
app.py
View File

@@ -36,7 +36,7 @@ app.config['PERMANENT_SESSION_LIFETIME'] = timedelta(hours=1)
# 1. Define the version # 1. Define the version
APP_VERSION = '0.12.0' APP_VERSION = '0.12.1'
# 2. Inject it into all templates automatically # 2. Inject it into all templates automatically
@app.context_processor @app.context_processor