Project Structure¶
Root Directory Layout¶
Lenzeye_Deployment/
├── Lenzeye.py # App entry point (create_app)
├── lenzeye_database.py # DB init, app factory, blueprint registration
├── wsgi.py # Gunicorn WSGI entry point
├── Procfile # Render start command
├── requirements.txt # Python dependencies
├── render.env # Production environment variables
├── sendgrid.env # Local development environment variables
├──
├── lenzeye_BiodataStructure.py # Core models: User, UserEncryptionKey, FileAccess, LabPortal, PrintOrder, Association
├── lenzeye_database.py # SQLAlchemy db, GuestDownloadLink, app factory
├── lenzeye_encryption_service.py # AES-256-CTR, HMAC, key management
├── lenzeye_UserSubscription.py # UserSubscription model
├── lenzeye_store_model.py # Store model
├──
├── admin_routes.py # Admin dashboard routes
├── admin_db_operations.py # Admin helper functions (OTP, user management, Wasabi stats)
├── admin_subscription_routes.py # Subscription management routes
├── admin_control_flags.py # Global feature toggle model
├──
├── collaboration_routes.py # Collaboration request/match/schedule routes
├── collaboration_models.py # CollaborationRequest, Match, Schedule, Invite, Notification models
├── matching.py # Collaboration matching algorithm
├── email_collaboration_utils.py # Email helpers for collaboration invites
├──
├── UserRegistration.py # User registration logic
├── Userregistration_routes.py # User registration routes (blueprint)
├── email_token_routes.py # Email token/OTP routes
├── email_tokens.py # Email token utilities
├── brevo_smtp_utils.py # Brevo (Sendinblue) SMTP helpers
├── brevo_debug_routes.py # Debug routes for email testing
├──
├── android_api_routes.py # Android app REST API routes
├──
├── celery_app_init.py # Celery app initialization
├── celery_config.py # Celery configuration
├── celery_worker.py # Worker entry point + task registration
├── celery_prerequisites.py # Celery prerequisite checks
├──
├── wasabiboto3.py # boto3 S3 client setup
├── wasabiURL.py # Presigned URL helpers
├── wasabi_sync.py # Wasabi sync utilities
├──
├── guest_upload_monthly_reset.py # Monthly guest upload counter reset
├── daily_analytics.py # Daily analytics logging
├── subscription_utils.py # Subscription helper functions
├── subscription_guard.py # Subscription access guard
├──
├── lenzeye_store_routes.py # Store routes (prefix: /store)
├── razorpay_config.py # Razorpay configuration
├── config.py # Flask config loader
├── Lenzeye_const.py # Constants
├──
├── lab_portal_routes.py # Lab portal Flask routes (large: 45k lines)
├── lab_print_upload_routes.py # Lab print upload routes (large: 58k lines)
├── lab_portal_async.py # Async lab portal operations
├── lab_portal_id_utils.py # Lab ID generation utilities
├──
├── Features/
│ ├── SecureStorage/
│ │ ├── guest_upload_routes.py # Guest upload (Lenzeye File Transfer)
│ │ ├── guest_download_routes.py # Guest download link handling
│ │ ├── guest_download_model.py # GuestDownloadLink model
│ │ ├── secure_storage_new_routes.py # Registered user secure storage routes
│ │ ├── upload_wasabi_home.py # Direct Wasabi upload routes (home user)
│ │ ├── DecideWheretoUpload.py # Upload routing decision logic
│ │ └── multifile_upload_routes.py # Multi-file upload handling
│ └── SST/
│ ├── sst_flask_routes.py # SST file manager routes (prefix: /sst-file-manager)
│ └── sst_tasks_async.py # Celery async tasks for S3 file listing
├──
├── static/ # Static assets (CSS, JS, images)
├── templates/ # Jinja2 HTML templates
├── guidelines/ # Upload guidelines text files
├── migrations/ # Flask-Migrate Alembic migration scripts
└── instance/ # Flask instance folder (local secrets)
Key File Roles¶
| File | Lines | Role |
|---|---|---|
Lenzeye.py |
178,000+ | Main app — all Jinja2 routes, template rendering |
lab_print_upload_routes.py |
58,000+ | Lab print upload blueprint |
lab_portal_routes.py |
45,000+ | Lab portal blueprint |
admin_routes.py |
46,000+ | Admin dashboard blueprint |
lenzeye_encryption_service.py |
21,000+ | Full encryption library |
Features/SecureStorage/guest_upload_routes.py |
1,138+ | Guest upload blueprint |
TL;DR¶
Entry point: wsgi.py → lenzeye_database.py:create_app() → registers 15+ blueprints.
Feature code lives in: Features/SecureStorage/ and Features/SST/.
Core models: lenzeye_BiodataStructure.py and lenzeye_database.py.
Encryption: lenzeye_encryption_service.py — imported by guest upload and upload home routes.