# romancypherpunk/12axes architecture

> Architecture diagram of the GitHub repository romancypherpunk/12axes, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/romancypherpunk/12axes
- Repository: https://github.com/romancypherpunk/12axes

## Overview

12 Axes is an anonymous political-orientation quiz: users choose a quiz length, answer statements and optional archetype questions, then receive twelve axis scores and matches against ideology, country, and personality catalogs. The React app submits answers to a Spring API; scoring and matching produce results that the app presents with comparisons and sharing options. The README documents additional result features and static profile pages. Some subsystems are represented at directory level because their implementation was not sampled; edges without direct source evidence are omitted.

Main entry points: [`backend/src/main/java/com/twelveaxes/controller/QuizController.java`](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/controller/QuizController.java) (Quiz endpoints), [`frontend/src/App.tsx`](https://github.com/romancypherpunk/12axes/blob/main/frontend/src/App.tsx) (Quiz app), [`backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java`](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java) (Ideology matching), [`backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java`](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java) (Country matching)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Quiz experience"]
  node_app["Quiz app<br/>[App.tsx]"]
  node_quiz_api["Quiz API client<br/>[quizApi.ts]"]
  node_result_ui["Results screens<br/>[ResultsScreen.tsx]"]
  node_result_sections["Result sections"]
end

subgraph group_api["REST API"]
  node_quiz_controller["Quiz endpoints"]
  node_compare_controller["Compare endpoints"]
end

subgraph group_engine["Scoring and matching"]
  node_data_service["Catalog data"]
  node_scoring["Answer scoring"]
  node_axis_results["Axis result model<br/>[AxisResult.java]"]
  node_ideology_match["Ideology matching"]
  node_country_match["Country matching"]
  node_personality_match["Personality matching"]
  node_match_scorer["Compatibility scorer"]
  node_religion_filter["Religion filter"]
end

subgraph group_results["Result features"]
  node_share_card["Share card<br/>[shareCard.ts]"]
  node_pdf_report["PDF report<br/>[PdfReport.tsx]"]
  node_profile_pages["Catalog profile pages"]
  node_tensions["Axis tensions"]
  node_compare_service["Profile comparison"]
end

node_visitor(("Quiz taker"))

node_visitor -->|"answers quiz"| node_app
node_app -->|"requests quiz"| node_quiz_api
node_quiz_api -.->|"calls endpoints"| node_quiz_controller
node_quiz_controller -->|"loads quiz data"| node_data_service
node_quiz_controller -->|"scores answers"| node_scoring
node_scoring -.->|"produces scores"| node_axis_results
node_quiz_controller -->|"requests matches"| node_ideology_match
node_quiz_controller -->|"requests matches"| node_personality_match
node_quiz_controller -.->|"requests matches"| node_country_match
node_ideology_match -->|"reads catalog"| node_data_service
node_country_match -->|"reads catalog"| node_data_service
node_personality_match -->|"reads catalog"| node_data_service
node_ideology_match -->|"scores profiles"| node_match_scorer
node_country_match -->|"scores profiles"| node_match_scorer
node_personality_match -->|"scores profiles"| node_match_scorer
node_ideology_match -->|"filters profiles"| node_religion_filter
node_country_match -->|"filters profiles"| node_religion_filter
node_personality_match -->|"filters profiles"| node_religion_filter
node_visitor -.->|"requests comparison"| node_compare_controller
node_compare_controller -->|"scores axis values"| node_scoring
node_compare_controller -->|"delegates comparison"| node_compare_service
node_app -->|"shows results"| node_result_ui
node_result_ui -.->|"renders sections"| node_result_sections
node_app -.->|"offers sharing"| node_share_card
node_app -.->|"offers report"| node_pdf_report
node_visitor -.->|"browses profiles"| node_profile_pages
node_quiz_controller -.->|"adds tensions"| node_tensions

click node_app "https://github.com/romancypherpunk/12axes/blob/main/frontend/src/App.tsx"
click node_quiz_api "https://github.com/romancypherpunk/12axes/blob/main/frontend/src/services/quizApi.ts"
click node_result_ui "https://github.com/romancypherpunk/12axes/blob/main/frontend/src/components/editorial/ResultsScreen.tsx"
click node_result_sections "https://github.com/romancypherpunk/12axes/tree/main/frontend/src/components/results"
click node_share_card "https://github.com/romancypherpunk/12axes/blob/main/frontend/src/utils/shareCard.ts"
click node_pdf_report "https://github.com/romancypherpunk/12axes/blob/main/frontend/src/components/report/PdfReport.tsx"
click node_profile_pages "https://github.com/romancypherpunk/12axes/tree/main/frontend/scripts"
click node_quiz_controller "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/controller/QuizController.java"
click node_compare_controller "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/controller/CompareController.java"
click node_data_service "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/QuizDataService.java"
click node_scoring "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/ScoringService.java"
click node_axis_results "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/model/AxisResult.java"
click node_ideology_match "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java"
click node_country_match "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java"
click node_personality_match "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/PersonalityMatcherService.java"
click node_match_scorer "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/ProfileMatchScorer.java"
click node_religion_filter "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/ReligionFilter.java"
click node_tensions "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/AxisTensionService.java"
click node_compare_service "https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/CompareService.java"

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_app,node_quiz_api,node_result_ui,node_result_sections toneBlue
class node_quiz_controller,node_compare_controller toneAmber
class node_data_service,node_scoring,node_axis_results,node_ideology_match,node_country_match,node_personality_match,node_match_scorer,node_religion_filter toneMint
class node_share_card,node_pdf_report,node_profile_pages,node_tensions,node_compare_service toneRose
class node_visitor toneIndigo
```

## Components

### Quiz experience

- [Quiz app](https://github.com/romancypherpunk/12axes/blob/main/frontend/src/App.tsx): `frontend/src/App.tsx`
- [Quiz API client](https://github.com/romancypherpunk/12axes/blob/main/frontend/src/services/quizApi.ts): `frontend/src/services/quizApi.ts`
- [Results screens](https://github.com/romancypherpunk/12axes/blob/main/frontend/src/components/editorial/ResultsScreen.tsx): `frontend/src/components/editorial/ResultsScreen.tsx`
- [Result sections](https://github.com/romancypherpunk/12axes/tree/main/frontend/src/components/results): `frontend/src/components/results`

### REST API

- [Quiz endpoints](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/controller/QuizController.java): `backend/src/main/java/com/twelveaxes/controller/QuizController.java`
- [Compare endpoints](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/controller/CompareController.java): `backend/src/main/java/com/twelveaxes/controller/CompareController.java`

### Scoring and matching

- [Catalog data](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/QuizDataService.java): `backend/src/main/java/com/twelveaxes/service/QuizDataService.java`
- [Answer scoring](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/ScoringService.java): `backend/src/main/java/com/twelveaxes/service/ScoringService.java`
- [Axis result model](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/model/AxisResult.java): `backend/src/main/java/com/twelveaxes/model/AxisResult.java`
- [Ideology matching](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java): `backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java`
- [Country matching](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java): `backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java`
- [Personality matching](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/PersonalityMatcherService.java): `backend/src/main/java/com/twelveaxes/service/PersonalityMatcherService.java`
- [Compatibility scorer](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/ProfileMatchScorer.java): `backend/src/main/java/com/twelveaxes/service/ProfileMatchScorer.java`
- [Religion filter](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/ReligionFilter.java): `backend/src/main/java/com/twelveaxes/service/ReligionFilter.java`

### Result features

- [Share card](https://github.com/romancypherpunk/12axes/blob/main/frontend/src/utils/shareCard.ts): `frontend/src/utils/shareCard.ts`
- [PDF report](https://github.com/romancypherpunk/12axes/blob/main/frontend/src/components/report/PdfReport.tsx): `frontend/src/components/report/PdfReport.tsx`
- [Catalog profile pages](https://github.com/romancypherpunk/12axes/tree/main/frontend/scripts): `frontend/scripts`
- [Axis tensions](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/AxisTensionService.java): `backend/src/main/java/com/twelveaxes/service/AxisTensionService.java`
- [Profile comparison](https://github.com/romancypherpunk/12axes/blob/main/backend/src/main/java/com/twelveaxes/service/CompareService.java): `backend/src/main/java/com/twelveaxes/service/CompareService.java`

### Other components

- **Quiz taker**

## Connections

- Quiz taker → Quiz app: answers quiz
- Quiz app → Quiz API client: requests quiz (evidence: `frontend/src/App.tsx`)
- Quiz API client → Quiz endpoints: calls endpoints
- Quiz endpoints → Catalog data: loads quiz data (evidence: `backend/src/main/java/com/twelveaxes/controller/QuizController.java`)
- Quiz endpoints → Answer scoring: scores answers (evidence: `backend/src/main/java/com/twelveaxes/controller/QuizController.java`)
- Answer scoring → Axis result model: produces scores (evidence: `backend/src/main/java/com/twelveaxes/service/ScoringService.java`)
- Quiz endpoints → Ideology matching: requests matches (evidence: `backend/src/main/java/com/twelveaxes/controller/QuizController.java`)
- Quiz endpoints → Personality matching: requests matches (evidence: `backend/src/main/java/com/twelveaxes/controller/QuizController.java`)
- Quiz endpoints → Country matching: requests matches (evidence: `backend/src/main/java/com/twelveaxes/controller/QuizController.java`)
- Ideology matching → Catalog data: reads catalog (evidence: `backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java`)
- Country matching → Catalog data: reads catalog (evidence: `backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java`)
- Personality matching → Catalog data: reads catalog (evidence: `backend/src/main/java/com/twelveaxes/service/PersonalityMatcherService.java`)
- Ideology matching → Compatibility scorer: scores profiles (evidence: `backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java`)
- Country matching → Compatibility scorer: scores profiles (evidence: `backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java`)
- Personality matching → Compatibility scorer: scores profiles (evidence: `backend/src/main/java/com/twelveaxes/service/PersonalityMatcherService.java`)
- Ideology matching → Religion filter: filters profiles (evidence: `backend/src/main/java/com/twelveaxes/service/IdeologyMatcherService.java`)
- Country matching → Religion filter: filters profiles (evidence: `backend/src/main/java/com/twelveaxes/service/CountryMatcherService.java`)
- Personality matching → Religion filter: filters profiles (evidence: `backend/src/main/java/com/twelveaxes/service/PersonalityMatcherService.java`)
- Quiz taker → Compare endpoints: requests comparison
- Compare endpoints → Answer scoring: scores axis values (evidence: `backend/src/main/java/com/twelveaxes/controller/CompareController.java`)
- Compare endpoints → Profile comparison: delegates comparison (evidence: `backend/src/main/java/com/twelveaxes/controller/CompareController.java`)
- Quiz app → Results screens: shows results (evidence: `frontend/src/App.tsx`)
- Results screens → Result sections: renders sections
- Quiz app → Share card: offers sharing (evidence: `frontend/src/App.tsx`)
- Quiz app → PDF report: offers report
- Quiz taker → Catalog profile pages: browses profiles
- Quiz endpoints → Axis tensions: adds tensions (evidence: `backend/src/main/java/com/twelveaxes/controller/QuizController.java`)
