# krehantgajjar10/talkora architecture

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

- Interactive diagram: https://gitdiagram.com/krehantgajjar10/talkora
- Repository: https://github.com/krehantgajjar10/talkora

## Overview

Talkora is a community posting product with a Next.js interface and an Express API. Users register or log in, then can browse posts, view profiles, and submit or edit posts; authenticated actions use cookie-based sessions. The backend routes requests through validation and controllers into domain services, with Prisma-backed persistence. The excerpts establish API mounting and several controller/service calls; frontend-to-API behavior is directly visible for registration, while other frontend/API connections and unsampled integrations are left unasserted.

Main entry points: [`backend/src/app.ts`](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/app.ts) (Express application), [`backend/src/modules/auth/auth.controller.ts`](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.controller.ts) (Authentication controller), [`backend/src/modules/posts/posts.routes.ts`](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.routes.ts) (Post routes), [`backend/src/modules/auth/auth.service.ts`](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.service.ts) (Authentication service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_register_page["Registration page<br/>[page.tsx]"]
  node_feed_page["Community feed<br/>[page.tsx]"]
  node_post_page["Post detail<br/>[page.tsx]"]
  node_profile_page["User profile<br/>[page.tsx]"]
  node_submit_page["Post submission<br/>[page.tsx]"]
  node_auth_context["Session context<br/>[auth-context.tsx]"]
  node_api_client["HTTP API client<br/>[api.ts]"]
end

subgraph group_api["API routing"]
  node_api_server["Express application<br/>[app.ts]"]
  node_auth_routes["Authentication routes<br/>[auth.routes.ts]"]
  node_posts_routes["Post routes<br/>[posts.routes.ts]"]
  node_users_routes["User routes<br/>[users.routes.ts]"]
end

subgraph group_domains["Domain services"]
  node_auth_controller["Authentication controller<br/>[auth.controller.ts]"]
  node_auth_service["Authentication service<br/>[auth.service.ts]"]
  node_posts_controller["Post controller"]
  node_posts_service["Post service<br/>[posts.service.ts]"]
  node_users_controller["Profile controller"]
  node_users_service["Profile service<br/>[users.service.ts]"]
end

subgraph group_platform["Shared infrastructure"]
  node_prisma[("Database access<br/>[prisma.ts]")]
  node_auth_config["Token configuration<br/>[auth.ts]"]
  node_upload_middleware["Image upload handling"]
  node_response_format["API response formatting<br/>[api-response.ts]"]
end

node_visitor(("Community visitor"))

node_visitor -->|"registers through"| node_register_page
node_register_page -->|"submits account data"| node_api_client
node_api_client -.->|"sends API requests"| node_api_server
node_api_server -->|"mounts at auth path"| node_auth_routes
node_api_server -->|"mounts at posts path"| node_posts_routes
node_api_server -->|"mounts at users path"| node_users_routes
node_auth_routes -->|"dispatches handlers"| node_auth_controller
node_posts_routes -->|"dispatches handlers"| node_posts_controller
node_users_routes -->|"dispatches handlers"| node_users_controller
node_auth_controller -->|"calls auth operations"| node_auth_service
node_posts_controller -->|"calls post operations"| node_posts_service
node_users_controller -->|"calls profile operations"| node_users_service
node_auth_service -->|"reads and writes sessions"| node_prisma
node_auth_service -->|"uses token helpers"| node_auth_config
node_auth_controller -->|"sets cookie options"| node_auth_config
node_posts_routes -->|"runs upload middleware"| node_upload_middleware
node_auth_controller -->|"formats API responses"| node_response_format
node_posts_controller -->|"formats API responses"| node_response_format
node_users_controller -->|"formats API responses"| node_response_format
node_posts_service -->|"uses database access"| node_prisma
node_users_service -->|"uses database access"| node_prisma

click node_register_page "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/register/page.tsx"
click node_feed_page "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/feed/page.tsx"
click node_post_page "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/post/%5BpostId%5D/page.tsx"
click node_profile_page "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/u/%5Busername%5D/page.tsx"
click node_submit_page "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/submit/page.tsx"
click node_auth_context "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/context/auth-context.tsx"
click node_api_client "https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/lib/api.ts"
click node_api_server "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/app.ts"
click node_auth_routes "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.routes.ts"
click node_posts_routes "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.routes.ts"
click node_users_routes "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/users/users.routes.ts"
click node_auth_controller "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.controller.ts"
click node_auth_service "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.service.ts"
click node_posts_controller "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.controller.ts"
click node_posts_service "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.service.ts"
click node_users_controller "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/users/users.controller.ts"
click node_users_service "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/users/users.service.ts"
click node_prisma "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/config/prisma.ts"
click node_auth_config "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/config/auth.ts"
click node_upload_middleware "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/middlewares/upload.middleware.ts"
click node_response_format "https://github.com/krehantgajjar10/talkora/blob/main/backend/src/utils/api-response.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_register_page,node_feed_page,node_post_page,node_profile_page,node_submit_page,node_auth_context,node_api_client toneBlue
class node_api_server,node_auth_routes,node_posts_routes,node_users_routes toneAmber
class node_auth_controller,node_auth_service,node_posts_controller,node_posts_service,node_users_controller,node_users_service toneMint
class node_prisma,node_auth_config,node_upload_middleware,node_response_format toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Registration page](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/register/page.tsx): `frontend/src/app/register/page.tsx`
- [Community feed](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/feed/page.tsx): `frontend/src/app/feed/page.tsx`
- [Post detail](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/post/%5BpostId%5D/page.tsx): `frontend/src/app/post/[postId]/page.tsx`
- [User profile](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/u/%5Busername%5D/page.tsx): `frontend/src/app/u/[username]/page.tsx`
- [Post submission](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/app/submit/page.tsx): `frontend/src/app/submit/page.tsx`
- [Session context](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/context/auth-context.tsx): `frontend/src/context/auth-context.tsx`
- [HTTP API client](https://github.com/krehantgajjar10/talkora/blob/main/frontend/src/lib/api.ts): `frontend/src/lib/api.ts`

### API routing

- [Express application](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Authentication routes](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.routes.ts): `backend/src/modules/auth/auth.routes.ts`
- [Post routes](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.routes.ts): `backend/src/modules/posts/posts.routes.ts`
- [User routes](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/users/users.routes.ts): `backend/src/modules/users/users.routes.ts`

### Domain services

- [Authentication controller](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.controller.ts): `backend/src/modules/auth/auth.controller.ts`
- [Authentication service](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/auth/auth.service.ts): `backend/src/modules/auth/auth.service.ts`
- [Post controller](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.controller.ts): `backend/src/modules/posts/posts.controller.ts`
- [Post service](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/posts/posts.service.ts): `backend/src/modules/posts/posts.service.ts`
- [Profile controller](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/users/users.controller.ts): `backend/src/modules/users/users.controller.ts`
- [Profile service](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/modules/users/users.service.ts): `backend/src/modules/users/users.service.ts`

### Shared infrastructure

- [Database access](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/config/prisma.ts): `backend/src/config/prisma.ts`
- [Token configuration](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/config/auth.ts): `backend/src/config/auth.ts`
- [Image upload handling](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/middlewares/upload.middleware.ts): `backend/src/middlewares/upload.middleware.ts`
- [API response formatting](https://github.com/krehantgajjar10/talkora/blob/main/backend/src/utils/api-response.ts): `backend/src/utils/api-response.ts`

### Other components

- **Community visitor**

## Connections

- Community visitor → Registration page: registers through (evidence: `frontend/src/app/register/page.tsx`)
- Registration page → HTTP API client: submits account data (evidence: `frontend/src/app/register/page.tsx`)
- HTTP API client → Express application: sends API requests
- Express application → Authentication routes: mounts at auth path (evidence: `backend/src/app.ts`)
- Express application → Post routes: mounts at posts path (evidence: `backend/src/app.ts`)
- Express application → User routes: mounts at users path (evidence: `backend/src/app.ts`)
- Authentication routes → Authentication controller: dispatches handlers (evidence: `backend/src/modules/auth/auth.routes.ts`)
- Post routes → Post controller: dispatches handlers (evidence: `backend/src/modules/posts/posts.routes.ts`)
- User routes → Profile controller: dispatches handlers (evidence: `backend/src/modules/users/users.routes.ts`)
- Authentication controller → Authentication service: calls auth operations (evidence: `backend/src/modules/auth/auth.controller.ts`)
- Post controller → Post service: calls post operations (evidence: `backend/src/modules/posts/posts.controller.ts`)
- Profile controller → Profile service: calls profile operations (evidence: `backend/src/modules/users/users.controller.ts`)
- Authentication service → Database access: reads and writes sessions (evidence: `backend/src/modules/auth/auth.service.ts`)
- Authentication service → Token configuration: uses token helpers (evidence: `backend/src/modules/auth/auth.service.ts`)
- Authentication controller → Token configuration: sets cookie options (evidence: `backend/src/modules/auth/auth.controller.ts`)
- Post routes → Image upload handling: runs upload middleware (evidence: `backend/src/modules/posts/posts.routes.ts`)
- Authentication controller → API response formatting: formats API responses (evidence: `backend/src/modules/auth/auth.controller.ts`)
- Post controller → API response formatting: formats API responses (evidence: `backend/src/modules/posts/posts.controller.ts`)
- Profile controller → API response formatting: formats API responses (evidence: `backend/src/modules/users/users.controller.ts`)
- Post service → Database access: uses database access
- Profile service → Database access: uses database access
