How asur12zurvan/home-eyecare works
Project type and purpose
• This is a full-stack web application built with Django (Python).
• It hosts an eye-test/vision-readability ML model (in Integ/MLmodel/model.py and model.py), serves HTML pages, accepts user input, runs inference, and returns results.
File structure
Top-level
• Jupyter notebooks: EYE-TEST.ipynb (exploratory work)
• Machine.py, model.py, tempCodeRunnerFile.py: standalone scripts or ML prototypes
• CSV files: raw data for training/inference
• Integ/: Django project root
Inside Integ/
• manage.py: Django CLI entry point
• db.sqlite3: SQLite database storing user sessions or results
• requirements.txt: Python dependencies
• static/ & staticfiles/: CSS, JS, CSV assets served to clients
• templates/: Django HTML templates (index, about, result pages)
• Integ/: Django settings, URLs, WSGI/ASGI application
• MLmodel/: Django app containing models.py (ORM), views.py (controllers), urls.py (routing), and an ML wrapper in model.py.
README insights
• Currently generic; no architecture details. We infer architecture from file structure and Django conventions.
a. Main components
• Client Browser (Web UI)
• Django Web Server
– URL Router (Integ/urls.py, MLmodel/urls.py)
– Views/Controllers (MLmodel/views.py)
– Templates Engine (templates/*.html)
• Static Asset Server (static/, staticfiles/)
• Database (SQLite: db.sqlite3)
• ML Inference Layer
– ML model loader (MLmodel/model.py or root model.py)
– Data preprocessing (CSV files, Pandas)
b. Relationships & interactions
1. User submits a request (e.g., diopter value) via HTML form → HTTP POST to Django URL.
2. URL Router dispatches to appropriate view function in MLmodel/views.py.
3. View loads/preprocesses input, calls ML Inference Layer to compute results.
4. Optionally logs input/result to SQLite via Django ORM (MLmodel/models.py).
5. View renders a template (diopter_result.html) with prediction and returns HTML response.
6. Client displays results; static assets (CSS/JS) are served either by Django or a CDN.
c. Architectural patterns & principles
• Django’s Model-View-Template (MVT) pattern
• Single monolithic service (no microservices)
• Separation of concerns:
• Models handle DB schema
• Views contain controller logic & ML calls
• Templates render UI
• Static folder for assets
• Lightweight, file-based persistence (SQLite) for prototyping
d. Key technologies/frameworks/libraries
• Python 3.x, Django
• SQLite3 (default Django DB)
• Pandas/NumPy (data loading from CSVs)
• scikit-learn or custom ML code (in model.py)
• HTML/CSS for front-end templates