# dev-dhanushkumar/oauth-2.0-repository architecture

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

- Interactive diagram: https://gitdiagram.com/dev-dhanushkumar/oauth-2.0-repository
- Repository: https://github.com/dev-dhanushkumar/oauth-2.0-repository

## Overview

Quick Auth is a React client backed by an Express authentication API. Users register or log in with email/password, may authenticate through Google OAuth, and can access protected profile data; password recovery uses an emailed reset link. The backend also manages JWT-backed sessions and persists user and reset-token data through Prisma. The source excerpts show key routing, login, OAuth, email, and persistence calls; some frontend-to-API links and unsampled route behavior are documented in the README rather than verified from their implementation.

Main entry points: [`quickAuth-nodejs/src/routes/auth.route.ts`](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/auth.route.ts) (Auth routes), [`quickAuth-reactjs/src/router/index.tsx`](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/router/index.tsx) (Page router), [`quickAuth-nodejs/src/controllers/auth.controller.ts`](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/controllers/auth.controller.ts) (Auth handlers), [`quickAuth-nodejs/src/routes/user.route.ts`](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/user.route.ts) (User routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["React client"]
  node_clientapp["React application<br/>[App.tsx]"]
  node_router["Page router<br/>[index.tsx]"]
  node_login["Login page<br/>[login.page.tsx]"]
  node_register["Registration page<br/>[register.page.tsx]"]
  node_recovery["Password recovery pages"]
  node_reset["Password reset page"]
  node_profile["Profile page<br/>[profile.page.tsx]"]
  node_home["Home page<br/>[home.page.tsx]"]
  node_store["Client auth state<br/>[index.ts]"]
  node_googleurl["Google URL builder<br/>[getGoogleUrl.ts]"]
  node_header["Navigation and logout<br/>[Header.tsx]"]
end

subgraph group_api["API and identity"]
  node_app["Express app<br/>[app.ts]"]
  node_authroutes["Auth routes<br/>[auth.route.ts]"]
  node_sessionroutes["Session routes<br/>[session.route.ts]"]
  node_userroutes["User routes<br/>[user.route.ts]"]
  node_authcontroller["Auth handlers<br/>[auth.controller.ts]"]
  node_usercontroller["Profile handler<br/>[user.controller.ts]"]
  node_validation["Request validation<br/>[validate.ts]"]
  node_userschema["User schemas<br/>[user.schema.ts]"]
  node_deserialize["JWT deserialization<br/>[deserializeUser.ts]"]
  node_requireuser["Protected access<br/>[requireUser.ts]"]
  node_sessionservice["Google OAuth exchange<br/>[session.service.ts]"]
end

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

subgraph group_integrations["External services"]
  node_emailrender["Reset email rendering<br/>[renderTemplate.ts]"]
  node_transporter["Email delivery<br/>[transporter.ts]"]
end

node_person(("User"))
node_smtp["SMTP service"]
node_google["Google OAuth"]

node_person -->|"uses"| node_clientapp
node_clientapp -->|"selects routes"| node_router
node_router -->|"routes to"| node_login
node_router -->|"routes to"| node_register
node_router -->|"routes to"| node_recovery
node_router -->|"routes to"| node_reset
node_router -->|"routes to"| node_profile
node_router -->|"routes to"| node_home
node_login -->|"updates loading"| node_store
node_header -->|"reads and updates"| node_store
node_login -->|"builds OAuth link"| node_googleurl
node_login -->|"posts credentials"| node_authroutes
node_header -->|"requests logout"| node_authroutes
node_register -.->|"submits registration"| node_authroutes
node_recovery -.->|"requests reset email"| node_authroutes
node_reset -.->|"submits new password"| node_authroutes
node_profile -.->|"requests profile"| node_userroutes
node_app -->|"mounts"| node_authroutes
node_app -->|"mounts"| node_sessionroutes
node_app -->|"mounts"| node_userroutes
node_authroutes -->|"validates input"| node_validation
node_validation -->|"applies schemas"| node_userschema
node_authroutes -->|"dispatches handlers"| node_authcontroller
node_authroutes -->|"checks session"| node_deserialize
node_authroutes -->|"guards logout"| node_requireuser
node_userroutes -->|"dispatches profile"| node_usercontroller
node_userroutes -->|"loads user"| node_deserialize
node_userroutes -->|"guards access"| node_requireuser
node_authcontroller -->|"reads and writes users"| node_prisma
node_deserialize -->|"loads user"| node_prisma
node_app -->|"connects database"| node_prisma
node_prisma -.->|"persists records"| node_database
node_authcontroller -->|"exchanges OAuth code"| node_sessionservice
node_sessionservice -->|"requests tokens and profile"| node_google
node_authcontroller -->|"renders reset message"| node_emailrender
node_authcontroller -->|"sends reset email"| node_transporter
node_transporter -.->|"delivers mail"| node_smtp

click node_app "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/app.ts"
click node_authroutes "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/auth.route.ts"
click node_sessionroutes "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/session.route.ts"
click node_userroutes "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/user.route.ts"
click node_authcontroller "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/controllers/auth.controller.ts"
click node_usercontroller "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/controllers/user.controller.ts"
click node_validation "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/middleware/validate.ts"
click node_userschema "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/schema/user.schema.ts"
click node_deserialize "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/middleware/deserializeUser.ts"
click node_requireuser "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/middleware/requireUser.ts"
click node_sessionservice "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/services/session.service.ts"
click node_prisma "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/utils/prisma.ts"
click node_database "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/prisma/schema.prisma"
click node_emailrender "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/email/renderTemplate.ts"
click node_transporter "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/email/transporter.ts"
click node_clientapp "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/App.tsx"
click node_router "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/router/index.tsx"
click node_login "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/login.page.tsx"
click node_register "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/register.page.tsx"
click node_recovery "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/forgotpassword.page.tsx"
click node_reset "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/resetpassword.page.tsx"
click node_profile "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/profile.page.tsx"
click node_home "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/home.page.tsx"
click node_store "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/store/index.ts"
click node_googleurl "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/utils/getGoogleUrl.ts"
click node_header "https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/components/Header.tsx"

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_clientapp,node_router,node_login,node_register,node_recovery,node_reset,node_profile,node_home,node_store,node_googleurl,node_header,node_person toneBlue
class node_app,node_authroutes,node_sessionroutes,node_userroutes,node_authcontroller,node_usercontroller,node_validation,node_userschema,node_deserialize,node_requireuser,node_sessionservice toneAmber
class node_prisma,node_database toneMint
class node_emailrender,node_transporter toneRose
class node_smtp,node_google toneIndigo
```

## Components

### React client

- [React application](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/App.tsx): `quickAuth-reactjs/src/App.tsx`
- [Page router](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/router/index.tsx): `quickAuth-reactjs/src/router/index.tsx`
- [Login page](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/login.page.tsx): `quickAuth-reactjs/src/pages/login.page.tsx`
- [Registration page](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/register.page.tsx): `quickAuth-reactjs/src/pages/register.page.tsx`
- [Password recovery pages](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/forgotpassword.page.tsx): `quickAuth-reactjs/src/pages/forgotpassword.page.tsx`
- [Password reset page](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/resetpassword.page.tsx): `quickAuth-reactjs/src/pages/resetpassword.page.tsx`
- [Profile page](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/profile.page.tsx): `quickAuth-reactjs/src/pages/profile.page.tsx`
- [Home page](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/pages/home.page.tsx): `quickAuth-reactjs/src/pages/home.page.tsx`
- [Client auth state](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/store/index.ts): `quickAuth-reactjs/src/store/index.ts`
- [Google URL builder](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/utils/getGoogleUrl.ts): `quickAuth-reactjs/src/utils/getGoogleUrl.ts`
- [Navigation and logout](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-reactjs/src/components/Header.tsx): `quickAuth-reactjs/src/components/Header.tsx`

### API and identity

- [Express app](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/app.ts): `quickAuth-nodejs/src/app.ts`
- [Auth routes](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/auth.route.ts): `quickAuth-nodejs/src/routes/auth.route.ts`
- [Session routes](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/session.route.ts): `quickAuth-nodejs/src/routes/session.route.ts`
- [User routes](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/routes/user.route.ts): `quickAuth-nodejs/src/routes/user.route.ts`
- [Auth handlers](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/controllers/auth.controller.ts): `quickAuth-nodejs/src/controllers/auth.controller.ts`
- [Profile handler](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/controllers/user.controller.ts): `quickAuth-nodejs/src/controllers/user.controller.ts`
- [Request validation](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/middleware/validate.ts): `quickAuth-nodejs/src/middleware/validate.ts`
- [User schemas](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/schema/user.schema.ts): `quickAuth-nodejs/src/schema/user.schema.ts`
- [JWT deserialization](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/middleware/deserializeUser.ts): `quickAuth-nodejs/src/middleware/deserializeUser.ts`
- [Protected access](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/middleware/requireUser.ts): `quickAuth-nodejs/src/middleware/requireUser.ts`
- [Google OAuth exchange](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/services/session.service.ts): `quickAuth-nodejs/src/services/session.service.ts`

### Persistence

- [Prisma client](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/utils/prisma.ts): `quickAuth-nodejs/src/utils/prisma.ts`
- [PostgreSQL](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/prisma/schema.prisma): `quickAuth-nodejs/prisma/schema.prisma`

### External services

- [Reset email rendering](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/email/renderTemplate.ts): `quickAuth-nodejs/src/email/renderTemplate.ts`
- [Email delivery](https://github.com/dev-dhanushkumar/oauth-2.0-repository/blob/main/quickAuth-nodejs/src/email/transporter.ts): `quickAuth-nodejs/src/email/transporter.ts`

### Other components

- **User**
- **SMTP service**
- **Google OAuth**

## Connections

- User → React application: uses (evidence: `README.md`)
- React application → Page router: selects routes (evidence: `quickAuth-reactjs/src/App.tsx`)
- Page router → Login page: routes to (evidence: `quickAuth-reactjs/src/router/index.tsx`)
- Page router → Registration page: routes to (evidence: `quickAuth-reactjs/src/router/index.tsx`)
- Page router → Password recovery pages: routes to (evidence: `quickAuth-reactjs/src/router/index.tsx`)
- Page router → Password reset page: routes to (evidence: `quickAuth-reactjs/src/router/index.tsx`)
- Page router → Profile page: routes to (evidence: `quickAuth-reactjs/src/router/index.tsx`)
- Page router → Home page: routes to (evidence: `quickAuth-reactjs/src/router/index.tsx`)
- Login page → Client auth state: updates loading (evidence: `quickAuth-reactjs/src/pages/login.page.tsx`)
- Navigation and logout → Client auth state: reads and updates (evidence: `quickAuth-reactjs/src/components/Header.tsx`)
- Login page → Google URL builder: builds OAuth link (evidence: `quickAuth-reactjs/src/pages/login.page.tsx`)
- Login page → Auth routes: posts credentials (evidence: `quickAuth-reactjs/src/pages/login.page.tsx`)
- Navigation and logout → Auth routes: requests logout (evidence: `quickAuth-reactjs/src/components/Header.tsx`)
- Registration page → Auth routes: submits registration (evidence: `README.md`)
- Password recovery pages → Auth routes: requests reset email (evidence: `README.md`)
- Password reset page → Auth routes: submits new password (evidence: `README.md`)
- Profile page → User routes: requests profile (evidence: `README.md`)
- Express app → Auth routes: mounts (evidence: `quickAuth-nodejs/src/app.ts`)
- Express app → Session routes: mounts (evidence: `quickAuth-nodejs/src/app.ts`)
- Express app → User routes: mounts (evidence: `quickAuth-nodejs/src/app.ts`)
- Auth routes → Request validation: validates input (evidence: `quickAuth-nodejs/src/routes/auth.route.ts`)
- Request validation → User schemas: applies schemas (evidence: `quickAuth-nodejs/src/routes/auth.route.ts`)
- Auth routes → Auth handlers: dispatches handlers (evidence: `quickAuth-nodejs/src/routes/auth.route.ts`)
- Auth routes → JWT deserialization: checks session (evidence: `quickAuth-nodejs/src/routes/auth.route.ts`)
- Auth routes → Protected access: guards logout (evidence: `quickAuth-nodejs/src/routes/auth.route.ts`)
- User routes → Profile handler: dispatches profile (evidence: `quickAuth-nodejs/src/routes/user.route.ts`)
- User routes → JWT deserialization: loads user (evidence: `quickAuth-nodejs/src/routes/user.route.ts`)
- User routes → Protected access: guards access (evidence: `quickAuth-nodejs/src/routes/user.route.ts`)
- Auth handlers → Prisma client: reads and writes users (evidence: `quickAuth-nodejs/src/controllers/auth.controller.ts`)
- JWT deserialization → Prisma client: loads user (evidence: `quickAuth-nodejs/src/middleware/deserializeUser.ts`)
- Express app → Prisma client: connects database (evidence: `quickAuth-nodejs/src/app.ts`)
- Prisma client → PostgreSQL: persists records (evidence: `README.md`)
- Auth handlers → Google OAuth exchange: exchanges OAuth code (evidence: `quickAuth-nodejs/src/controllers/auth.controller.ts`)
- Google OAuth exchange → Google OAuth: requests tokens and profile (evidence: `quickAuth-nodejs/src/services/session.service.ts`)
- Auth handlers → Reset email rendering: renders reset message (evidence: `quickAuth-nodejs/src/controllers/auth.controller.ts`)
- Auth handlers → Email delivery: sends reset email (evidence: `quickAuth-nodejs/src/controllers/auth.controller.ts`)
- Email delivery → SMTP service: delivers mail (evidence: `README.md`)
