# codewithnill/studycircle-peer_study_group_finder architecture

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

- Interactive diagram: https://gitdiagram.com/codewithnill/studycircle-peer_study_group_finder
- Repository: https://github.com/codewithnill/studycircle-peer_study_group_finder

## Overview

This is the NestJS backend for StudyCircle. The observable runtime is currently a starter API: a request enters through the global server setup, passes shared input/output handling, and reaches a sample root endpoint; feature modules are registered but empty. The source comments describe planned authentication, study groups, sessions, chat, and administration capabilities. Prisma owns the database connection. Feature relationships beyond root-module registration are not shown, so they are not inferred here.

Main entry points: [`backend/src/app.module.ts`](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.module.ts) (Application composition), [`backend/src/main.ts`](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/main.ts) (HTTP server setup), [`backend/src/common/interceptors/response.interceptor.ts`](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/interceptors/response.interceptor.ts) (Success response shaping), [`backend/src/common/utils/case-converter.ts`](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/utils/case-converter.ts) (Key conversion helpers)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["API runtime"]
  node_server["HTTP server setup<br/>[main.ts]"]
  node_root["Application composition<br/>[app.module.ts]"]
  node_controller["Sample endpoint<br/>[app.controller.ts]"]
  node_service["Hello response<br/>[app.service.ts]"]
  node_request_keys["Request key conversion"]
  node_validation["Input validation"]
  node_case_conversion["Key conversion helpers<br/>[case-converter.ts]"]
  node_response["Success response shaping"]
  node_pagination["Pagination helpers<br/>[pagination.ts]"]
  node_errors["Error response handling"]
end

subgraph group_domains["Product domains"]
  node_domain_constants["Domain constants"]
  node_auth["Authentication<br/>[auth.module.ts]"]
  node_users["User accounts<br/>[users.module.ts]"]
  node_groups["Study groups<br/>[groups.module.ts]"]
  node_sessions["Study sessions<br/>[sessions.module.ts]"]
  node_chat["Group chat<br/>[chat.module.ts]"]
  node_admin["Administration<br/>[admin.module.ts]"]
end

subgraph group_data["Persistence"]
  node_prisma["Prisma database client<br/>[prisma.service.ts]"]
end

node_client(("API client"))
node_database[("PostgreSQL")]

node_client -->|"sends requests"| node_server
node_server -->|"creates app"| node_root
node_server -->|"applies first"| node_request_keys
node_server -->|"applies second"| node_validation
node_server -->|"applies globally"| node_response
node_server -->|"applies globally"| node_errors
node_root -->|"registers"| node_controller
node_root -->|"provides"| node_service
node_controller -->|"calls"| node_service
node_response -->|"detects list results"| node_pagination
node_response -->|"converts response keys"| node_case_conversion
node_request_keys -->|"converts request keys"| node_case_conversion
node_validation -->|"formats field names"| node_case_conversion
node_root -->|"registers"| node_auth
node_root -->|"registers"| node_users
node_root -->|"registers"| node_groups
node_root -->|"registers"| node_sessions
node_root -->|"registers"| node_chat
node_root -->|"registers"| node_admin
node_root -->|"registers"| node_prisma
node_prisma -->|"connects through adapter"| node_database

