# aishwaryam990/infynux-task2-fullstack-auth architecture

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

- Interactive diagram: https://gitdiagram.com/aishwaryam990/infynux-task2-fullstack-auth
- Repository: https://github.com/aishwaryam990/infynux-task2-fullstack-auth

## Overview

This is a full-stack company member-management and private employee social platform. Company administrators register and authenticate, provision employees with temporary credentials, and manage company information; employees authenticate, change an initial password, then access their profile and company-scoped feed to post and engage. React portals call a NestJS API, whose controllers delegate domain operations to services and Prisma-backed persistence. The README documents the product capabilities; some frontend-to-API wiring and unsampled modules are not shown in excerpts, so those links are identified as documented or unverified rather than inferred from names.

Main entry points: [`backend/src/prisma/prisma.service.ts`](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/prisma/prisma.service.ts) (Prisma client), [`frontend/src/components/CompanyPortal.jsx`](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/components/CompanyPortal.jsx) (Company portal), [`frontend/src/App.jsx`](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/App.jsx) (Personal portal), [`frontend/src/components/PostsSection.jsx`](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/components/PostsSection.jsx) (Posts interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web portals"]
  node_app["Personal portal<br/>[App.jsx]"]
  node_company_portal["Company portal<br/>[CompanyPortal.jsx]"]
  node_posts_ui["Posts interface<br/>[PostsSection.jsx]"]
end

subgraph group_identity["Identity and profiles"]
  node_user_auth_api["User auth routes<br/>[auth.controller.ts]"]
  node_user_auth["User authentication<br/>[auth.service.ts]"]
  node_user_profile_api["User profile routes"]
  node_user_profile["User profiles<br/>[users.service.ts]"]
end

subgraph group_company["Company and employees"]
  node_company_auth_api["Company auth routes"]
  node_company_auth["Company authentication"]
  node_company_api["Company dashboard"]
  node_company_service["Company operations<br/>[company.service.ts]"]
  node_employee_api["Employee routes"]
  node_employee_auth["Employee authentication"]
  node_employee_management["Employee management"]
end

subgraph group_social["Feed and engagement"]
  node_posts_api["Post routes"]
  node_posts_service["Feed and posts<br/>[posts.service.ts]"]
  node_admin_posts["Admin post routes"]
  node_engagement_api["Engagement routes"]
  node_engagement["Likes and comments"]
end

subgraph group_persistence["Persistence"]
  node_prisma["Prisma client<br/>[prisma.service.ts]"]
  node_database[("PostgreSQL")]
end

node_visitor(("Company or employee"))

node_visitor -->|"uses"| node_app
node_app -->|"renders"| node_company_portal
node_company_portal -->|"uses"| node_posts_ui
node_app -.->|"calls auth API"| node_user_auth_api
node_app -.->|"calls profile API"| node_user_profile_api
node_company_portal -.->|"calls company API"| node_company_auth_api
node_company_portal -.->|"calls management API"| node_company_api
node_company_portal -.->|"calls employee API"| node_employee_api
node_posts_ui -.->|"calls feed API"| node_posts_api
node_posts_ui -.->|"calls engagement API"| node_engagement_api
node_user_auth_api -->|"delegates to"| node_user_auth
node_user_auth -->|"reads and writes"| node_prisma
node_user_profile_api -->|"delegates to"| node_user_profile
node_user_profile -->|"reads and writes"| node_prisma
node_company_auth_api -->|"delegates to"| node_company_auth
node_company_auth -->|"reads and writes"| node_prisma
node_company_api -->|"delegates to"| node_company_service
node_company_api -->|"delegates to"| node_employee_management
node_company_service -->|"reads data"| node_prisma
node_employee_api -->|"delegates to"| node_employee_auth
node_employee_api -->|"delegates to"| node_employee_management
node_employee_auth -->|"reads and writes"| node_prisma
node_employee_management -->|"reads and writes"| node_prisma
node_posts_api -->|"delegates to"| node_posts_service
node_posts_service -->|"reads and writes"| node_prisma
node_admin_posts -->|"delegates to"| node_posts_service
node_engagement_api -->|"delegates to"| node_engagement
node_engagement -->|"reads and writes"| node_prisma
node_prisma -.->|"persists data"| node_database

click node_app "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/App.jsx"
click node_company_portal "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/components/CompanyPortal.jsx"
click node_posts_ui "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/components/PostsSection.jsx"
click node_user_auth_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/auth/auth.controller.ts"
click node_user_auth "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/auth/auth.service.ts"
click node_user_profile_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/users/users.controller.ts"
click node_user_profile "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/users/users.service.ts"
click node_company_auth_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company-auth.controller.ts"
click node_company_auth "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company-auth.service.ts"
click node_company_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company.controller.ts"
click node_company_service "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company.service.ts"
click node_employee_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/employees/employee.controller.ts"
click node_employee_auth "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/employees/employee-auth.service.ts"
click node_employee_management "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/employees/employee-management.service.ts"
click node_posts_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/posts.controller.ts"
click node_posts_service "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/posts.service.ts"
click node_admin_posts "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/admin-posts.controller.ts"
click node_engagement_api "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/engagement/engagement.controller.ts"
click node_engagement "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/engagement/engagement.service.ts"
click node_prisma "https://github.com/aishwaryam990/infynux-task2-fullstack-auth/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_app,node_company_portal,node_posts_ui toneBlue
class node_user_auth_api,node_user_auth,node_user_profile_api,node_user_profile toneAmber
class node_company_auth_api,node_company_auth,node_company_api,node_company_service,node_employee_api,node_employee_auth,node_employee_management toneMint
class node_posts_api,node_posts_service,node_admin_posts,node_engagement_api,node_engagement toneRose
class node_prisma,node_database,node_visitor toneIndigo
```

## Components

### Web portals

- [Personal portal](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Company portal](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/components/CompanyPortal.jsx): `frontend/src/components/CompanyPortal.jsx`
- [Posts interface](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/frontend/src/components/PostsSection.jsx): `frontend/src/components/PostsSection.jsx`

### Identity and profiles

- [User auth routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/auth/auth.controller.ts): `backend/src/auth/auth.controller.ts`
- [User authentication](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/auth/auth.service.ts): `backend/src/auth/auth.service.ts`
- [User profile routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/users/users.controller.ts): `backend/src/users/users.controller.ts`
- [User profiles](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/users/users.service.ts): `backend/src/users/users.service.ts`

### Company and employees

- [Company auth routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company-auth.controller.ts): `backend/src/companies/company-auth.controller.ts`
- [Company authentication](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company-auth.service.ts): `backend/src/companies/company-auth.service.ts`
- [Company dashboard](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company.controller.ts): `backend/src/companies/company.controller.ts`
- [Company operations](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/companies/company.service.ts): `backend/src/companies/company.service.ts`
- [Employee routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/employees/employee.controller.ts): `backend/src/employees/employee.controller.ts`
- [Employee authentication](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/employees/employee-auth.service.ts): `backend/src/employees/employee-auth.service.ts`
- [Employee management](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/employees/employee-management.service.ts): `backend/src/employees/employee-management.service.ts`

### Feed and engagement

- [Post routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/posts.controller.ts): `backend/src/posts/posts.controller.ts`
- [Feed and posts](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/posts.service.ts): `backend/src/posts/posts.service.ts`
- [Admin post routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/admin-posts.controller.ts): `backend/src/posts/admin-posts.controller.ts`
- [Engagement routes](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/engagement/engagement.controller.ts): `backend/src/posts/engagement/engagement.controller.ts`
- [Likes and comments](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/posts/engagement/engagement.service.ts): `backend/src/posts/engagement/engagement.service.ts`

### Persistence

- [Prisma client](https://github.com/aishwaryam990/infynux-task2-fullstack-auth/blob/main/backend/src/prisma/prisma.service.ts): `backend/src/prisma/prisma.service.ts`
- **PostgreSQL**

### Other components

- **Company or employee**

## Connections

- Company or employee → Personal portal: uses (evidence: `README.md`)
- Personal portal → Company portal: renders (evidence: `frontend/src/App.jsx`)
- Company portal → Posts interface: uses (evidence: `frontend/src/components/CompanyPortal.jsx`)
- Personal portal → User auth routes: calls auth API
- Personal portal → User profile routes: calls profile API
- Company portal → Company auth routes: calls company API
- Company portal → Company dashboard: calls management API
- Company portal → Employee routes: calls employee API
- Posts interface → Post routes: calls feed API
- Posts interface → Engagement routes: calls engagement API
- User auth routes → User authentication: delegates to (evidence: `backend/src/auth/auth.controller.ts`)
- User authentication → Prisma client: reads and writes (evidence: `backend/src/auth/auth.service.ts`)
- User profile routes → User profiles: delegates to (evidence: `backend/src/users/users.controller.ts`)
- User profiles → Prisma client: reads and writes (evidence: `backend/src/users/users.service.ts`)
- Company auth routes → Company authentication: delegates to (evidence: `backend/src/companies/company-auth.controller.ts`)
- Company authentication → Prisma client: reads and writes (evidence: `backend/src/companies/company-auth.service.ts`)
- Company dashboard → Company operations: delegates to (evidence: `backend/src/companies/company.controller.ts`)
- Company dashboard → Employee management: delegates to (evidence: `backend/src/companies/company.controller.ts`)
- Company operations → Prisma client: reads data (evidence: `backend/src/companies/company.service.ts`)
- Employee routes → Employee authentication: delegates to (evidence: `backend/src/employees/employee.controller.ts`)
- Employee routes → Employee management: delegates to (evidence: `backend/src/employees/employee.controller.ts`)
- Employee authentication → Prisma client: reads and writes (evidence: `backend/src/employees/employee-auth.service.ts`)
- Employee management → Prisma client: reads and writes (evidence: `backend/src/employees/employee-management.service.ts`)
- Post routes → Feed and posts: delegates to (evidence: `backend/src/posts/posts.controller.ts`)
- Feed and posts → Prisma client: reads and writes (evidence: `backend/src/posts/posts.service.ts`)
- Admin post routes → Feed and posts: delegates to (evidence: `backend/src/posts/admin-posts.controller.ts`)
- Engagement routes → Likes and comments: delegates to (evidence: `backend/src/posts/engagement/engagement.controller.ts`)
- Likes and comments → Prisma client: reads and writes (evidence: `backend/src/posts/engagement/engagement.service.ts`)
- Prisma client → PostgreSQL: persists data
