How qsoo/gnm works
Project Type and Purpose
• This is a full-stack interactive web application (“GNM”) that lets users explore virtual art galleries, upload photos, and have them transformed into famous artists’ styles (Monet, Klimt, Chun Kyung-ja) via AI style‐transfer models.
• Frontend: Vue.js SPA (Quasar)
• Backend: Django + Django REST Framework
• AI: PyTorch‐based style-transfer modules
• Database: relational (e.g. PostgreSQL or SQLite)
• Storage: local or cloud media storage for uploaded/processed images
Main Components
a. User Browser (Client)
• Vue.js SPA served from frontend/dist or directly via CDN/Nginx
• Routes, components, API clients under frontend/src
b. API Server
• Django project under backend/pjt (settings for local/production)
• Two main apps:
– galleries (gallery metadata, navigation)
– articles (guestbook entries + transformed image references)
• Authentication/session management (DRF, Django sessions)
• File‐upload endpoints (/api/upload)
• Swagger/OpenAPI docs served via drf-yasg
c. AI Style-Transfer Service
• PyTorch code modules under Models/<artist>/…/style_transfer (function.py, net.py, pretrained .tar and .pth)
• Could be deployed as a separate microservice or imported as a package
• Exposed via a local Python API or REST endpoint that the Django server invokes
d. Data Stores
• Relational Database (stores user, guestbook, gallery metadata)
• Media Storage (disk or S3 bucket for original & styled images)
• Static Assets (served via Django staticfiles or external CDN)
Component Interactions & Data Flow
1. User → Browser: clicks on galleries or uploads image
2. SPA → API Server:
– GET /api/galleries/ → list of galleries & metadata
– POST /api/upload/ → user image + selected style
3. API Server → Database: save metadata (guestbook post, image record)
4. API Server → AI Service: send image + style tag → receive stylized image buffer
5. API Server → Media Storage: write stylized image file, update DB record
6. API Server → SPA: return URL for styled image + any metadata
7. SPA → Browser: displays new image in “Special Exhibition” or guestbook
Architectural Patterns & Design Principles
• Layered architecture:
• Presentation (Vue.js components)
• Application/API layer (Django views/serializers)
• Domain logic (Django models + services)
• AI Service (style-transfer module)
• Persistence (DB + Media storage)
• Component‐based frontend (reusable Vue components per gallery/feature)
• Separation of concerns: style-transfer code isolated in its own module or service
• Config‐driven environments (Django settings/base.py, local.py, production.py)