# maxethan2/nextjs-appwrite architecture

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

- Interactive diagram: https://gitdiagram.com/maxethan2/nextjs-appwrite
- Repository: https://github.com/maxethan2/nextjs-appwrite

## Overview

This is a Next.js user-account app with profile management, personal to-do lists, email verification, and a camera-based sign-language feature. The primary workflow is account creation or login, then viewing a profile and using its account and to-do features; the camera is a separate capability. The graph includes sampled API-to-Appwrite calls and documented UI/module references. Some route and camera internals were not excerpted, so uncertain links are omitted or marked unverified.

Main entry points: [`src/lib/server/appwrite.ts`](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/lib/server/appwrite.ts) (Appwrite clients), [`src/app/profile/page.tsx`](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/page.tsx) (Profile page), [`src/app/profile/todo/page.tsx`](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/todo/page.tsx) (To-do page), [`src/app/api/users/verifyEmail/route.ts`](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/verifyEmail/route.ts) (Email verification)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["User experience"]
  node_landing["Landing page<br/>[page.tsx]"]
  node_navigation["Navigation<br/>[MyNavBar.tsx]"]
  node_theme["Theme switcher<br/>[ThemeSwitcher.tsx]"]
end

subgraph group_identity["Identity and profile"]
  node_signup["Sign up page<br/>[page.tsx]"]
  node_login["Login page<br/>[page.tsx]"]
  node_signupapi["Signup endpoint<br/>[route.ts]"]
  node_loginapi["Login endpoint<br/>[route.ts]"]
  node_sessionapi["Session endpoints<br/>[route.ts]"]
  node_signoutapi["Signout endpoint<br/>[route.ts]"]
  node_profile["Profile page<br/>[page.tsx]"]
  node_profileedit["Profile editor<br/>[EditProfile.tsx]"]
  node_profileactions["Profile actions<br/>[profile.ts]"]
  node_photoapi["Photo endpoint<br/>[route.ts]"]
  node_verifyapi["Email verification<br/>[route.ts]"]
  node_verifyui["Verification page<br/>[page.tsx]"]
end

subgraph group_tasks["Personal tasks"]
  node_todo["To-do page<br/>[page.tsx]"]
  node_todoui["To-do item UI<br/>[Todo.tsx]"]
  node_todoapi["To-do endpoints<br/>[route.ts]"]
  node_todocreate["Create to-do endpoint<br/>[route.ts]"]
end

subgraph group_camera["Sign recognition"]
  node_camera["Camera page<br/>[page.tsx]"]
  node_cameraaction["Camera actions<br/>[Camera.ts]"]
  node_cnn["ASL prediction model"]
end

subgraph group_platform["Server platform"]
  node_state["Client state<br/>[state.ts]"]
  node_appwriteclient["Appwrite clients<br/>[appwrite.ts]"]
end

node_visitor(("Visitor"))
node_appwrite[("Appwrite")]

node_visitor -.->|"visits"| node_landing
node_visitor -.->|"opens"| node_signup
node_visitor -.->|"opens"| node_login
node_signupapi -->|"creates account"| node_appwriteclient
node_loginapi -->|"starts session"| node_appwriteclient
node_sessionapi -->|"gets account"| node_appwriteclient
node_signoutapi -->|"deletes session"| node_appwriteclient
node_photoapi -->|"gets account"| node_appwriteclient
node_verifyapi -->|"verifies email"| node_appwriteclient
node_appwriteclient -->|"configures access"| node_appwrite
node_profile -->|"renders"| node_profileedit
node_profileedit -->|"uses actions"| node_profileactions
node_profileactions -->|"updates account"| node_appwriteclient
node_profile -->|"reads and updates"| node_state
node_todo -->|"renders"| node_todoui
node_todo -->|"uses state"| node_state
node_todo -.->|"loads tasks"| node_todoapi
node_todo -.->|"creates tasks"| node_todocreate
node_verifyui -.->|"submits verification"| node_verifyapi
node_profile -->|"fetches user"| node_sessionapi
node_profile -->|"fetches photo"| node_photoapi
node_profile -->|"requests email"| node_verifyapi
node_camera -->|"uses actions"| node_cameraaction
node_cameraaction -.->|"predicts signs"| node_cnn
node_navigation -->|"renders"| node_theme
node_landing -.->|"presents content"| node_visitor

