# mozesbence/matekos_leetcode architecture

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

- Interactive diagram: https://gitdiagram.com/mozesbence/matekos_leetcode
- Repository: https://github.com/mozesbence/matekos_leetcode

## Overview

Math-solve is a Vue client backed by an Express API for math-task practice, accounts, community and commerce. Users navigate the app, fetch task or community data, and submit actions through API queries to server routes; routes dispatch to controllers and community controllers delegate through a service/repository layer. The README describes local MySQL/XAMPP operation. The source index identifies a parallel backend_test API; it is shown as a separate implementation branch. Many domain modules are listed but unsampled, so their internal calls are omitted.

Main entry points: [`src/app.js`](https://github.com/mozesbence/matekos_leetcode/blob/main/src/app.js) (API application), [`backend_test/app.js`](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/app.js) (Test API application), [`src/router/index.ts`](https://github.com/mozesbence/matekos_leetcode/blob/main/src/router/index.ts) (Page router), [`src/views/CommunityView.vue`](https://github.com/mozesbence/matekos_leetcode/blob/main/src/views/CommunityView.vue) (Community page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Vue client"]
  node_router["Page router<br/>[index.ts]"]
  node_community_view["Community page<br/>[CommunityView.vue]"]
  node_community_query["Community queries<br/>[communityQuery.ts]"]
  node_profile_query["Profile queries<br/>[profileQuery.ts]"]
  node_task_query["Task queries"]
  node_store_view["Store page<br/>[StoreView.vue]"]
  node_axios["HTTP client<br/>[axios.ts]"]
end

subgraph group_server["Express API"]
  node_server_app["API application<br/>[app.js]"]
  node_community_routes["Community routes<br/>[communityRoute.js]"]
  node_task_routes["Task routes<br/>[tasksRoute.js]"]
  node_community_controller["Community controller"]
  node_community_service["Community service"]
  node_task_domain["Task handling"]
  node_auth_domain["Accounts and profiles"]
  node_contest_domain["Competitions"]
  node_store_domain["Store and rewards"]
end

subgraph group_community["Community data layer"]
  node_repository["Community repository"]
  node_db_context["Database context<br/>[dbContext.js]"]
end

subgraph group_testapi["Backend test API"]
  node_test_app["Test API application<br/>[app.js]"]
  node_test_community_routes["Test community routes<br/>[communityRoute.js]"]
  node_test_settings_routes["Test settings routes"]
  node_test_community_controller["Test community controller"]
  node_test_community_service["Test community service"]
end

node_user(("App user"))

node_user -->|"navigates"| node_router
node_router -->|"routes to"| node_community_view
node_community_view -->|"uses queries"| node_community_query
node_community_query -->|"sends requests"| node_axios
node_task_query -->|"fetches task"| node_axios
node_store_view -->|"loads profile"| node_profile_query
node_server_app -->|"mounts routes"| node_community_routes
node_server_app -->|"mounts routes"| node_task_routes
node_community_routes -->|"dispatches"| node_community_controller
node_community_controller -->|"delegates to"| node_community_service
node_community_service -->|"calls"| node_repository
node_repository -->|"uses database"| node_db_context
node_test_app -->|"mounts routes"| node_test_community_routes
node_test_community_routes -->|"dispatches"| node_test_community_controller
node_test_community_controller -->|"delegates to"| node_test_community_service
node_test_app -->|"mounts routes"| node_test_settings_routes

click node_router "https://github.com/mozesbence/matekos_leetcode/blob/main/src/router/index.ts"
click node_community_view "https://github.com/mozesbence/matekos_leetcode/blob/main/src/views/CommunityView.vue"
click node_community_query "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/community/communityQuery.ts"
click node_profile_query "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/profile/profileQuery.ts"
click node_task_query "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/taskSolving/taskSolvingQuery.ts"
click node_store_view "https://github.com/mozesbence/matekos_leetcode/blob/main/src/views/StoreView.vue"
click node_axios "https://github.com/mozesbence/matekos_leetcode/blob/main/src/lib/axios.ts"
click node_server_app "https://github.com/mozesbence/matekos_leetcode/blob/main/src/app.js"
click node_community_routes "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/routes/communityRoute.js"
click node_task_routes "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/routes/tasksRoute.js"
click node_community_controller "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/controllers/communityControllers.js"
click node_community_service "https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/services/communityService.js"
click node_task_domain "https://github.com/mozesbence/matekos_leetcode/tree/main/src/api"
click node_auth_domain "https://github.com/mozesbence/matekos_leetcode/tree/main/src/api"
click node_contest_domain "https://github.com/mozesbence/matekos_leetcode/tree/main/src/api"
click node_store_domain "https://github.com/mozesbence/matekos_leetcode/tree/main/src/api"
click node_repository "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/repositories/communityRepository.js"
click node_db_context "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/database/dbContext.js"
click node_test_app "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/app.js"
click node_test_community_routes "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/routes/communityRoute.js"
click node_test_settings_routes "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/routes/settingsConfirmRoute.js"
click node_test_community_controller "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/controllers/communityControllers.js"
click node_test_community_service "https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/services/communityService.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_router,node_community_view,node_community_query,node_profile_query,node_task_query,node_store_view,node_axios,node_user toneBlue
class node_server_app,node_community_routes,node_task_routes,node_community_controller,node_community_service,node_task_domain,node_auth_domain,node_contest_domain,node_store_domain toneAmber
class node_repository,node_db_context toneMint
class node_test_app,node_test_community_routes,node_test_settings_routes,node_test_community_controller,node_test_community_service toneRose
```

## Components

### Vue client

- [Page router](https://github.com/mozesbence/matekos_leetcode/blob/main/src/router/index.ts): `src/router/index.ts`
- [Community page](https://github.com/mozesbence/matekos_leetcode/blob/main/src/views/CommunityView.vue): `src/views/CommunityView.vue`
- [Community queries](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/community/communityQuery.ts): `src/api/community/communityQuery.ts`
- [Profile queries](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/profile/profileQuery.ts): `src/api/profile/profileQuery.ts`
- [Task queries](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/taskSolving/taskSolvingQuery.ts): `src/api/taskSolving/taskSolvingQuery.ts`
- [Store page](https://github.com/mozesbence/matekos_leetcode/blob/main/src/views/StoreView.vue): `src/views/StoreView.vue`
- [HTTP client](https://github.com/mozesbence/matekos_leetcode/blob/main/src/lib/axios.ts): `src/lib/axios.ts`

### Express API

- [API application](https://github.com/mozesbence/matekos_leetcode/blob/main/src/app.js): `src/app.js`
- [Community routes](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/routes/communityRoute.js): `src/api/routes/communityRoute.js`
- [Task routes](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/routes/tasksRoute.js): `src/api/routes/tasksRoute.js`
- [Community controller](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/controllers/communityControllers.js): `src/api/controllers/communityControllers.js`
- [Community service](https://github.com/mozesbence/matekos_leetcode/blob/main/src/api/services/communityService.js): `src/api/services/communityService.js`
- [Task handling](https://github.com/mozesbence/matekos_leetcode/tree/main/src/api): `src/api`
- [Accounts and profiles](https://github.com/mozesbence/matekos_leetcode/tree/main/src/api): `src/api`
- [Competitions](https://github.com/mozesbence/matekos_leetcode/tree/main/src/api): `src/api`
- [Store and rewards](https://github.com/mozesbence/matekos_leetcode/tree/main/src/api): `src/api`

### Community data layer

- [Community repository](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/repositories/communityRepository.js): `backend_test/api/repositories/communityRepository.js`
- [Database context](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/database/dbContext.js): `backend_test/api/database/dbContext.js`

### Backend test API

- [Test API application](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/app.js): `backend_test/app.js`
- [Test community routes](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/routes/communityRoute.js): `backend_test/api/routes/communityRoute.js`
- [Test settings routes](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/routes/settingsConfirmRoute.js): `backend_test/api/routes/settingsConfirmRoute.js`
- [Test community controller](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/controllers/communityControllers.js): `backend_test/api/controllers/communityControllers.js`
- [Test community service](https://github.com/mozesbence/matekos_leetcode/blob/main/backend_test/api/services/communityService.js): `backend_test/api/services/communityService.js`

### Other components

- **App user**

## Connections

- App user → Page router: navigates (evidence: `src/router/index.ts`)
- Page router → Community page: routes to (evidence: `src/router/index.ts`)
- Community page → Community queries: uses queries (evidence: `src/views/CommunityView.vue`)
- Community queries → HTTP client: sends requests (evidence: `src/api/community/communityQuery.ts`)
- Task queries → HTTP client: fetches task (evidence: `src/api/taskSolving/taskSolvingQuery.ts`)
- Store page → Profile queries: loads profile (evidence: `src/views/StoreView.vue`)
- API application → Community routes: mounts routes (evidence: `src/app.js`)
- API application → Task routes: mounts routes (evidence: `src/app.js`)
- Community routes → Community controller: dispatches
- Community controller → Community service: delegates to
- Community service → Community repository: calls
- Community repository → Database context: uses database (evidence: `backend_test/api/repositories/communityRepository.js`)
- Test API application → Test community routes: mounts routes (evidence: `backend_test/app.js`)
- Test community routes → Test community controller: dispatches (evidence: `backend_test/api/routes/communityRoute.js`)
- Test community controller → Test community service: delegates to (evidence: `backend_test/api/controllers/communityControllers.js`)
- Test API application → Test settings routes: mounts routes (evidence: `backend_test/app.js`)
