How osdagscreeningtasks/prismshapeviewer works
Project type and purpose
• Prism Viewer is a cross-platform, full-stack 3D visualization application.
• It consists of:
• A shared core library (business logic, data models, plugin system)
• A desktop client (PySide2 + pythonOCC)
• A web client (React) + RESTful backend (Django)
File structure
• Top-level “src/” splits into three areas:
• core/ – business logic, database interface, plugin manager + default plugins
• desktop/ – PySide2 UI and CAD renderer
• web/ – React frontend (src/web/frontend) and Django backend (src/web/backend)
• Configuration & CI: pyproject.toml, requirements.txt, pytest.ini, GitHub Actions CI
• Build scripts: run_desktop.py, PyInstaller instructions in README
Pull additional insights from README
• Architecture overview confirms the three-layer layout and plugin mechanism
• Tech stack: Python 3.8+, PySide2, pythonOCC, Django + Django REST Framework, React, Node.js
• CI/CD: automated testing, builds via GitHub Actions
a. Main components:
• Shared Core Library
– Models & database adapter
– Plugin interface & manager
• Desktop Application
– Main Window (PySide2)
– CAD Renderer (pythonOCC)
– Plugin loader → Core.PluginManager → Core.Plugins
– Local SQLite database (via Core.Database)
• Web Application
– Backend (Django REST API)
· URL router → Views → Serializers → Core.Models → Database (PostgreSQL/MySQL)
· Management commands (populate_prisms)
– Frontend (React)
· Component tree (PrismSelector, PrismViewer, ThreeDViewer)
· Fetches REST endpoints for listing, detail, compute, CAD data
• External services & CI/CD
– GitHub Actions for tests & builds
– PyInstaller build for desktop
– Gunicorn + Nginx for serving Django & static React build
b. Relationships & interactions:
• Desktop UI ↔ Core (invokes business logic, plugin resolution, CAD data)
• Web Frontend → HTTP calls → Django REST API → Core → Database
c. Architectural patterns & principles:
• Modular layering: presentation (UI), domain (core), data (DB)
• Plugin architecture (inversion of control)
• MVC (Django) and component-based UI (React)
• Single responsibility and separation of concerns
d. Key technologies/frameworks:
– Python / PySide2 / pythonOCC
– Django & Django REST Framework
– React / Webpack / Node.js
– SQLite (desktop), PostgreSQL/MySQL (web)
– GitHub Actions, PyInstaller, Gunicorn, Nginx
Elements
• Data flow (e.g., React → API → DB)
• Dependencies (e.g., Desktop → Core; Django → Core)
• Another for desktop components
• A third for web backend
• A fourth for web frontend