# call-him-for-coffee/psycho-matrix architecture

> Architecture diagram of the GitHub repository call-him-for-coffee/psycho-matrix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-08-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/call-him-for-coffee/psycho-matrix
- Repository: https://github.com/call-him-for-coffee/psycho-matrix

## Overview

#### 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: [`djangoproject/mainapp/views.py`](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/views.py) (API views), [`vueproject/src/router/index.js`](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/router/index.js) (Page router), [`djangoproject/djangoproject/settings.py`](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/settings.py) (Project settings), [`vueproject/src/api/common.js`](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/api/common.js) (API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_backend["Django Backend"]
  node_manage["manage.py<br/>Django CLI<br/>[manage.py]"]
  node_wsgi["WSGI entry<br/>Django deployment<br/>[wsgi.py]"]
  node_asgi["ASGI entry<br/>Django deployment<br/>[asgi.py]"]
  node_settings["Project settings<br/>Django configuration<br/>[settings.py]"]
  node_root_urls["Root URL routing<br/>Django router<br/>[urls.py]"]
  node_views["API views<br/>request orchestration<br/>[views.py]"]
  node_serializers["Serializers<br/>API translation<br/>[serializers.py]"]
  node_calculator{{"Psycho-matrix calculator<br/>domain service<br/>[calculator.py]"}}
  node_models[("Domain models<br/>Django ORM<br/>[models.py]")]
  node_migration["Initial schema migration<br/>database migration<br/>[0001_initial.py]"]
end

subgraph group_frontend["Vue Client"]
  node_main["SPA bootstrap<br/>Vue entry point<br/>[main.js]"]
  node_app["Application shell<br/>Vue root component<br/>[App.vue]"]
  node_router["Page router<br/>Vue Router<br/>[index.js]"]
  node_home["Home view<br/>Vue page<br/>[HomeView.vue]"]
  node_registration["Registration view<br/>Vue page"]
  node_compare["Comparison view<br/>Vue page<br/>[CompareView.vue]"]
  node_api["API client<br/>HTTP service<br/>[common.js]"]
end

node_manage -->|"loads"| node_settings
node_wsgi -->|"loads"| node_settings
node_asgi -->|"loads"| node_settings
node_settings -->|"configures"| node_root_urls
node_root_urls -->|"dispatches"| node_views
node_views -->|"calculates"| node_calculator
node_views -->|"reads and writes"| node_models
node_views -->|"returns payloads through"| node_serializers
node_serializers -->|"serializes"| node_models
node_migration -->|"creates schema for"| node_models
node_main -->|"mounts"| node_app
node_app -->|"hosts"| node_router
node_router -->|"navigates to"| node_home
node_router -->|"navigates to"| node_registration
node_router -->|"navigates to"| node_compare
node_registration -->|"submits through"| node_api
node_compare -->|"requests through"| node_api
node_api -->|"HTTP API requests"| node_views

click node_manage "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/manage.py"
click node_wsgi "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/wsgi.py"
click node_asgi "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/asgi.py"
click node_settings "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/settings.py"
click node_root_urls "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/urls.py"
click node_views "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/views.py"
click node_serializers "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/serializers.py"
click node_calculator "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/calculator.py"
click node_models "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/models.py"
click node_migration "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/migrations/0001_initial.py"
click node_main "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/main.js"
click node_app "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/App.vue"
click node_router "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/router/index.js"
click node_home "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/views/HomeView.vue"
click node_registration "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/views/RegistrationView.vue"
click node_compare "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/views/CompareView.vue"
click node_api "https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/api/common.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_manage,node_wsgi,node_asgi,node_settings,node_root_urls,node_views,node_serializers,node_calculator,node_models,node_migration toneBlue
class node_main,node_app,node_router,node_home,node_registration,node_compare,node_api toneAmber
```

## Components

### Django Backend

Persistence and psycho-matrix API runtime.

- [manage.py](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/manage.py): Django CLI · Development and administrative entry point. · `djangoproject/manage.py`
- [WSGI entry](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/wsgi.py): Django deployment · `djangoproject/djangoproject/wsgi.py`
- [ASGI entry](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/asgi.py): Django deployment · `djangoproject/djangoproject/asgi.py`
- [Project settings](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/settings.py): Django configuration · Configures applications, middleware, and database. · `djangoproject/djangoproject/settings.py`
- [Root URL routing](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/djangoproject/urls.py): Django router · Routes requests into the domain app. · `djangoproject/djangoproject/urls.py`
- [API views](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/views.py): request orchestration · Validates requests and coordinates domain work. · `djangoproject/mainapp/views.py`
- [Serializers](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/serializers.py): API translation · Maps domain and model data to client payloads. · `djangoproject/mainapp/serializers.py`
- [Psycho-matrix calculator](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/calculator.py): domain service · Computes psycho-matrix results outside HTTP layers. · `djangoproject/mainapp/calculator.py`
- [Domain models](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/models.py): Django ORM · Persistent submitted and computed records. · `djangoproject/mainapp/models.py`
- [Initial schema migration](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/djangoproject/mainapp/migrations/0001_initial.py): database migration · `djangoproject/mainapp/migrations/0001_initial.py`

### Vue Client

Single-page user interface.

- [SPA bootstrap](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/main.js): Vue entry point · `vueproject/src/main.js`
- [Application shell](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/App.vue): Vue root component · `vueproject/src/App.vue`
- [Page router](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/router/index.js): Vue Router · Selects home, registration, and comparison workflows. · `vueproject/src/router/index.js`
- [Home view](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/views/HomeView.vue): Vue page · `vueproject/src/views/HomeView.vue`
- [Registration view](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/views/RegistrationView.vue): Vue page · Collects user inputs for matrix calculation. · `vueproject/src/views/RegistrationView.vue`
- [Comparison view](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/views/CompareView.vue): Vue page · Displays comparative matrix results. · `vueproject/src/views/CompareView.vue`
- [API client](https://github.com/call-him-for-coffee/psycho-matrix/blob/main/vueproject/src/api/common.js): HTTP service · Centralizes client transport and backend request setup. · `vueproject/src/api/common.js`

## Connections

- 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
