# akash-sharma8/anonymous_feedback architecture

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

- Interactive diagram: https://gitdiagram.com/akash-sharma8/anonymous_feedback
- Repository: https://github.com/akash-sharma8/anonymous_feedback

## Overview

Anonymous Feedback is a Next.js app for account-based, anonymous feedback. The main journey is account creation and email verification, then sharing a public profile where visitors submit messages; signed-in users manage those messages and acceptance settings in a dashboard. The graph also includes sign-in, username checks, and AI prompt suggestions. README feature statements support the product flows; the sampled API excerpts confirm username checking and authenticated message retrieval. Other route internals were not sampled, so their detailed calls are not inferred.

Main entry points: [`src/app/(app)/dashboard/page.tsx`](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(app)/dashboard/page.tsx) (Message Dashboard), [`src/app/api/get-messages/route.ts`](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/get-messages/route.ts) (Retrieve Messages API), [`src/app/(auth)/sign-up/page.tsx`](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/sign-up/page.tsx) (Sign Up), [`src/app/api/sign-up/route.ts`](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/sign-up/route.ts) (Sign Up API)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_identity["Identity"]
  node_sign_up["Sign Up<br/>[page.tsx]"]
  node_sign_in["Sign In<br/>[page.tsx]"]
  node_verify_page["Verify Account<br/>[page.tsx]"]
  node_signup_api["Sign Up API<br/>[route.ts]"]
  node_verify_api["Verify Code API<br/>[route.ts]"]
  node_auth_options["Credentials Auth<br/>[options.ts]"]
  node_auth_route["Auth Endpoint<br/>[route.ts]"]
  node_username_check["Username Check<br/>[route.ts]"]
end

