Commit Graph

40 Commits

Author SHA1 Message Date
a727796ed2 Add optional default product fields on tenant creation
When creating a new tenant, users can now choose to initialize with default product fields (Product Name, Item ID, Sale Price, and Image). The option is presented via a checkbox in the tenant creation modal and is enabled by default.
2025-10-20 21:13:05 -04:00
25e3848710 Merge pull request #10 from mattintech/main
Updating Develop
2025-10-20 21:03:23 -04:00
a25ec8a457 Merge pull request #9 from mattintech/feature/cicd
Add CI/CD pipeline with Docker support
2025-10-20 20:33:16 -04:00
c7f20bc04e Add automated Docker Hub publishing workflow
- Add GitHub Actions workflow for building and publishing Docker images
- Trigger on version tags (v*) to publish to Docker Hub
- Update README with Docker Hub deployment instructions
v1.0.0
2025-10-20 20:22:43 -04:00
4062ccf4e3 Merge pull request #8 from mattintech/feature/entra-id
Add Entra ID authentication with optional no-auth mode
2025-10-20 20:09:07 -04:00
bcfa6cac43 Fix: Prevent access to role selection page when not in no-auth mode
Return 403 Forbidden instead of redirecting to prevent potential redirect loops.
Add proper logging for unauthorized access attempts.
2025-10-20 20:06:31 -04:00
2b471ef09f Add optional no-auth mode for simplified local testing
This update introduces an AUTH_MODE configuration that allows developers
to easily test the application locally without requiring Entra ID setup.

Changes:
- Add AUTH_MODE environment variable (entra/none) to .env.example and config
- Update auth decorators to support both authentication modes
- Create role selection page for no-auth mode (admin/user choice)
- Modify auth routes to conditionally use MSAL only in Entra ID mode
- Update UserModel to support mock test users with string IDs
- Add visual indicator in navbar when running in no-auth mode

Benefits:
- Zero Azure AD configuration needed for local development
- Quick testing of role-based features (admin vs user)
- Existing Entra ID functionality remains unchanged
- Simple toggle via environment variable

To use no-auth mode, set AUTH_MODE=none in .env file.
For production, use AUTH_MODE=entra (default).
2025-10-20 20:03:46 -04:00
2bf87e6d72 Add Docker support and update README with deployment options
- Add Dockerfile with multi-stage build for production deployment
- Add docker-compose.yml for easy local development
- Add .dockerignore to optimize Docker build context
- Update README with Docker and local setup instructions
2025-10-20 19:54:33 -04:00
fc16517726 Merge pull request #7 from mattintech/feature/cicd
Add GitHub issue templates
2025-10-20 19:44:17 -04:00
595440099f Add GitHub issue templates for bug reports and feature requests
- Add structured bug report template with component selection, environment details, and reproduction steps
- Add feature request template with priority levels, breaking change indicators, and use case descriptions
- Templates aligned with project components including API endpoints, admin interface, barcode generation, and Entra ID authentication
2025-10-20 19:43:12 -04:00
141d9dfc65 Merge pull request #6 from mattintech/feature/entra-id
Add Entra ID Authentication with Role-Based Access Control
2025-10-20 19:39:36 -04:00
795068c015 Add Entra ID authentication with role-based access control
Implement Microsoft Entra ID (Azure AD) authentication with user and admin roles.

Features:
- OAuth 2.0 authentication flow using MSAL
- User and admin role-based access control
- Tenant ownership and access management
- Server-side session storage
- Protected routes with authentication decorators

Authentication:
- Users authenticate via Microsoft organizational accounts
- Admin role automatically assigned to DEFAULT_ADMIN_EMAIL
- User profiles synced from Microsoft Graph API

Access Control:
- Admins: Full access to all tenants and server settings
- Users: Can create and manage their own tenants only
- Tenant association: Auto-created when user adds products
- API endpoints remain open for AR application access

Database Changes:
- New users table with email, azure_oid, name, and role
- New user_tenants table for many-to-many tenant ownership
- Case-insensitive admin email comparison

Configuration:
- Environment-based config via .env file
- Azure AD credentials (client ID, secret, tenant ID)
- Configurable redirect URI and admin email
- Updated to Flask 2.2.5 for compatibility
2025-10-20 19:37:52 -04:00
881cdbbee4 Merge pull request #5 from mattintech/bug/tenant-delete
Fix tenant deletion page not found error
2025-10-20 18:27:40 -04:00
0ef9020d3b Fix tenant deletion page not found error and improve delete confirmation
- Fixed incorrect route path from /tenant/{id}/delete to /{id}/delete
- Replaced browser confirm() dialog with Bootstrap modal for better UX
- Added styled confirmation modal with warning message
- Modal displays tenant name and ID before deletion
2025-10-20 18:26:49 -04:00
c8ad220b4f Merge pull request #4 from mattintech/development
Merge pull request #3 from mattintech/refactor
2025-10-20 18:22:48 -04:00
db22ff01fd Merge pull request #2 from mattintech/refactor
Refactor to MVC architecture and modernize UI
2025-10-20 18:21:51 -04:00
32ce69057b Merge pull request #3 from mattintech/refactor
Refactor
2025-10-20 18:21:27 -04:00
0888edaec5 Modernize tenant selection page with improved UX
- Replace list view with responsive card grid layout for better scalability
- Add real-time search functionality to filter tenants by name or ID
- Move settings to fixed gear icon in top-right corner
- Add new tenant button (plus icon) next to settings gear
- Implement modal dialog for creating new tenants
- Add hover effects and animations to tenant cards
- Improve mobile responsiveness
- Display tenant info more compactly (name, ID, username, date, AR URL)
- Add "no results" message for empty search results

