# bibi0019/quenti architecture

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

- Interactive diagram: https://gitdiagram.com/bibi0019/quenti
- Repository: https://github.com/bibi0019/quenti

## Overview

Quenti is an open-source Quizlet alternative: users create and organize study sets, then study them through flashcards and other practice modes. The product also supports collaborative editing, classes and assignments, organizations, profiles, image search, and subscriptions. The graph combines that documented product scope with relationships visible in the sampled files and source index. Many feature implementations were not sampled, so their internal connections are omitted rather than inferred.

Main entry points: [`apps/next/src/modules/main/flashcard-preview.tsx`](https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/main/flashcard-preview.tsx) (Flashcard preview), [`packages/trpc/index.ts`](https://github.com/bibi0019/quenti/blob/main/packages/trpc/index.ts) (Typed API client), [`apps/next/src/pages/_app.tsx`](https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/_app.tsx) (Next.js app), [`apps/next/src/modules/organizations`](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/organizations) (Organization management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Web application"]
  node_web["Next.js app<br/>[_app.tsx]"]
  node_auth["Authentication"]
  node_trpcclient["Typed API client<br/>[index.ts]"]
  node_apiendpoint["tRPC endpoint<br/>[&#91;trpc&#93;.ts]"]
  node_profilefolders["Profiles and folders"]
end

subgraph group_study["Study experience"]
  node_setdata["Set hydration"]
  node_folderdata["Folder hydration"]
  node_flashcardpreview["Flashcard preview"]
  node_flashcardrun["Flashcard study"]
  node_learning["Learn practice"]
  node_matching["Match practice"]
  node_editing["Set editor"]
end

subgraph group_education["Classes and organizations"]
  node_classes["Classes and assignments"]
  node_organizations["Organization management"]
end

subgraph group_services["Platform services"]
  node_imagesearch["Image search<br/>[search.handler.ts]"]
  node_jobs["Background jobs<br/>[index.ts]"]
  node_billing["Subscription webhook<br/>[webhook.ts]"]
end

subgraph group_data["Persistence and analytics"]
  node_database[("PostgreSQL data<br/>[schema.ts]")]
  node_analytics["Enterprise analytics<br/>[index.ts]"]
end

node_learner(("Learner or teacher"))

node_learner -.->|"uses"| node_web
node_web -.->|"authenticates with"| node_auth
node_web -.->|"uses API"| node_trpcclient
node_trpcclient -->|"requests"| node_apiendpoint
node_flashcardpreview -->|"reads set"| node_setdata
node_flashcardpreview -->|"renders"| node_flashcardrun
node_flashcardpreview -->|"updates shuffle"| node_trpcclient
node_flashcardpreview -.->|"links to"| node_folderdata
node_learner -.->|"creates sets"| node_editing
node_learner -.->|"practices"| node_learning
node_learner -.->|"plays"| node_matching
node_learner -.->|"joins or teaches"| node_classes
node_learner -.->|"manages"| node_organizations
node_learner -.->|"organizes sets"| node_profilefolders
node_trpcclient -.->|"searches images"| node_imagesearch
node_billing -->|"updates subscription"| node_organizations
node_billing -.->|"updates organization"| node_database
node_jobs -.->|"handles org events"| node_organizations
node_jobs -.->|"sends invitations"| node_learner

click node_web "https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/_app.tsx"
click node_auth "https://github.com/bibi0019/quenti/blob/main/packages/auth/next-auth-options.ts"
click node_trpcclient "https://github.com/bibi0019/quenti/blob/main/packages/trpc/index.ts"
click node_apiendpoint "https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/api/trpc/%5Btrpc%5D.ts"
click node_setdata "https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/hydrate-set-data.tsx"
click node_folderdata "https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/hydrate-folder-data.tsx"
click node_flashcardpreview "https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/main/flashcard-preview.tsx"
click node_flashcardrun "https://github.com/bibi0019/quenti/blob/main/apps/next/src/components/root-flashcard-wrapper.tsx"
click node_learning "https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/learn"
click node_matching "https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/match"
click node_editing "https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/editor"
click node_classes "https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/classes"
click node_organizations "https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/organizations"
click node_profilefolders "https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/profile"
click node_imagesearch "https://github.com/bibi0019/quenti/blob/main/packages/trpc/server/routers/images/search.handler.ts"
click node_jobs "https://github.com/bibi0019/quenti/blob/main/packages/inngest/index.ts"
click node_billing "https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/api/stripe/webhook.ts"
click node_database "https://github.com/bibi0019/quenti/blob/main/packages/drizzle/schema.ts"
click node_analytics "https://github.com/bibi0019/quenti/blob/main/packages/enterprise/analytics/index.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_web,node_auth,node_trpcclient,node_apiendpoint,node_profilefolders toneBlue
class node_setdata,node_folderdata,node_flashcardpreview,node_flashcardrun,node_learning,node_matching,node_editing toneAmber
class node_classes,node_organizations toneMint
class node_imagesearch,node_jobs,node_billing toneRose
class node_database,node_analytics,node_learner toneIndigo
```

## Components

### Web application

- [Next.js app](https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/_app.tsx): `apps/next/src/pages/_app.tsx`
- [Authentication](https://github.com/bibi0019/quenti/blob/main/packages/auth/next-auth-options.ts): `packages/auth/next-auth-options.ts`
- [Typed API client](https://github.com/bibi0019/quenti/blob/main/packages/trpc/index.ts): `packages/trpc/index.ts`
- [tRPC endpoint](https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/api/trpc/%5Btrpc%5D.ts): `apps/next/src/pages/api/trpc/[trpc].ts`
- [Profiles and folders](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/profile): `apps/next/src/modules/profile`

### Study experience

- [Set hydration](https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/hydrate-set-data.tsx): `apps/next/src/modules/hydrate-set-data.tsx`
- [Folder hydration](https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/hydrate-folder-data.tsx): `apps/next/src/modules/hydrate-folder-data.tsx`
- [Flashcard preview](https://github.com/bibi0019/quenti/blob/main/apps/next/src/modules/main/flashcard-preview.tsx): `apps/next/src/modules/main/flashcard-preview.tsx`
- [Flashcard study](https://github.com/bibi0019/quenti/blob/main/apps/next/src/components/root-flashcard-wrapper.tsx): `apps/next/src/components/root-flashcard-wrapper.tsx`
- [Learn practice](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/learn): `apps/next/src/modules/learn`
- [Match practice](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/match): `apps/next/src/modules/match`
- [Set editor](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/editor): `apps/next/src/modules/editor`

### Classes and organizations

- [Classes and assignments](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/classes): `apps/next/src/modules/classes`
- [Organization management](https://github.com/bibi0019/quenti/tree/main/apps/next/src/modules/organizations): `apps/next/src/modules/organizations`

### Platform services

- [Image search](https://github.com/bibi0019/quenti/blob/main/packages/trpc/server/routers/images/search.handler.ts): `packages/trpc/server/routers/images/search.handler.ts`
- [Background jobs](https://github.com/bibi0019/quenti/blob/main/packages/inngest/index.ts): `packages/inngest/index.ts`
- [Subscription webhook](https://github.com/bibi0019/quenti/blob/main/apps/next/src/pages/api/stripe/webhook.ts): `apps/next/src/pages/api/stripe/webhook.ts`

### Persistence and analytics

- [PostgreSQL data](https://github.com/bibi0019/quenti/blob/main/packages/drizzle/schema.ts): `packages/drizzle/schema.ts`
- [Enterprise analytics](https://github.com/bibi0019/quenti/blob/main/packages/enterprise/analytics/index.ts): `packages/enterprise/analytics/index.ts`

### Other components

- **Learner or teacher**

## Connections

- Learner or teacher → Next.js app: uses
- Next.js app → Authentication: authenticates with
- Next.js app → Typed API client: uses API
- Typed API client → tRPC endpoint: requests (evidence: `packages/trpc/index.ts`)
- Flashcard preview → Set hydration: reads set (evidence: `apps/next/src/modules/main/flashcard-preview.tsx`)
- Flashcard preview → Flashcard study: renders (evidence: `apps/next/src/modules/main/flashcard-preview.tsx`)
- Flashcard preview → Typed API client: updates shuffle (evidence: `apps/next/src/modules/main/flashcard-preview.tsx`)
- Flashcard preview → Folder hydration: links to
- Learner or teacher → Set editor: creates sets
- Learner or teacher → Learn practice: practices
- Learner or teacher → Match practice: plays
- Learner or teacher → Classes and assignments: joins or teaches
- Learner or teacher → Organization management: manages
- Learner or teacher → Profiles and folders: organizes sets
- Typed API client → Image search: searches images
- Subscription webhook → Organization management: updates subscription (evidence: `apps/next/src/pages/api/stripe/webhook.ts`)
- Subscription webhook → PostgreSQL data: updates organization
- Background jobs → Organization management: handles org events
- Background jobs → Learner or teacher: sends invitations
