# dksifoua/note-taking-app architecture

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

- Interactive diagram: https://gitdiagram.com/dksifoua/note-taking-app
- Repository: https://github.com/dksifoua/note-taking-app

## Overview

This is a note-taking application with a React UI and a Bun/TypeScript API, backed by MongoDB. The visible backend workflow routes registration and login requests through HTTP handlers, authentication services, and user persistence; user retrieval and deletion use a parallel handler/service/repository path. The UI includes authentication and a protected home page, but the excerpts do not show how it calls the API or implements note operations. The graph preserves those documented product surfaces while marking unsupported UI-to-API wiring as unverified.

Main entry points: [`apps/api/src/app.ts`](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/app.ts) (API bootstrap), [`apps/ui/src/App.tsx`](https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/App.tsx) (Route application), [`apps/api/src/repositories/user.repository.ts`](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/repositories/user.repository.ts) (User repository), [`apps/ui/src/pages/Auth`](https://github.com/dksifoua/note-taking-app/tree/main/apps/ui/src/pages/Auth) (Auth pages)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Web interface"]
  node_ui_app["Route application<br/>[App.tsx]"]
  node_auth_pages["Auth pages"]
  node_home_page["Protected home<br/>[HomePage.tsx]"]
  node_auth_state["Auth provider<br/>[AuthProvider.tsx]"]
  node_ui_components["UI components<br/>[Components.tsx]"]
end

subgraph group_api["API runtime"]
  node_api_runtime["API bootstrap<br/>[app.ts]"]
  node_middleware["Request middleware"]
  node_auth_handler["Auth handler<br/>[auth.handler.ts]"]
  node_user_handler["User handler<br/>[user.handler.ts]"]
end

subgraph group_domain["User domain"]
  node_auth_service["Authentication<br/>[auth.service.ts]"]
  node_user_service["User operations<br/>[user.service.ts]"]
end

subgraph group_storage["Persistence"]
  node_user_repository["User repository<br/>[user.repository.ts]"]
  node_db_context["Database context<br/>[context.ts]"]
  node_user_schema["User schema<br/>[user.schema.ts]"]
end

subgraph group_shared["Shared infrastructure"]
  node_http_router["HTTP router<br/>[router.ts]"]
  node_ioc["Dependency injection<br/>[provider.ts]"]
  node_logging["Logging<br/>[index.ts]"]
end

node_visitor(("User"))
node_mongodb[("MongoDB")]

node_visitor -->|"uses"| node_ui_app
node_ui_app -->|"provides auth"| node_auth_state
node_ui_app -->|"routes to"| node_auth_pages
node_ui_app -->|"protects route"| node_home_page
node_ui_app -->|"routes to"| node_ui_components
node_auth_pages -.->|"uses"| node_ui_components
node_visitor -.->|"sends requests"| node_api_runtime
node_api_runtime -->|"configures routes"| node_http_router
node_api_runtime -->|"installs"| node_middleware
node_api_runtime -->|"routes auth"| node_auth_handler
node_api_runtime -->|"routes users"| node_user_handler
node_api_runtime -->|"registers services"| node_ioc
node_api_runtime -->|"creates logger"| node_logging
node_auth_handler -->|"calls"| node_auth_service
node_user_handler -->|"calls"| node_user_service
node_auth_service -->|"checks and writes users"| node_user_repository
node_user_service -->|"reads and deletes"| node_user_repository
node_user_repository -->|"queries models"| node_db_context
node_db_context -->|"uses schema"| node_user_schema
node_api_runtime -->|"connects"| node_mongodb
node_user_repository -.->|"persists users"| node_mongodb

click node_ui_app "https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/App.tsx"
click node_auth_pages "https://github.com/dksifoua/note-taking-app/tree/main/apps/ui/src/pages/Auth"
click node_home_page "https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/pages/Home/HomePage.tsx"
click node_auth_state "https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/providers/AuthProvider.tsx"
click node_ui_components "https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/Components.tsx"
click node_api_runtime "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/app.ts"
click node_http_router "https://github.com/dksifoua/note-taking-app/blob/main/packages/http/src/router.ts"
click node_middleware "https://github.com/dksifoua/note-taking-app/tree/main/apps/api/src/middlewares"
click node_auth_handler "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/handlers/auth.handler.ts"
click node_user_handler "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/handlers/user.handler.ts"
click node_auth_service "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/services/auth.service.ts"
click node_user_service "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/services/user.service.ts"
click node_user_repository "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/repositories/user.repository.ts"
click node_db_context "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/persistence/context.ts"
click node_user_schema "https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/schemas/user.schema.ts"
click node_ioc "https://github.com/dksifoua/note-taking-app/blob/main/packages/ioc/src/provider.ts"
click node_logging "https://github.com/dksifoua/note-taking-app/blob/main/packages/logging/src/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_ui_app,node_auth_pages,node_home_page,node_auth_state,node_ui_components,node_visitor toneBlue
class node_api_runtime,node_middleware,node_auth_handler,node_user_handler,node_mongodb toneAmber
class node_auth_service,node_user_service toneMint
class node_user_repository,node_db_context,node_user_schema toneRose
class node_http_router,node_ioc,node_logging toneIndigo
```

## Components

### Web interface

- [Route application](https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/App.tsx): `apps/ui/src/App.tsx`
- [Auth pages](https://github.com/dksifoua/note-taking-app/tree/main/apps/ui/src/pages/Auth): `apps/ui/src/pages/Auth`
- [Protected home](https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/pages/Home/HomePage.tsx): `apps/ui/src/pages/Home/HomePage.tsx`
- [Auth provider](https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/providers/AuthProvider.tsx): `apps/ui/src/providers/AuthProvider.tsx`
- [UI components](https://github.com/dksifoua/note-taking-app/blob/main/apps/ui/src/Components.tsx): `apps/ui/src/Components.tsx`

### API runtime

- [API bootstrap](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/app.ts): `apps/api/src/app.ts`
- [Request middleware](https://github.com/dksifoua/note-taking-app/tree/main/apps/api/src/middlewares): `apps/api/src/middlewares`
- [Auth handler](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/handlers/auth.handler.ts): `apps/api/src/handlers/auth.handler.ts`
- [User handler](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/handlers/user.handler.ts): `apps/api/src/handlers/user.handler.ts`

### User domain

- [Authentication](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/services/auth.service.ts): `apps/api/src/services/auth.service.ts`
- [User operations](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/services/user.service.ts): `apps/api/src/services/user.service.ts`

### Persistence

- [User repository](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/repositories/user.repository.ts): `apps/api/src/repositories/user.repository.ts`
- [Database context](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/persistence/context.ts): `apps/api/src/persistence/context.ts`
- [User schema](https://github.com/dksifoua/note-taking-app/blob/main/apps/api/src/schemas/user.schema.ts): `apps/api/src/schemas/user.schema.ts`

### Shared infrastructure

- [HTTP router](https://github.com/dksifoua/note-taking-app/blob/main/packages/http/src/router.ts): `packages/http/src/router.ts`
- [Dependency injection](https://github.com/dksifoua/note-taking-app/blob/main/packages/ioc/src/provider.ts): `packages/ioc/src/provider.ts`
- [Logging](https://github.com/dksifoua/note-taking-app/blob/main/packages/logging/src/index.ts): `packages/logging/src/index.ts`

### Other components

- **User**
- **MongoDB**

## Connections

- User → Route application: uses
- Route application → Auth provider: provides auth (evidence: `apps/ui/src/App.tsx`)
- Route application → Auth pages: routes to (evidence: `apps/ui/src/App.tsx`)
- Route application → Protected home: protects route (evidence: `apps/ui/src/App.tsx`)
- Route application → UI components: routes to (evidence: `apps/ui/src/App.tsx`)
- Auth pages → UI components: uses
- User → API bootstrap: sends requests
- API bootstrap → HTTP router: configures routes (evidence: `apps/api/src/app.ts`)
- API bootstrap → Request middleware: installs (evidence: `apps/api/src/app.ts`)
- API bootstrap → Auth handler: routes auth (evidence: `apps/api/src/app.ts`)
- API bootstrap → User handler: routes users (evidence: `apps/api/src/app.ts`)
- API bootstrap → Dependency injection: registers services (evidence: `apps/api/src/app.ts`)
- API bootstrap → Logging: creates logger (evidence: `apps/api/src/app.ts`)
- Auth handler → Authentication: calls (evidence: `apps/api/src/handlers/auth.handler.ts`)
- User handler → User operations: calls (evidence: `apps/api/src/handlers/user.handler.ts`)
- Authentication → User repository: checks and writes users (evidence: `apps/api/src/services/auth.service.ts`)
- User operations → User repository: reads and deletes (evidence: `apps/api/src/services/user.service.ts`)
- User repository → Database context: queries models (evidence: `apps/api/src/repositories/user.repository.ts`)
- Database context → User schema: uses schema (evidence: `apps/api/src/persistence/context.ts`)
- API bootstrap → MongoDB: connects (evidence: `apps/api/src/app.ts`)
- User repository → MongoDB: persists users