click node_landing "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/page.tsx"
click node_navigation "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/components/MyNavBar.tsx"
click node_theme "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/components/ThemeSwitcher.tsx"
click node_signup "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/signup/page.tsx"
click node_login "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/login/page.tsx"
click node_signupapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/signup/route.ts"
click node_loginapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/login/route.ts"
click node_sessionapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/loggedInUser/route.ts"
click node_signoutapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/signout/route.ts"
click node_profile "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/page.tsx"
click node_profileedit "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/components/EditProfile.tsx"
click node_profileactions "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/actions/profile.ts"
click node_photoapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/profilePhoto/route.ts"
click node_verifyapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/verifyEmail/route.ts"
click node_verifyui "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/verifyEmail/page.tsx"
click node_todo "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/todo/page.tsx"
click node_todoui "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/todo/components/Todo.tsx"
click node_todoapi "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/todoList/route.ts"
click node_todocreate "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/todoList/create/route.ts"
click node_camera "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/camera/page.tsx"
click node_cameraaction "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/actions/Camera.ts"
click node_cnn "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/actions/CNN_MODEL/ASL_CNN_Single_Prediction.py"
click node_state "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/lib/server/state-management/state.ts"
click node_appwriteclient "https://github.com/maxethan2/nextjs-appwrite/blob/master/src/lib/server/appwrite.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_landing,node_navigation,node_theme toneBlue
class node_signup,node_login,node_signupapi,node_loginapi,node_sessionapi,node_signoutapi,node_profile,node_profileedit,node_profileactions,node_photoapi,node_verifyapi,node_verifyui,node_appwrite toneAmber
class node_todo,node_todoui,node_todoapi,node_todocreate toneMint
class node_camera,node_cameraaction,node_cnn toneRose
class node_state,node_appwriteclient,node_visitor toneIndigo
```

## Components

### User experience

- [Landing page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/page.tsx): `src/app/page.tsx`
- [Navigation](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/components/MyNavBar.tsx): `src/app/components/MyNavBar.tsx`
- [Theme switcher](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/components/ThemeSwitcher.tsx): `src/app/components/ThemeSwitcher.tsx`

### Identity and profile

- [Sign up page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/signup/page.tsx): `src/app/signup/page.tsx`
- [Login page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/login/page.tsx): `src/app/login/page.tsx`
- [Signup endpoint](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/signup/route.ts): `src/app/api/users/signup/route.ts`
- [Login endpoint](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/login/route.ts): `src/app/api/users/login/route.ts`
- [Session endpoints](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/loggedInUser/route.ts): `src/app/api/users/loggedInUser/route.ts`
- [Signout endpoint](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/signout/route.ts): `src/app/api/users/signout/route.ts`
- [Profile page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/page.tsx): `src/app/profile/page.tsx`
- [Profile editor](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/components/EditProfile.tsx): `src/app/profile/components/EditProfile.tsx`
- [Profile actions](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/actions/profile.ts): `src/app/actions/profile.ts`
- [Photo endpoint](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/profilePhoto/route.ts): `src/app/api/users/profilePhoto/route.ts`
- [Email verification](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/verifyEmail/route.ts): `src/app/api/users/verifyEmail/route.ts`
- [Verification page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/verifyEmail/page.tsx): `src/app/profile/verifyEmail/page.tsx`

### Personal tasks

- [To-do page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/todo/page.tsx): `src/app/profile/todo/page.tsx`
- [To-do item UI](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/profile/todo/components/Todo.tsx): `src/app/profile/todo/components/Todo.tsx`
- [To-do endpoints](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/todoList/route.ts): `src/app/api/users/todoList/route.ts`
- [Create to-do endpoint](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/api/users/todoList/create/route.ts): `src/app/api/users/todoList/create/route.ts`

### Sign recognition

- [Camera page](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/camera/page.tsx): `src/app/camera/page.tsx`
- [Camera actions](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/actions/Camera.ts): `src/app/actions/Camera.ts`
- [ASL prediction model](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/app/actions/CNN_MODEL/ASL_CNN_Single_Prediction.py): `src/app/actions/CNN_MODEL/ASL_CNN_Single_Prediction.py`

### Server platform

- [Client state](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/lib/server/state-management/state.ts): `src/lib/server/state-management/state.ts`
- [Appwrite clients](https://github.com/maxethan2/nextjs-appwrite/blob/master/src/lib/server/appwrite.ts): `src/lib/server/appwrite.ts`

### Other components

- **Visitor**
- **Appwrite**

## Connections

- Visitor → Landing page: visits
- Visitor → Sign up page: opens
- Visitor → Login page: opens
- Signup endpoint → Appwrite clients: creates account (evidence: `src/app/api/users/signup/route.ts`)
- Login endpoint → Appwrite clients: starts session (evidence: `src/app/api/users/login/route.ts`)
- Session endpoints → Appwrite clients: gets account (evidence: `src/app/api/users/loggedInUser/route.ts`)
- Signout endpoint → Appwrite clients: deletes session (evidence: `src/app/api/users/signout/route.ts`)
- Photo endpoint → Appwrite clients: gets account (evidence: `src/app/api/users/profilePhoto/route.ts`)
- Email verification → Appwrite clients: verifies email (evidence: `src/app/api/users/verifyEmail/route.ts`)
- Appwrite clients → Appwrite: configures access (evidence: `src/lib/server/appwrite.ts`)
- Profile page → Profile editor: renders (evidence: `src/app/profile/page.tsx`)
- Profile editor → Profile actions: uses actions (evidence: `src/app/profile/components/EditProfile.tsx`)
- Profile actions → Appwrite clients: updates account (evidence: `src/app/actions/profile.ts`)
- Profile page → Client state: reads and updates (evidence: `src/app/profile/page.tsx`)
- To-do page → To-do item UI: renders (evidence: `src/app/profile/todo/page.tsx`)
- To-do page → Client state: uses state (evidence: `src/app/profile/todo/page.tsx`)
- To-do page → To-do endpoints: loads tasks
- To-do page → Create to-do endpoint: creates tasks
- Verification page → Email verification: submits verification
- Profile page → Session endpoints: fetches user (evidence: `src/app/profile/page.tsx`)
- Profile page → Photo endpoint: fetches photo (evidence: `src/app/profile/page.tsx`)
- Profile page → Email verification: requests email (evidence: `src/app/profile/page.tsx`)
- Camera page → Camera actions: uses actions (evidence: `src/app/camera/page.tsx`)
- Camera actions → ASL prediction model: predicts signs
- Navigation → Theme switcher: renders (evidence: `src/app/components/MyNavBar.tsx`)
- Landing page → Visitor: presents content
