# tearcake/picassa architecture

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

- Interactive diagram: https://gitdiagram.com/tearcake/picassa
- Repository: https://github.com/tearcake/picassa

## Overview

Picassa is a Pinterest-inspired visual-content application. Users authenticate, browse or search pins, open a post, and can create pins in an editor, organize them into boards, comment, like, save, and follow users. The frontend routes and components call a Node/Express API whose controllers operate on MongoDB models; pin creation also uploads transformed images to ImageKit. The graph preserves documented features whose implementations were not sampled, but marks those connections unverified rather than inferring their call paths.

Main entry points: [`frontend/src/main.jsx`](https://github.com/tearcake/picassa/blob/main/frontend/src/main.jsx) (Route application), [`backend/index.js`](https://github.com/tearcake/picassa/blob/main/backend/index.js) (Express application), [`backend/controllers/pin.controller.js`](https://github.com/tearcake/picassa/blob/main/backend/controllers/pin.controller.js) (Pin service), [`frontend/src/routes/createPage/createPage.jsx`](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/createPage/createPage.jsx) (Pin creation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Frontend experience"]
  node_app["Route application<br/>[main.jsx]"]
  node_home["Home and search<br/>[homepage.jsx]"]
  node_searchpage["Search page<br/>[searchPage.jsx]"]
  node_api["API client<br/>[apiReq.js]"]
end

subgraph group_content["Content and creation"]
  node_gallery["Pin gallery<br/>[gallery.jsx]"]
  node_galleryitem["Gallery item<br/>[galleryItem.jsx]"]
  node_create["Pin creation<br/>[createPage.jsx]"]
  node_editor["Image editor<br/>[Options.jsx]"]
  node_editorstate["Editor state<br/>[editorStore.js]"]
  node_post["Pin detail page<br/>[postpage.jsx]"]
  node_commentsui["Comments view<br/>[comments.jsx]"]
  node_imagecomponent["Image rendering<br/>[image.jsx]"]
end

subgraph group_identity["Identity and social"]
  node_auth["Authentication page<br/>[authPage.jsx]"]
  node_authstate["Auth state<br/>[authStore.js]"]
  node_profile["Profile and boards<br/>[profilePage.jsx]"]
end

subgraph group_server["API services"]
  node_express["Express application<br/>[index.js]"]
  node_pinroute["Pin routes<br/>[pin.route.js]"]
  node_pincontroller["Pin service<br/>[pin.controller.js]"]
  node_userroute["User routes<br/>[user.route.js]"]
  node_usercontroller["User service<br/>[user.controller.js]"]
  node_commentroute["Comment routes<br/>[comment.route.js]"]
  node_commentcontroller["Comment service"]
  node_boardroute["Board routes<br/>[board.route.js]"]
  node_boardcontroller["Board service"]
  node_authguard["JWT verification<br/>[verifyToken.js]"]
end

subgraph group_data["MongoDB models"]
  node_pins[("Pins<br/>[pin.model.js]")]
  node_users[("Users<br/>[user.model.js]")]
  node_boards[("Boards<br/>[board.model.js]")]
  node_comments[("Comments<br/>[comment.model.js]")]
  node_socialmodels[("Social interactions")]
end

node_visitor(("Visitor or user"))
node_imagekit["ImageKit"]

node_visitor -->|"opens"| node_app
node_app -->|"routes to"| node_auth
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_create
node_app -->|"routes to"| node_post
node_app -->|"routes to"| node_profile
node_app -->|"routes to"| node_searchpage
node_auth -->|"submits credentials"| node_api
node_auth -->|"sets user"| node_authstate
node_home -->|"renders"| node_gallery
node_searchpage -->|"renders"| node_gallery
node_gallery -->|"renders pins"| node_galleryitem
node_gallery -.->|"requests pin pages"| node_pins
node_create -->|"renders editor"| node_editor
node_create -->|"reads editor state"| node_editorstate
node_create -->|"submits pin"| node_api
node_editor -->|"updates options"| node_editorstate
node_post -->|"renders comments"| node_commentsui
node_post -->|"loads post data"| node_api
node_profile -->|"renders user pins"| node_gallery
node_profile -->|"loads profile"| node_api
node_api -.->|"HTTP requests"| node_express
node_express -->|"mounts routes"| node_pinroute
node_express -->|"mounts routes"| node_userroute
node_express -->|"mounts routes"| node_commentroute
node_express -->|"mounts routes"| node_boardroute
node_pinroute -->|"dispatches"| node_pincontroller
node_userroute -->|"dispatches"| node_usercontroller
node_commentroute -->|"dispatches"| node_commentcontroller
node_boardroute -->|"dispatches"| node_boardcontroller
node_pinroute -->|"protects endpoints"| node_authguard
node_userroute -->|"protects endpoints"| node_authguard
node_commentroute -->|"protects endpoints"| node_authguard
node_pincontroller -->|"queries and creates"| node_pins
node_pincontroller -->|"populates user"| node_users
node_pincontroller -->|"reads and updates"| node_socialmodels
node_pincontroller -->|"uploads transformed media"| node_imagekit
node_usercontroller -->|"creates and queries"| node_users
node_usercontroller -->|"manages follows"| node_socialmodels
node_commentcontroller -->|"queries and creates"| node_comments
node_commentcontroller -->|"populates commenter"| node_users
node_boardcontroller -->|"queries boards"| node_boards
node_boardcontroller -->|"counts and finds pins"| node_pins
node_galleryitem -.->|"renders media"| node_imagecomponent
node_visitor -.->|"follows users"| node_profile
node_visitor -.->|"likes and saves"| node_post
node_visitor -.->|"organizes into boards"| node_create

click node_app "https://github.com/tearcake/picassa/blob/main/frontend/src/main.jsx"
click node_auth "https://github.com/tearcake/picassa/blob/main/frontend/src/routes/authPage/authPage.jsx"
click node_authstate "https://github.com/tearcake/picassa/blob/main/frontend/src/utils/authStore.js"
click node_home "https://github.com/tearcake/picassa/blob/main/frontend/src/routes/homepage/homepage.jsx"
click node_searchpage "https://github.com/tearcake/picassa/blob/main/frontend/src/routes/searchPage/searchPage.jsx"
click node_gallery "https://github.com/tearcake/picassa/blob/main/frontend/src/components/gallery/gallery.jsx"
click node_galleryitem "https://github.com/tearcake/picassa/blob/main/frontend/src/components/galleryItem/galleryItem.jsx"
click node_create "https://github.com/tearcake/picassa/blob/main/frontend/src/routes/createPage/createPage.jsx"
click node_editor "https://github.com/tearcake/picassa/blob/main/frontend/src/components/editor/Options.jsx"
click node_editorstate "https://github.com/tearcake/picassa/blob/main/frontend/src/utils/editorStore.js"
click node_post "https://github.com/tearcake/picassa/blob/main/frontend/src/routes/postpage/postpage.jsx"
click node_commentsui "https://github.com/tearcake/picassa/blob/main/frontend/src/components/comments/comments.jsx"
click node_profile "https://github.com/tearcake/picassa/blob/main/frontend/src/routes/profilePage/profilePage.jsx"
click node_api "https://github.com/tearcake/picassa/blob/main/frontend/src/utils/apiReq.js"
click node_express "https://github.com/tearcake/picassa/blob/main/backend/index.js"
click node_pinroute "https://github.com/tearcake/picassa/blob/main/backend/routes/pin.route.js"
click node_pincontroller "https://github.com/tearcake/picassa/blob/main/backend/controllers/pin.controller.js"
click node_userroute "https://github.com/tearcake/picassa/blob/main/backend/routes/user.route.js"
click node_usercontroller "https://github.com/tearcake/picassa/blob/main/backend/controllers/user.controller.js"
click node_commentroute "https://github.com/tearcake/picassa/blob/main/backend/routes/comment.route.js"
click node_commentcontroller "https://github.com/tearcake/picassa/blob/main/backend/controllers/comment.controller.js"
click node_boardroute "https://github.com/tearcake/picassa/blob/main/backend/routes/board.route.js"
click node_boardcontroller "https://github.com/tearcake/picassa/blob/main/backend/controllers/board.controller.js"
click node_authguard "https://github.com/tearcake/picassa/blob/main/backend/middlewares/verifyToken.js"
click node_pins "https://github.com/tearcake/picassa/blob/main/backend/models/pin.model.js"
click node_users "https://github.com/tearcake/picassa/blob/main/backend/models/user.model.js"
click node_boards "https://github.com/tearcake/picassa/blob/main/backend/models/board.model.js"
click node_comments "https://github.com/tearcake/picassa/blob/main/backend/models/comment.model.js"
click node_socialmodels "https://github.com/tearcake/picassa/tree/main/backend/models"
click node_imagecomponent "https://github.com/tearcake/picassa/blob/main/frontend/src/components/image/image.jsx"

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_app,node_home,node_searchpage,node_api,node_visitor toneBlue
class node_gallery,node_galleryitem,node_create,node_editor,node_editorstate,node_post,node_commentsui,node_imagecomponent toneAmber
class node_auth,node_authstate,node_profile toneMint
class node_express,node_pinroute,node_pincontroller,node_userroute,node_usercontroller,node_commentroute,node_commentcontroller,node_boardroute,node_boardcontroller,node_authguard toneRose
class node_pins,node_users,node_boards,node_comments,node_socialmodels,node_imagekit toneIndigo
```

## Components

### Frontend experience

- [Route application](https://github.com/tearcake/picassa/blob/main/frontend/src/main.jsx): `frontend/src/main.jsx`
- [Home and search](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/homepage/homepage.jsx): `frontend/src/routes/homepage/homepage.jsx`
- [Search page](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/searchPage/searchPage.jsx): `frontend/src/routes/searchPage/searchPage.jsx`
- [API client](https://github.com/tearcake/picassa/blob/main/frontend/src/utils/apiReq.js): `frontend/src/utils/apiReq.js`

### Content and creation

- [Pin gallery](https://github.com/tearcake/picassa/blob/main/frontend/src/components/gallery/gallery.jsx): `frontend/src/components/gallery/gallery.jsx`
- [Gallery item](https://github.com/tearcake/picassa/blob/main/frontend/src/components/galleryItem/galleryItem.jsx): `frontend/src/components/galleryItem/galleryItem.jsx`
- [Pin creation](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/createPage/createPage.jsx): `frontend/src/routes/createPage/createPage.jsx`
- [Image editor](https://github.com/tearcake/picassa/blob/main/frontend/src/components/editor/Options.jsx): `frontend/src/components/editor/Options.jsx`
- [Editor state](https://github.com/tearcake/picassa/blob/main/frontend/src/utils/editorStore.js): `frontend/src/utils/editorStore.js`
- [Pin detail page](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/postpage/postpage.jsx): `frontend/src/routes/postpage/postpage.jsx`
- [Comments view](https://github.com/tearcake/picassa/blob/main/frontend/src/components/comments/comments.jsx): `frontend/src/components/comments/comments.jsx`
- [Image rendering](https://github.com/tearcake/picassa/blob/main/frontend/src/components/image/image.jsx): `frontend/src/components/image/image.jsx`

### Identity and social

- [Authentication page](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/authPage/authPage.jsx): `frontend/src/routes/authPage/authPage.jsx`
- [Auth state](https://github.com/tearcake/picassa/blob/main/frontend/src/utils/authStore.js): `frontend/src/utils/authStore.js`
- [Profile and boards](https://github.com/tearcake/picassa/blob/main/frontend/src/routes/profilePage/profilePage.jsx): `frontend/src/routes/profilePage/profilePage.jsx`

### API services

- [Express application](https://github.com/tearcake/picassa/blob/main/backend/index.js): `backend/index.js`
- [Pin routes](https://github.com/tearcake/picassa/blob/main/backend/routes/pin.route.js): `backend/routes/pin.route.js`
- [Pin service](https://github.com/tearcake/picassa/blob/main/backend/controllers/pin.controller.js): `backend/controllers/pin.controller.js`
- [User routes](https://github.com/tearcake/picassa/blob/main/backend/routes/user.route.js): `backend/routes/user.route.js`
- [User service](https://github.com/tearcake/picassa/blob/main/backend/controllers/user.controller.js): `backend/controllers/user.controller.js`
- [Comment routes](https://github.com/tearcake/picassa/blob/main/backend/routes/comment.route.js): `backend/routes/comment.route.js`
- [Comment service](https://github.com/tearcake/picassa/blob/main/backend/controllers/comment.controller.js): `backend/controllers/comment.controller.js`
- [Board routes](https://github.com/tearcake/picassa/blob/main/backend/routes/board.route.js): `backend/routes/board.route.js`
- [Board service](https://github.com/tearcake/picassa/blob/main/backend/controllers/board.controller.js): `backend/controllers/board.controller.js`
- [JWT verification](https://github.com/tearcake/picassa/blob/main/backend/middlewares/verifyToken.js): `backend/middlewares/verifyToken.js`

### MongoDB models

- [Pins](https://github.com/tearcake/picassa/blob/main/backend/models/pin.model.js): `backend/models/pin.model.js`
- [Users](https://github.com/tearcake/picassa/blob/main/backend/models/user.model.js): `backend/models/user.model.js`
- [Boards](https://github.com/tearcake/picassa/blob/main/backend/models/board.model.js): `backend/models/board.model.js`
- [Comments](https://github.com/tearcake/picassa/blob/main/backend/models/comment.model.js): `backend/models/comment.model.js`
- [Social interactions](https://github.com/tearcake/picassa/tree/main/backend/models): `backend/models`

### Other components

- **Visitor or user**
- **ImageKit**

## Connections

- Visitor or user → Route application: opens (evidence: `frontend/src/main.jsx`)
- Route application → Authentication page: routes to (evidence: `frontend/src/main.jsx`)
- Route application → Home and search: routes to (evidence: `frontend/src/main.jsx`)
- Route application → Pin creation: routes to (evidence: `frontend/src/main.jsx`)
- Route application → Pin detail page: routes to (evidence: `frontend/src/main.jsx`)
- Route application → Profile and boards: routes to (evidence: `frontend/src/main.jsx`)
- Route application → Search page: routes to (evidence: `frontend/src/main.jsx`)
- Authentication page → API client: submits credentials (evidence: `frontend/src/routes/authPage/authPage.jsx`)
- Authentication page → Auth state: sets user (evidence: `frontend/src/routes/authPage/authPage.jsx`)
- Home and search → Pin gallery: renders (evidence: `frontend/src/routes/homepage/homepage.jsx`)
- Search page → Pin gallery: renders (evidence: `frontend/src/routes/searchPage/searchPage.jsx`)
- Pin gallery → Gallery item: renders pins (evidence: `frontend/src/components/gallery/gallery.jsx`)
- Pin gallery → Pins: requests pin pages
- Pin creation → Image editor: renders editor (evidence: `frontend/src/routes/createPage/createPage.jsx`)
- Pin creation → Editor state: reads editor state (evidence: `frontend/src/routes/createPage/createPage.jsx`)
- Pin creation → API client: submits pin (evidence: `frontend/src/routes/createPage/createPage.jsx`)
- Image editor → Editor state: updates options (evidence: `frontend/src/components/editor/Options.jsx`)
- Pin detail page → Comments view: renders comments (evidence: `frontend/src/routes/postpage/postpage.jsx`)
- Pin detail page → API client: loads post data (evidence: `frontend/src/routes/postpage/postpage.jsx`)
- Profile and boards → Pin gallery: renders user pins (evidence: `frontend/src/routes/profilePage/profilePage.jsx`)
- Profile and boards → API client: loads profile (evidence: `frontend/src/routes/profilePage/profilePage.jsx`)
- API client → Express application: HTTP requests
- Express application → Pin routes: mounts routes (evidence: `backend/index.js`)
- Express application → User routes: mounts routes (evidence: `backend/index.js`)
- Express application → Comment routes: mounts routes (evidence: `backend/index.js`)
- Express application → Board routes: mounts routes (evidence: `backend/index.js`)
- Pin routes → Pin service: dispatches (evidence: `backend/routes/pin.route.js`)
- User routes → User service: dispatches (evidence: `backend/routes/user.route.js`)
- Comment routes → Comment service: dispatches (evidence: `backend/routes/comment.route.js`)
- Board routes → Board service: dispatches (evidence: `backend/routes/board.route.js`)
- Pin routes → JWT verification: protects endpoints (evidence: `backend/routes/pin.route.js`)
- User routes → JWT verification: protects endpoints (evidence: `backend/routes/user.route.js`)
- Comment routes → JWT verification: protects endpoints (evidence: `backend/routes/comment.route.js`)
- Pin service → Pins: queries and creates (evidence: `backend/controllers/pin.controller.js`)
- Pin service → Users: populates user (evidence: `backend/controllers/pin.controller.js`)
- Pin service → Social interactions: reads and updates (evidence: `backend/controllers/pin.controller.js`)
- Pin service → ImageKit: uploads transformed media (evidence: `backend/controllers/pin.controller.js`)
- User service → Users: creates and queries (evidence: `backend/controllers/user.controller.js`)
- User service → Social interactions: manages follows (evidence: `backend/controllers/user.controller.js`)
- Comment service → Comments: queries and creates (evidence: `backend/controllers/comment.controller.js`)
- Comment service → Users: populates commenter (evidence: `backend/controllers/comment.controller.js`)
- Board service → Boards: queries boards (evidence: `backend/controllers/board.controller.js`)
- Board service → Pins: counts and finds pins (evidence: `backend/controllers/board.controller.js`)
- Gallery item → Image rendering: renders media
- Visitor or user → Profile and boards: follows users
- Visitor or user → Pin detail page: likes and saves
- Visitor or user → Pin creation: organizes into boards
