How call-him-for-coffee/psycho-matrix works
Purpose and Topology
This is a split frontend/backend “psycho-matrix” application: a Vue single-page client consumes a Django backend that owns persistence, serialization, and calculation logic. The minimal root README provides no domain contract, so implementation details should be derived from the application modules.
• Backend project: djangoproject/djangoproject/
• Backend domain app: djangoproject/mainapp/
• Frontend client: vueproject/src/
Backend Runtime and Entry Points
Django is the server runtime. Standard WSGI and ASGI entry points permit deployment under synchronous or asynchronous Python servers; manage.py is the development/administrative entry point.
• djangoproject/manage.py
• djangoproject/djangoproject/wsgi.py
• djangoproject/djangoproject/asgi.py
Project configuration, installed applications, database configuration, middleware, and root URL inclusion are centralized in:
• djangoproject/djangoproject/settings.py
• djangoproject/djangoproject/urls.py
Domain, Persistence, and Calculation Boundary
mainapp is the backend bounded context. Its model layer defines persistent domain records and its migration establishes the initial database schema. Calculation behavior is intentionally separated from HTTP handlers, making calculator.py the likely core domain/service layer for psycho-matrix computations.
• djangoproject/mainapp/models.py
• djangoproject/mainapp/migrations/0001_initial.py
• djangoproject/mainapp/calculator.py
Expected flow: request inputs enter views, calculation logic derives matrix/domain results, and models may retain submitted or computed data.
API / Presentation Boundary
Django views are the backend request orchestration layer. Serializers form the explicit boundary between Python model/domain objects and client-facing payloads. Route registration begins at project URLs and is expected to dispatch into mainapp handlers.
• djangoproject/mainapp/views.py
• djangoproject/mainapp/serializers.py
• djangoproject/djangoproject/urls.py
Keep calculation rules out of serializers and views; those layers should validate/translate inputs and return stable API representations.
Vue Client Composition
The frontend is a Vue SPA bootstrapped from main.js, with App.vue as its application shell and Vue Router defining page-level navigation. Its primary user workflows appear to be home, registration, and comparison, consistent with collecting inputs and displaying calculated/comparative results.
• vueproject/src/main.js
• vueproject/src/App.vue
• vueproject/src/router/index.js
• vueproject/src/views/RegistrationView.vue
• vueproject/src/views/CompareView.vue
Frontend-to-Backend Integration
The dedicated API module is the client service boundary; Vue views/components should use it rather than directly coupling UI code to transport details. This is the likely location for backend base URLs, request setup, and shared HTTP behavior.
• vueproject/src/api/common.js
• vueproject/src/views/HomeView.vue
• vueproject/src/views/CompareView.vue
The client is built and configured as a separate Node/Vue project, while Django dependencies are isolated in the backend requirements file:
• vueproject/package.json
• vueproject/vue.config.js
• djangoproject/requirements.txt
Main entry points: views.py API views · index.js Page router · settings.py Project settings · common.js API client
Components 17
Django Backend
Persistence and psycho-matrix API runtime.
- manage.py · Development and administrative entry point.
djangoproject/manage.py - WSGI entry
djangoproject/djangoproject/wsgi.py - ASGI entry
djangoproject/djangoproject/asgi.py - Project settings · Configures applications, middleware, and database.
djangoproject/djangoproject/settings.py - Root URL routing · Routes requests into the domain app.
djangoproject/djangoproject/urls.py - API views · Validates requests and coordinates domain work.
djangoproject/mainapp/views.py - Serializers · Maps domain and model data to client payloads.
djangoproject/mainapp/serializers.py - Psycho-matrix calculator · Computes psycho-matrix results outside HTTP layers.
djangoproject/mainapp/calculator.py - Domain models · Persistent submitted and computed records.
djangoproject/mainapp/models.py - Initial schema migration
djangoproject/mainapp/migrations/0001_initial.py
Vue Client
Single-page user interface.
- SPA bootstrap
vueproject/src/main.js - Application shell
vueproject/src/App.vue - Page router · Selects home, registration, and comparison workflows.
vueproject/src/router/index.js - Home view
vueproject/src/views/HomeView.vue - Registration view · Collects user inputs for matrix calculation.
vueproject/src/views/RegistrationView.vue - Comparison view · Displays comparative matrix results.
vueproject/src/views/CompareView.vue - API client · Centralizes client transport and backend request setup.
vueproject/src/api/common.js
Connections 18
- manage.py → Project settings: loads
- WSGI entry → Project settings: loads
- ASGI entry → Project settings: loads
- Project settings → Root URL routing: configures
- Root URL routing → API views: dispatches
- API views → Psycho-matrix calculator: calculates
- API views → Domain models: reads and writes
- API views → Serializers: returns payloads through
- Serializers → Domain models: serializes
- Initial schema migration → Domain models: creates schema for
- SPA bootstrap → Application shell: mounts
- Application shell → Page router: hosts
- Page router → Home view: navigates to
- Page router → Registration view: navigates to
- Page router → Comparison view: navigates to
- Registration view → API client: submits through
- Comparison view → API client: requests through
- API client → API views: HTTP API requests