Skip to content

Deployment enhancements - #31

Closed
dcaugher wants to merge 13 commits into
sylvester-francis:mainfrom
dcaugher:deployment-enhancements
Closed

dcaugher wants to merge 13 commits into
sylvester-francis:mainfrom
dcaugher:deployment-enhancements

Conversation

@dcaugher

Copy link
Copy Markdown
Contributor

Pull Request: Enterprise Deployment Enhancements & Admin Features

Summary

This PR adds enterprise deployment capabilities with API proxy mode and introduces several admin-focused features for resource and tag management, along with various bug fixes, UI improvements, and comprehensive documentation updates.

Enterprise Deployment Enhancements

  • API Proxy Mode: Frontend can now proxy API requests to the backend, enabling deployments where browsers cannot directly reach the backend server (corporate proxies, firewalls)
  • Environment Configuration: Added .env.docker template with comprehensive configuration options and updated docker-compose.yml to use environment variable substitution
  • Proxy Support: Added HTTP/HTTPS proxy build args support in Dockerfiles for building behind corporate proxies
  • WebSocket Improvements: Fixed WebSocketContext to handle empty API_HOST by falling back to window.location
  • Default Port Change: Frontend default port changed to 8081 to avoid conflicts

Admin Features

  • Resource Editing: Admins can now edit resource name, description, and tags (when resource is not in use)
  • Global Tag Management: New "Manage Tags" dialog for admins to:
    • View all tags with resource usage counts
    • Rename tags globally (updates all resources)
    • Delete tags globally (removes from all resources)
    • Inline validation prevents renaming to existing tag names
  • Resource Description Field: Added optional description field to resources

Authorization Hardening

Action Any User Owner Admin
Reserve a resource ✅ - ✅
Query resources ✅ - ✅
Cancel reservation ❌ ✅ ✅
Create resource ❌ - ✅
Edit resource ❌ - ✅
Upload resources CSV ❌ - ✅
Set resource unavailable ❌ - ✅
Manage tags ❌ - ✅

Bug Fixes & Improvements

  • Tag Filtering: Changed from OR to AND logic (resources must have ALL selected tags)
  • Axios Array Serialization: Fixed to serialize arrays as key=v1&key=v2 for FastAPI compatibility
  • Tag Whitespace Stripping: All tag inputs are now trimmed before validation/storage
  • Future Reservations: Users can now reserve resources that are currently in use (for future time slots)
  • Database Migration Documentation: Added troubleshooting section for schema drift issues

Documentation Updates

Updated 7 documentation files with comprehensive coverage of new features:

  • README.md: Updated default ports (8081), expanded Admin Guide with authorization details, added resource editing and tag management
  • docs/admin/roles.md: Added admin-only actions table and user permissions list
  • docs/api/overview.md: Added Authorization section, API proxy mode notes
  • docs/api/reservations.md: Added authorization table, cancellation rules
  • docs/api/resources.md: Split endpoints into Public/Admin sections, added tag management endpoints, documented AND filter logic
  • docs/user-guide/reservations.md: Added cancellation permissions, in-use resource booking
  • docs/user-guide/resources.md: Added Admin sections for Create, Edit, Manage Tags

Files Changed

  • 32 files modified
  • ~2,340 lines added, ~130 lines removed

New Components

  • apps/frontend/src/components/edit-resource-dialog.tsx - Resource editing UI
  • apps/frontend/src/components/tag-manager.tsx - Global tag management UI
  • apps/frontend/src/components/ui/textarea.tsx - Textarea component
  • apps/backend/migrations/versions/f8a9b0c1d2e3_add_resource_description.py - DB migration

Testing Performed

  • ✅ Non-admin users cannot create/edit resources (returns 403)
  • ✅ Non-admin users cannot cancel others' reservations (returns 403)
  • ✅ Admin users can cancel any reservation
  • ✅ Tag rename/delete operations work correctly
  • ✅ Tag whitespace is stripped on all inputs
  • ✅ Future reservations work on in-use resources
  • ✅ API proxy mode works in Docker deployment

CharudattaSChitale and others added 3 commits January 15, 2026 07:52
- Add .env.docker template with comprehensive configuration options
- Update docker-compose.yml to use environment variable substitution for all settings
- Implement API proxy mode in Next.js (rewrites /api/* to backend)
- Add proxy build args support in Dockerfiles
- Fix WebSocketContext to handle empty API_HOST (uses window.location)
- Update middleware to use INTERNAL_API_URL for server-side calls
- Update deployment and configuration documentation
- Configure default frontend port to 8081 to avoid conflicts

This enables enterprise deployments behind corporate proxies where
browsers cannot directly reach the backend API server.
@sylvester-francis

Copy link
Copy Markdown
Owner

Merged with fixes in commit 4ebeb09. Thank you for your contribution @dcaugher!

Additional fixes applied:

Fixed E2E login endpoint (used /api/v1/token instead of /api/v1/login)
Updated tests for proxy mode baseURL format
Applied lint fixes for Python code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants