# nicasiomarques/postits-app architecture

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

- Interactive diagram: https://gitdiagram.com/nicasiomarques/postits-app
- Repository: https://github.com/nicasiomarques/postits-app

## Overview

Postists is a React notes app backed by an Express API and MongoDB. Users create notes with a subject and description, view the retrieved list, and delete notes; the client context coordinates these actions through the API service. The README also describes responsive presentation and persistence, while the sampled backend implements database connection and note CRUD. Unsampled component and service details are represented only where documented or indexed; the frontend-to-backend HTTP connection is shown as unverified.

Main entry points: [`backend/src/features/note/note.controller.ts`](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.controller.ts) (Note controller), [`frontend/src/services/notesApi.ts`](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/services/notesApi.ts) (Notes API), [`backend/src/app.ts`](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/app.ts) (Express app), [`frontend/src/pages/Home.tsx`](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/pages/Home.tsx) (Home page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Notes interface"]
  node_home["Home page<br/>[Home.tsx]"]
  node_appview["App layout<br/>[index.tsx]"]
  node_noteform["Note form<br/>[index.tsx]"]
  node_noteslist["Notes list<br/>[index.tsx]"]
  node_notecard["Note card<br/>[index.tsx]"]
end

subgraph group_clientdata["Client state and API"]
  node_context["Note context<br/>[Note.tsx]"]
  node_notesapi["Notes API<br/>[notesApi.ts]"]
  node_apiconnector["API connector<br/>[Api.ts]"]
  node_endpoints["Endpoint config<br/>[endpoints.ts]"]
  node_errorapi["API errors<br/>[error-api.ts]"]
end

subgraph group_server["API runtime"]
  node_serverentry["Server entry<br/>[server.ts]"]
  node_expressapp["Express app<br/>[app.ts]"]
  node_validator["Request validator"]
  node_errorhandler["Error handler"]
  node_httpexception["HTTP exception<br/>[httpException.ts]"]
end

subgraph group_domain["Note domain"]
  node_notecontroller["Note controller<br/>[note.controller.ts]"]
  node_notemodel["Note model<br/>[note.model.ts]"]
  node_notetype["Note type<br/>[note.type.ts]"]
  node_noteschema["Note validators<br/>[note.validators.ts]"]
  node_notfound["Not-found error"]
end

node_user(("User"))
node_backend["Notes backend"]
node_mongo[("MongoDB")]

node_user -->|"uses"| node_home
node_home -->|"renders"| node_appview
node_home -->|"renders"| node_noteform
node_home -->|"renders"| node_noteslist
node_noteform -->|"adds notes"| node_context
node_noteslist -->|"reads notes"| node_context
node_noteslist -->|"renders"| node_notecard
node_notecard -->|"deletes note"| node_notesapi
node_context -->|"loads and mutates"| node_notesapi
node_context -->|"formats errors"| node_errorapi
node_notesapi -->|"sends requests"| node_apiconnector
node_notesapi -->|"uses paths"| node_endpoints
node_notesapi -.->|"calls API"| node_backend
node_serverentry -->|"starts"| node_expressapp
node_serverentry -->|"registers"| node_notecontroller
node_serverentry -->|"validates environment"| node_expressapp
node_expressapp -->|"mounts routes"| node_notecontroller
node_expressapp -->|"installs"| node_errorhandler
node_expressapp -->|"connects"| node_mongo
node_notecontroller -->|"reads and writes"| node_notemodel
node_notecontroller -->|"validates requests"| node_validator
node_notecontroller -->|"uses schema"| node_noteschema
node_notecontroller -->|"raises on missing"| node_notfound
node_notemodel -->|"implements"| node_notetype
node_noteschema -->|"validates"| node_notetype
node_notfound -->|"extends"| node_httpexception
node_errorhandler -->|"handles"| node_httpexception

click node_home "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/pages/Home.tsx"
click node_appview "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/App/index.tsx"
click node_noteform "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/FormNote/index.tsx"
click node_noteslist "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/NotesList/index.tsx"
click node_notecard "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/NoteCard/index.tsx"
click node_context "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/contexts/Note.tsx"
click node_notesapi "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/services/notesApi.ts"
click node_apiconnector "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/services/Api.ts"
click node_endpoints "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/helpers/endpoints.ts"
click node_errorapi "https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/utils/error-api.ts"
click node_serverentry "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/server.ts"
click node_expressapp "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/app.ts"
click node_validator "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/middlewares/validator.middleware.ts"
click node_errorhandler "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/middlewares/errorHandler.middleware.ts"
click node_notecontroller "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.controller.ts"
click node_notemodel "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.model.ts"
click node_notetype "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.type.ts"
click node_noteschema "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.validators.ts"
click node_notfound "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/noteNotFoundException.ts"
click node_httpexception "https://github.com/nicasiomarques/postits-app/blob/main/backend/src/utils/httpException.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_home,node_appview,node_noteform,node_noteslist,node_notecard,node_user toneBlue
class node_context,node_notesapi,node_apiconnector,node_endpoints,node_errorapi,node_mongo toneAmber
class node_serverentry,node_expressapp,node_validator,node_errorhandler,node_httpexception toneMint
class node_notecontroller,node_notemodel,node_notetype,node_noteschema,node_notfound toneRose
class node_backend toneIndigo
```

## Components

### Notes interface

- [Home page](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/pages/Home.tsx): `frontend/src/pages/Home.tsx`
- [App layout](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/App/index.tsx): `frontend/src/components/App/index.tsx`
- [Note form](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/FormNote/index.tsx): `frontend/src/components/FormNote/index.tsx`
- [Notes list](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/NotesList/index.tsx): `frontend/src/components/NotesList/index.tsx`
- [Note card](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/components/NoteCard/index.tsx): `frontend/src/components/NoteCard/index.tsx`

### Client state and API

- [Note context](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/contexts/Note.tsx): `frontend/src/contexts/Note.tsx`
- [Notes API](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/services/notesApi.ts): `frontend/src/services/notesApi.ts`
- [API connector](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/services/Api.ts): `frontend/src/services/Api.ts`
- [Endpoint config](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/helpers/endpoints.ts): `frontend/src/helpers/endpoints.ts`
- [API errors](https://github.com/nicasiomarques/postits-app/blob/main/frontend/src/utils/error-api.ts): `frontend/src/utils/error-api.ts`

### API runtime

- [Server entry](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/server.ts): `backend/src/server.ts`
- [Express app](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/app.ts): `backend/src/app.ts`
- [Request validator](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/middlewares/validator.middleware.ts): `backend/src/middlewares/validator.middleware.ts`
- [Error handler](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/middlewares/errorHandler.middleware.ts): `backend/src/middlewares/errorHandler.middleware.ts`
- [HTTP exception](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/utils/httpException.ts): `backend/src/utils/httpException.ts`

### Note domain

- [Note controller](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.controller.ts): `backend/src/features/note/note.controller.ts`
- [Note model](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.model.ts): `backend/src/features/note/note.model.ts`
- [Note type](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.type.ts): `backend/src/features/note/note.type.ts`
- [Note validators](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/note.validators.ts): `backend/src/features/note/note.validators.ts`
- [Not-found error](https://github.com/nicasiomarques/postits-app/blob/main/backend/src/features/note/noteNotFoundException.ts): `backend/src/features/note/noteNotFoundException.ts`

### Other components

- **User**
- **Notes backend**
- **MongoDB**

## Connections

- User → Home page: uses
- Home page → App layout: renders (evidence: `frontend/src/pages/Home.tsx`)
- Home page → Note form: renders (evidence: `frontend/src/pages/Home.tsx`)
- Home page → Notes list: renders (evidence: `frontend/src/pages/Home.tsx`)
- Note form → Note context: adds notes (evidence: `frontend/src/components/FormNote/index.tsx`)
- Notes list → Note context: reads notes (evidence: `frontend/src/components/NotesList/index.tsx`)
- Notes list → Note card: renders (evidence: `frontend/src/components/NotesList/index.tsx`)
- Note card → Notes API: deletes note (evidence: `frontend/src/components/NoteCard/index.tsx`)
- Note context → Notes API: loads and mutates (evidence: `frontend/src/contexts/Note.tsx`)
- Note context → API errors: formats errors (evidence: `frontend/src/contexts/Note.tsx`)
- Notes API → API connector: sends requests (evidence: `frontend/src/services/notesApi.ts`)
- Notes API → Endpoint config: uses paths (evidence: `frontend/src/services/notesApi.ts`)
- Notes API → Notes backend: calls API
- Server entry → Express app: starts (evidence: `backend/src/server.ts`)
- Server entry → Note controller: registers (evidence: `backend/src/server.ts`)
- Server entry → Express app: validates environment (evidence: `backend/src/server.ts`)
- Express app → Note controller: mounts routes (evidence: `backend/src/app.ts`)
- Express app → Error handler: installs (evidence: `backend/src/app.ts`)
- Express app → MongoDB: connects (evidence: `backend/src/app.ts`)
- Note controller → Note model: reads and writes (evidence: `backend/src/features/note/note.controller.ts`)
- Note controller → Request validator: validates requests (evidence: `backend/src/features/note/note.controller.ts`)
- Note controller → Note validators: uses schema (evidence: `backend/src/features/note/note.controller.ts`)
- Note controller → Not-found error: raises on missing (evidence: `backend/src/features/note/note.controller.ts`)
- Note model → Note type: implements (evidence: `backend/src/features/note/note.model.ts`)
- Note validators → Note type: validates (evidence: `backend/src/features/note/note.validators.ts`)
- Not-found error → HTTP exception: extends (evidence: `backend/src/features/note/noteNotFoundException.ts`)
- Error handler → HTTP exception: handles (evidence: `backend/src/middlewares/errorHandler.middleware.ts`)