click node_server "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/main.ts"
click node_root "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.module.ts"
click node_controller "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.controller.ts"
click node_service "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.service.ts"
click node_request_keys "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/pipes/snake-to-camel.pipe.ts"
click node_validation "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/pipes/validation-pipe.factory.ts"
click node_case_conversion "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/utils/case-converter.ts"
click node_response "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/interceptors/response.interceptor.ts"
click node_pagination "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/pagination/pagination.ts"
click node_errors "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/filters/all-exceptions.filter.ts"
click node_domain_constants "https://github.com/codewithnill/studycircle-peer_study_group_finder/tree/main/backend/src/common/constants"
click node_auth "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/auth/auth.module.ts"
click node_users "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/users/users.module.ts"
click node_groups "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/groups/groups.module.ts"
click node_sessions "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/sessions/sessions.module.ts"
click node_chat "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/chat/chat.module.ts"
click node_admin "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/admin/admin.module.ts"
click node_prisma "https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/prisma/prisma.service.ts"

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_server,node_root,node_controller,node_service,node_request_keys,node_validation,node_case_conversion,node_response,node_pagination,node_errors,node_client toneBlue
class node_domain_constants,node_auth,node_users,node_groups,node_sessions,node_chat,node_admin,node_database toneAmber
class node_prisma toneMint
```

## Components

### API runtime

- [HTTP server setup](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/main.ts): `backend/src/main.ts`
- [Application composition](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.module.ts): `backend/src/app.module.ts`
- [Sample endpoint](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.controller.ts): `backend/src/app.controller.ts`
- [Hello response](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/app.service.ts): `backend/src/app.service.ts`
- [Request key conversion](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/pipes/snake-to-camel.pipe.ts): `backend/src/common/pipes/snake-to-camel.pipe.ts`
- [Input validation](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/pipes/validation-pipe.factory.ts): `backend/src/common/pipes/validation-pipe.factory.ts`
- [Key conversion helpers](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/utils/case-converter.ts): `backend/src/common/utils/case-converter.ts`
- [Success response shaping](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/interceptors/response.interceptor.ts): `backend/src/common/interceptors/response.interceptor.ts`
- [Pagination helpers](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/pagination/pagination.ts): `backend/src/common/pagination/pagination.ts`
- [Error response handling](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/common/filters/all-exceptions.filter.ts): `backend/src/common/filters/all-exceptions.filter.ts`

### Product domains

- [Domain constants](https://github.com/codewithnill/studycircle-peer_study_group_finder/tree/main/backend/src/common/constants): `backend/src/common/constants`
- [Authentication](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/auth/auth.module.ts): `backend/src/auth/auth.module.ts`
- [User accounts](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/users/users.module.ts): `backend/src/users/users.module.ts`
- [Study groups](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/groups/groups.module.ts): `backend/src/groups/groups.module.ts`
- [Study sessions](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/sessions/sessions.module.ts): `backend/src/sessions/sessions.module.ts`
- [Group chat](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/chat/chat.module.ts): `backend/src/chat/chat.module.ts`
- [Administration](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/admin/admin.module.ts): `backend/src/admin/admin.module.ts`

### Persistence

- [Prisma database client](https://github.com/codewithnill/studycircle-peer_study_group_finder/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`

### Other components

- **API client**
- **PostgreSQL**

## Connections

- API client → HTTP server setup: sends requests (evidence: `backend/src/main.ts`)
- HTTP server setup → Application composition: creates app (evidence: `backend/src/main.ts`)
- HTTP server setup → Request key conversion: applies first (evidence: `backend/src/main.ts`)
- HTTP server setup → Input validation: applies second (evidence: `backend/src/main.ts`)
- HTTP server setup → Success response shaping: applies globally (evidence: `backend/src/main.ts`)
- HTTP server setup → Error response handling: applies globally (evidence: `backend/src/main.ts`)
- Application composition → Sample endpoint: registers (evidence: `backend/src/app.module.ts`)
- Application composition → Hello response: provides (evidence: `backend/src/app.module.ts`)
- Sample endpoint → Hello response: calls (evidence: `backend/src/app.controller.ts`)
- Success response shaping → Pagination helpers: detects list results (evidence: `backend/src/common/interceptors/response.interceptor.ts`)
- Success response shaping → Key conversion helpers: converts response keys (evidence: `backend/src/common/interceptors/response.interceptor.ts`)
- Request key conversion → Key conversion helpers: converts request keys (evidence: `backend/src/common/pipes/snake-to-camel.pipe.ts`)
- Input validation → Key conversion helpers: formats field names (evidence: `backend/src/common/pipes/validation-pipe.factory.ts`)
- Application composition → Authentication: registers (evidence: `backend/src/app.module.ts`)
- Application composition → User accounts: registers (evidence: `backend/src/app.module.ts`)
- Application composition → Study groups: registers (evidence: `backend/src/app.module.ts`)
- Application composition → Study sessions: registers (evidence: `backend/src/app.module.ts`)
- Application composition → Group chat: registers (evidence: `backend/src/app.module.ts`)
- Application composition → Administration: registers (evidence: `backend/src/app.module.ts`)
- Application composition → Prisma database client: registers (evidence: `backend/src/app.module.ts`)
- Prisma database client → PostgreSQL: connects through adapter (evidence: `backend/src/prisma/prisma.service.ts`)