The new layout handles 50+ tenants efficiently with better visual organization and easier navigation.
2025-10-20 18:16:45 -04:00
f97808c7b3 Refactor application to MVC architecture with Flask blueprints
Major architectural refactoring to improve code organization, maintainability, and scalability:

- Implement MVC pattern with clear separation of concerns
- Organize code into blueprints for different functional areas (main, tenant, admin, api)
- Create models layer to encapsulate all database operations
- Create services layer for business logic (auth, product, barcode)
- Implement application factory pattern for better testability
- Add environment-based configuration management
- Remove old monolithic app.py and consolidate routes

New structure:
- app/models/ - Database operations (Tenant, Product, ARField, Settings)
- app/services/ - Business logic (Auth, Product, Barcode services)
- app/blueprints/ - Controllers organized by function
- app/config.py - Environment configurations
- run.py - Application entry point

All routes remain backward compatible. No changes to API or templates functionality.
2025-10-20 18:11:16 -04:00
a775270790 Merge pull request #1 from mattintech/feature/customfileds
Add custom fields and barcode viewing features
2025-10-20 17:59:55 -04:00
57db63074b Add view all barcodes feature with print functionality
Added a new feature that allows viewing all product barcodes for a tenant
in a grid layout with print-optimized styling. This makes it easy to print
barcode sheets for all products at once.

Changes:
- Add new route /<tenant_id>/barcodes for viewing all barcodes
- Create view_all_barcodes() function in routes/admin.py
- Add all_barcodes.html template with responsive grid and print CSS
- Add "View All Barcodes" button to tenant index page
- Print layout optimized for 3-column barcode sheets
2025-10-20 17:56:52 -04:00
bb01ca2110 Add barcode modal with configurable barcode type setting
- Add barcode_type column to tenants table (default: code128)
- Add barcode type setting in tenant settings page (Code 128, EAN-13, QR Code)
- Replace barcode page link with modal button on tenant dashboard
- Add barcode modal that displays product barcode using tenant's configured type
- Remove old generate_barcode_page route, function, and template
- Clean up unused imports in admin.py
2025-10-20 17:49:18 -04:00
7bb8c0d969 Remove trailing whitespace in database.py 2025-10-20 17:40:13 -04:00
253058b45b Add QR code functionality for AR template URLs
- Add QR code icon next to each tenant's AR template URL on main page
- Add modal popup to display dynamically generated QR codes
- Add routes for QR code generation (/qrcode/template and /qrcode/arinfo)
- Include Bootstrap Icons for QR code icon display
2025-10-20 17:40:04 -04:00
ccac3134f3 Fix image display and add AR fields management route
Fixes:
1. Image display - Images now properly display on tenant landing page and edit forms by prepending tenant ID to image paths (/tenant/images/... instead of /images/...)
2. AR fields route - Added /tenant/ar_fields route (without /admin/ prefix) for managing custom AR content fields
3. Template updates - Updated all image src attributes to include tenant prefix for proper routing
4. Navigation - Updated AR fields back button to return to settings page instead of non-existent admin index

Images are now visible in:
- Product list on tenant landing page
- Product edit forms showing current images
- Admin index (if accessed)
2025-10-20 17:17:58 -04:00
f781cdf602 Add dynamic custom field display and remove redundant admin routes
Major improvements to tenant management:
1. Dynamic field display - Product lists now automatically show all custom fields based on tenant configuration (e.g., inventory, custom attributes)
2. Fixed Jinja2 template scoping issue - Product field values now correctly display in edit forms using selectattr filter
3. Simplified URL structure - Removed redundant /tenant/admin/ routes, all product management now at /tenant/ root
4. Enhanced tenant landing page - Added delete functionality with confirmation modal, shows all custom fields except images
5. Updated all routes and redirects to use simplified paths (/tenant/add, /tenant/edit, etc.)

This consolidates the interface so /tenant/ serves as the main dashboard with full product management capabilities, while /tenant/settings handles configuration.
2025-10-20 17:11:38 -04:00
92eb45fc8c Fix product image not saving/displaying in tenant admin
Fixed two issues with product images:
1. Images weren't being preserved when editing other product fields - added logic to keep existing image value when no new image is uploaded
2. Image URLs had double underscores (e.g., /images/123__image.jpg) due to field names starting with underscore - now strips leading underscore from field name when constructing image paths
2025-10-20 16:45:58 -04:00
6dc276a292 fixing missing barcodes 2025-06-25 18:11:12 -04:00
9f33e1aeb6 case insensitivity 2025-06-19 16:08:18 -04:00
e744afbe26 adding server settings 2025-06-19 16:03:50 -04:00
000c054734 fixing field edits and adding custom fileds 2025-06-19 15:46:22 -04:00
ac07f5b7c8 ability to delete a tenant 2025-06-19 14:35:13 -04:00
705f2859fa made multi tenant 2025-06-19 14:25:42 -04:00
f041266ac3 adding authentication and image support 2025-06-19 11:57:47 -04:00
f78f5ce9f9 refactoring project 2025-05-14 15:30:27 -04:00
bd7bf7bf82 organizing the project 2025-05-14 15:17:12 -04:00
791aa5a8d0 project cleanup 2025-05-14 15:05:52 -04:00
7b4069212c fixing product layout 2025-05-08 20:54:19 -04:00
f5f6e52c4b updating ui 2025-05-08 20:49:15 -04:00
1e14703eec initial commit 2025-05-08 20:20:26 -04:00