subgraph group_feedback["Anonymous Feedback"]
  node_profile["Public Profile<br/>[page.tsx]"]
  node_send_message["Submit Message API<br/>[route.ts]"]
  node_suggest_api["Prompt Suggestions API<br/>[route.ts]"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard_page["Message Dashboard<br/>[page.tsx]"]
  node_get_messages["Retrieve Messages API<br/>[route.ts]"]
  node_accept_api["Acceptance Settings API<br/>[route.ts]"]
  node_delete_api["Delete Message API<br/>[route.ts]"]
end

subgraph group_services["Services and Data"]
  node_email_helper["Verification Mailer"]
  node_resend["Resend Email"]
  node_groq["Groq"]
  node_user_model["User and Messages<br/>[User.ts]"]
  node_database[("MongoDB")]
  node_db_connect["Database Connector<br/>[dbConnect.ts]"]
end

node_visitor(("Visitor"))
node_member(("Account User"))

node_member -->|"creates account"| node_sign_up
node_sign_up -->|"submits registration"| node_signup_api
node_signup_api -->|"starts verification"| node_verify_page
node_verify_page -->|"submits code"| node_verify_api
node_signup_api -.->|"requests email"| node_email_helper
node_email_helper -->|"sends email"| node_resend
node_member -->|"signs in"| node_sign_in
node_sign_in -->|"authenticates"| node_auth_route
node_auth_route -.->|"uses credentials"| node_auth_options
node_sign_up -.->|"checks availability"| node_username_check
node_visitor -->|"opens profile"| node_profile
node_profile -->|"submits feedback"| node_send_message
node_member -->|"manages feedback"| node_dashboard_page
node_dashboard_page -->|"loads messages"| node_get_messages
node_dashboard_page -->|"changes acceptance"| node_accept_api
node_dashboard_page -.->|"deletes message"| node_delete_api
node_dashboard_page -->|"requests prompts"| node_suggest_api
node_suggest_api -->|"generates prompts"| node_groq
node_username_check -->|"connects database"| node_db_connect
node_username_check -->|"checks user"| node_user_model
node_get_messages -->|"connects database"| node_db_connect
node_get_messages -->|"queries messages"| node_user_model
node_get_messages -->|"checks session"| node_auth_options
node_db_connect -.->|"connects"| node_database

click node_sign_up "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/sign-up/page.tsx"
click node_sign_in "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/sign-in/page.tsx"
click node_verify_page "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/verify/%5Busername%5D/page.tsx"
click node_signup_api "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/sign-up/route.ts"
click node_verify_api "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/verify-code/route.ts"
click node_auth_options "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/auth/%5B...nextauth%5D/options.ts"
click node_auth_route "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts"
click node_username_check "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/check-username-unique/route.ts"
click node_email_helper "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/helpers/sendVerificationEmail.ts"
click node_profile "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/u/%5Busername%5D/page.tsx"
click node_send_message "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/send-message/route.ts"
click node_dashboard_page "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(app)/dashboard/page.tsx"
click node_get_messages "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/get-messages/route.ts"
click node_accept_api "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/accept-messages/route.ts"
click node_delete_api "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/delete-message/%5Bmessageid%5D/route.ts"
click node_suggest_api "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/suggest-messages/route.ts"
click node_user_model "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/model/User.ts"
click node_db_connect "https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/lib/dbConnect.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_sign_up,node_sign_in,node_verify_page,node_signup_api,node_verify_api,node_auth_options,node_auth_route,node_username_check,node_member toneBlue
class node_profile,node_send_message,node_suggest_api toneAmber
class node_dashboard_page,node_get_messages,node_accept_api,node_delete_api toneMint
class node_email_helper,node_resend,node_groq,node_user_model,node_database,node_db_connect toneRose
class node_visitor toneIndigo
```

## Components

### Identity

- [Sign Up](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/sign-up/page.tsx): `src/app/(auth)/sign-up/page.tsx`
- [Sign In](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/sign-in/page.tsx): `src/app/(auth)/sign-in/page.tsx`
- [Verify Account](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(auth)/verify/%5Busername%5D/page.tsx): `src/app/(auth)/verify/[username]/page.tsx`
- [Sign Up API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/sign-up/route.ts): `src/app/api/sign-up/route.ts`
- [Verify Code API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/verify-code/route.ts): `src/app/api/verify-code/route.ts`
- [Credentials Auth](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/auth/%5B...nextauth%5D/options.ts): `src/app/api/auth/[...nextauth]/options.ts`
- [Auth Endpoint](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/auth/%5B...nextauth%5D/route.ts): `src/app/api/auth/[...nextauth]/route.ts`
- [Username Check](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/check-username-unique/route.ts): `src/app/api/check-username-unique/route.ts`

### Anonymous Feedback

- [Public Profile](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/u/%5Busername%5D/page.tsx): `src/app/u/[username]/page.tsx`
- [Submit Message API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/send-message/route.ts): `src/app/api/send-message/route.ts`
- [Prompt Suggestions API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/suggest-messages/route.ts): `src/app/api/suggest-messages/route.ts`

### Dashboard

- [Message Dashboard](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/(app)/dashboard/page.tsx): `src/app/(app)/dashboard/page.tsx`
- [Retrieve Messages API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/get-messages/route.ts): `src/app/api/get-messages/route.ts`
- [Acceptance Settings API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/accept-messages/route.ts): `src/app/api/accept-messages/route.ts`
- [Delete Message API](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/app/api/delete-message/%5Bmessageid%5D/route.ts): `src/app/api/delete-message/[messageid]/route.ts`

### Services and Data

- [Verification Mailer](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/helpers/sendVerificationEmail.ts): `src/helpers/sendVerificationEmail.ts`
- **Resend Email**
- **Groq**
- [User and Messages](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/model/User.ts): `src/model/User.ts`
- **MongoDB**
- [Database Connector](https://github.com/akash-sharma8/anonymous_feedback/blob/main/src/lib/dbConnect.ts): `src/lib/dbConnect.ts`

### Other components

- **Visitor**
- **Account User**

## Connections

- Account User → Sign Up: creates account
- Sign Up → Sign Up API: submits registration
- Sign Up API → Verify Account: starts verification
- Verify Account → Verify Code API: submits code
- Sign Up API → Verification Mailer: requests email
- Verification Mailer → Resend Email: sends email
- Account User → Sign In: signs in
- Sign In → Auth Endpoint: authenticates
- Auth Endpoint → Credentials Auth: uses credentials
- Sign Up → Username Check: checks availability
- Visitor → Public Profile: opens profile
- Public Profile → Submit Message API: submits feedback
- Account User → Message Dashboard: manages feedback
- Message Dashboard → Retrieve Messages API: loads messages
- Message Dashboard → Acceptance Settings API: changes acceptance
- Message Dashboard → Delete Message API: deletes message
- Message Dashboard → Prompt Suggestions API: requests prompts
- Prompt Suggestions API → Groq: generates prompts
- Username Check → Database Connector: connects database (evidence: `src/app/api/check-username-unique/route.ts`)
- Username Check → User and Messages: checks user (evidence: `src/app/api/check-username-unique/route.ts`)
- Retrieve Messages API → Database Connector: connects database (evidence: `src/app/api/get-messages/route.ts`)
- Retrieve Messages API → User and Messages: queries messages (evidence: `src/app/api/get-messages/route.ts`)
- Retrieve Messages API → Credentials Auth: checks session (evidence: `src/app/api/get-messages/route.ts`)
- Database Connector → MongoDB: connects
