Skip to content

Commit cffc8dd

Browse files
authored
Merge pull request #218 from sjefferson99/develop
v2026.1.0 - UI release
2 parents 92f8efb + c0dd74a commit cffc8dd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+14656
-1316
lines changed

.env

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,21 @@ MYSQL_PASSWORD=your_user_password_here
66

77
# Application Configuration
88
FLASK_ENV=development
9-
FLASK_DEBUG=1
9+
FLASK_DEBUG=1
10+
11+
# Redis Configuration
12+
REDIS_URL=redis://redis:6379/0
13+
14+
# CORS Configuration
15+
# Comma-separated list of origins allowed to connect via HTTP, HTTPS, and WebSocket
16+
# For development: include both localhost and 127.0.0.1 since they're different CORS origins
17+
# If you access the app via another hostname or IP (e.g., http://192.168.1.100), add that origin here as well.
18+
# For production: https://yourdomain.com,https://www.yourdomain.com
19+
CORS_ALLOWED_ORIGINS=http://localhost,http://127.0.0.1
20+
21+
# WebSocket Testing Configuration
22+
# Set to true to test WebSocket disconnection scenarios (header shows "WebSocket Disconnected")
23+
# WARNING: This must NEVER be enabled (true) in production deployments
24+
# Only use for local/testing purposes to verify client handling of WebSocket failures
25+
# Default: false
26+
REJECT_SOCKETIO_CONNECTIONS=false

.env.example

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Database Configuration
2+
MYSQL_ROOT_PASSWORD=your_root_password_here
3+
MYSQL_DATABASE=aft_db
4+
MYSQL_USER=aft_user
5+
MYSQL_PASSWORD=your_user_password_here
6+
7+
# Application Configuration
8+
FLASK_ENV=development
9+
FLASK_DEBUG=1
10+
11+
# Redis Configuration
12+
REDIS_URL=redis://redis:6379/0
13+
14+
# CORS Configuration
15+
# Comma-separated list of origins allowed to connect via HTTP, HTTPS, and WebSocket
16+
# For development: include both localhost and 127.0.0.1 since they're different CORS origins
17+
# If you access the app via another hostname or IP (e.g., http://192.168.1.100), add that origin here as well.
18+
# For production: https://yourdomain.com,https://www.yourdomain.com
19+
CORS_ALLOWED_ORIGINS=http://localhost,http://127.0.0.1
20+
21+
# WebSocket Testing Configuration
22+
# Set to true to test WebSocket disconnection scenarios (header shows "WebSocket Disconnected")
23+
# WARNING: This must NEVER be enabled (true) in production deployments
24+
# Only use for local/testing purposes to verify client handling of WebSocket failures
25+
# Default: false
26+
REJECT_SOCKETIO_CONNECTIONS=false

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode
22
data
33
backups
4+
.env
45

56
# Python virtual environments
67
venv/

CONTRIBUTING.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ Before submitting any code contribution, **verify ALL items** are complete:
99
- [ ] **Tests Created** - All new features and bug fixes MUST include tests (see [Testing Requirements](#testing-requirements))
1010
- [ ] **API-Only Tests** - Tests use ONLY API endpoints, never direct database/filesystem access (see [TESTING.md](./TESTING.md))
1111
- [ ] **Code Standards** - Code follows all style guidelines in [Coding Standards](#coding-standards)
12+
- [ ] **Frontend Error Handling** - All API calls follow error handling patterns (see [FRONTEND_ERROR_HANDLING.md](./FRONTEND_ERROR_HANDLING.md))
1213
- [ ] **Accessibility** - UI changes include ARIA attributes, keyboard navigation, screen reader support (see [Accessibility Requirements](#accessibility-requirements))
1314
- [ ] **Security** - Input validation, length limits, no error leaking (see [Security Guidelines](#security-guidelines))
1415
- [ ] **Database Changes** - Migration created, schema validation updated (see [Database Changes](#database-changes))
1516
- [ ] **Documentation** - README/docs updated if behavior changed
1617
- [ ] **All Tests Pass** - Run `pytest -v` and verify all tests pass
1718

18-
**AI Contributors:** Read this entire document including all linked files (TESTING.md, ACCESSIBILITY.md, MIGRATION_GUIDE.md) before implementing ANY feature.
19+
**AI Contributors:** Read this entire document including all linked files (TESTING.md, ACCESSIBILITY.md, MIGRATION_GUIDE.md, FRONTEND_ERROR_HANDLING.md) before implementing ANY feature.
1920

2021
## Table of Contents
2122

@@ -79,7 +80,7 @@ I had copilot write all of this primarily so I can ensure it always does all the
7980
5. **Verify Setup**
8081

8182
- Application: http://localhost:80
82-
- API: http://localhost:5000/api/health
83+
- API: http://localhost/api/health
8384

8485
## Development Workflow
8586

@@ -469,6 +470,29 @@ All UI changes must meet accessibility standards. See [ACCESSIBILITY.md](./ACCES
469470
3. Test with a screen reader
470471
4. Run automated tools (axe DevTools, Lighthouse)
471472

473+
## Frontend Error Handling
474+
475+
All frontend API interactions must follow error handling best practices to ensure a consistent user experience when the database or API is unavailable.
476+
477+
See [FRONTEND_ERROR_HANDLING.md](./FRONTEND_ERROR_HANDLING.md) for comprehensive guidelines on:
478+
479+
- **Database Connection Monitoring**: Continuous polling and status tracking
480+
- **API Call Patterns**: 5-second timeouts with AbortController
481+
- **Visual Feedback**: Loading states, toast notifications, loading overlays
482+
- **State Preservation**: Keep modals open on failure, rollback UI changes
483+
- **Error Notifications**: Non-blocking toasts instead of blocking alerts
484+
- **Testing Guidelines**: Manual and automated testing requirements
485+
486+
### Quick Reference
487+
488+
All API calls must:
489+
1. Use AbortController with 5-second timeout
490+
2. Show loading state (with 500ms delay to avoid flashing)
491+
3. Display non-blocking toast on error (never use `alert()`)
492+
4. Preserve user work on failure (keep modals open)
493+
5. Rollback UI changes for optimistic updates
494+
6. Check database connection before opening modals
495+
472496
## Security Guidelines
473497

474498
All code must follow security best practices. See [server/SECURITY.md](./server/SECURITY.md) for comprehensive security guidelines.

0 commit comments

Comments
 (0)