# nitinj1212/paintings_web architecture

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

- Interactive diagram: https://gitdiagram.com/nitinj1212/paintings_web
- Repository: https://github.com/nitinj1212/paintings_web

## Overview

This is a Next.js art-gallery application: visitors browse paintings, while signed-in users can like and save works; artists manage profiles and painting listings, and super admins manage users and catalog metadata. The tree also indicates an emotion-based gallery experience and rating repositories, but their runtime wiring is not shown in the sampled source. The graph follows the visible API-to-Supabase calls and treats unsampled UI composition cautiously; the README provides no further product detail.

Main entry points: [`utils/supabase/server.js`](https://github.com/nitinj1212/paintings_web/blob/main/utils/supabase/server.js) (Server client), [`lib/auth-server.ts`](https://github.com/nitinj1212/paintings_web/blob/main/lib/auth-server.ts) (Auth guards), [`components/GalleryExperience.tsx`](https://github.com/nitinj1212/paintings_web/blob/main/components/GalleryExperience.tsx) (Gallery experience), [`app/api/artist/profile/route.ts`](https://github.com/nitinj1212/paintings_web/blob/main/app/api/artist/profile/route.ts) (Artist profiles)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Gallery experience"]
  node_home["Home page<br/>[page.tsx]"]
  node_gallery["Gallery page<br/>[page.tsx]"]
  node_gallery_ui["Gallery experience"]
  node_painting_stage["Painting stage<br/>[PaintingStage.tsx]"]
  node_painting_nav["Painting navigation<br/>[PaintingNav.tsx]"]
  node_emotion_picker["Emotion picker<br/>[EmotionPicker.tsx]"]
  node_rating_repo["Rating repository"]
  node_local_rating["Local rating store"]
end

subgraph group_identity["Identity and roles"]
  node_signin["Sign-in page<br/>[page.tsx]"]
  node_signup["Sign-up page<br/>[page.tsx]"]
  node_auth_forms["Auth forms<br/>[SignInForm.tsx]"]
  node_auth_api["Auth API<br/>[route.js]"]
  node_auth_guard["Auth guards<br/>[auth-server.ts]"]
  node_session["Session handling<br/>[session.ts]"]
end

subgraph group_catalog["Artwork and catalog"]
  node_artist_profile["Artist profiles<br/>[route.ts]"]
  node_paintings_api["Painting catalog API<br/>[route.ts]"]
  node_painting_detail["Painting details API<br/>[route.ts]"]
  node_likes_api["Likes API<br/>[route.ts]"]
  node_wishlist_api["Wishlists API<br/>[route.ts]"]
  node_categories_api["Categories API<br/>[route.ts]"]
  node_mediums_api["Mediums API<br/>[route.ts]"]
  node_admin_users["User administration<br/>[route.ts]"]
end

subgraph group_persistence["Data access"]
  node_supabase_client["Server client<br/>[server.js]"]
  node_supabase[("Supabase data service")]
  node_painting_data["Painting data<br/>[paintings.ts]"]
  node_shuffle["Shuffle queue<br/>[shuffleQueue.ts]"]
end

node_visitor(("Visitor"))
node_member(("Signed-in member"))
node_artist(("Artist"))
node_admin(("Super admin"))

node_visitor -->|"opens"| node_home
node_visitor -->|"browses"| node_gallery
node_member -->|"signs in"| node_signin
node_member -->|"registers"| node_signup
node_artist -->|"uploads"| node_paintings_api
node_artist -->|"manages profile"| node_artist_profile
node_admin -->|"administers"| node_admin_users
node_gallery -->|"renders"| node_gallery_ui
node_gallery_ui -->|"presents"| node_painting_stage
node_gallery_ui -->|"offers navigation"| node_painting_nav
node_gallery_ui -->|"offers emotion choice"| node_emotion_picker
node_signin -->|"renders"| node_auth_forms
node_signup -->|"uses form"| node_auth_forms
node_auth_forms -->|"submits"| node_auth_api
node_auth_api -->|"creates client"| node_supabase_client
node_auth_guard -->|"creates client"| node_supabase_client
node_paintings_api -->|"checks artist role"| node_auth_guard
node_painting_detail -->|"checks user"| node_auth_guard
node_likes_api -->|"requires user"| node_auth_guard
node_wishlist_api -->|"requires user"| node_auth_guard
node_artist_profile -->|"requires user"| node_auth_guard
node_categories_api -->|"checks admin role"| node_auth_guard
node_mediums_api -->|"checks admin role"| node_auth_guard
node_admin_users -->|"checks admin role"| node_auth_guard
node_paintings_api -->|"creates client"| node_supabase_client
node_painting_detail -->|"creates client"| node_supabase_client
node_likes_api -->|"creates client"| node_supabase_client
node_wishlist_api -->|"creates client"| node_supabase_client
node_artist_profile -->|"creates client"| node_supabase_client
node_categories_api -->|"creates client"| node_supabase_client
node_mediums_api -->|"creates client"| node_supabase_client
node_admin_users -->|"creates client"| node_supabase_client
node_supabase_client -->|"queries and writes"| node_supabase
node_gallery_ui -.-> node_rating_repo
node_rating_repo -.-> node_local_rating

click node_home "https://github.com/nitinj1212/paintings_web/blob/main/app/page.tsx"
click node_gallery "https://github.com/nitinj1212/paintings_web/blob/main/app/gallery/page.tsx"
click node_gallery_ui "https://github.com/nitinj1212/paintings_web/blob/main/components/GalleryExperience.tsx"
click node_painting_stage "https://github.com/nitinj1212/paintings_web/blob/main/components/PaintingStage.tsx"
click node_painting_nav "https://github.com/nitinj1212/paintings_web/blob/main/components/PaintingNav.tsx"
click node_emotion_picker "https://github.com/nitinj1212/paintings_web/blob/main/components/EmotionPicker.tsx"
click node_rating_repo "https://github.com/nitinj1212/paintings_web/blob/main/services/ratingRepository.ts"
click node_local_rating "https://github.com/nitinj1212/paintings_web/blob/main/services/localRatingRepository.ts"
click node_signin "https://github.com/nitinj1212/paintings_web/blob/main/app/signin/page.tsx"
click node_signup "https://github.com/nitinj1212/paintings_web/blob/main/app/signup/page.tsx"
click node_auth_forms "https://github.com/nitinj1212/paintings_web/blob/main/components/auth/SignInForm.tsx"
click node_auth_api "https://github.com/nitinj1212/paintings_web/blob/main/app/api/auth/route.js"
click node_auth_guard "https://github.com/nitinj1212/paintings_web/blob/main/lib/auth-server.ts"
click node_session "https://github.com/nitinj1212/paintings_web/blob/main/lib/session.ts"
click node_artist_profile "https://github.com/nitinj1212/paintings_web/blob/main/app/api/artist/profile/route.ts"
click node_paintings_api "https://github.com/nitinj1212/paintings_web/blob/main/app/api/paintings/route.ts"
click node_painting_detail "https://github.com/nitinj1212/paintings_web/blob/main/app/api/paintings/%5Bid%5D/route.ts"
click node_likes_api "https://github.com/nitinj1212/paintings_web/blob/main/app/api/likes/route.ts"
click node_wishlist_api "https://github.com/nitinj1212/paintings_web/blob/main/app/api/wishlists/route.ts"
click node_categories_api "https://github.com/nitinj1212/paintings_web/blob/main/app/api/categories/route.ts"
click node_mediums_api "https://github.com/nitinj1212/paintings_web/blob/main/app/api/mediums/route.ts"
click node_admin_users "https://github.com/nitinj1212/paintings_web/blob/main/app/api/admin/users/route.ts"
click node_supabase_client "https://github.com/nitinj1212/paintings_web/blob/main/utils/supabase/server.js"
click node_painting_data "https://github.com/nitinj1212/paintings_web/blob/main/data/paintings.ts"
click node_shuffle "https://github.com/nitinj1212/paintings_web/blob/main/lib/shuffleQueue.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_gallery,node_gallery_ui,node_painting_stage,node_painting_nav,node_emotion_picker,node_rating_repo,node_local_rating toneBlue
class node_signin,node_signup,node_auth_forms,node_auth_api,node_auth_guard,node_session toneAmber
class node_artist_profile,node_paintings_api,node_painting_detail,node_likes_api,node_wishlist_api,node_categories_api,node_mediums_api,node_admin_users toneMint
class node_supabase_client,node_supabase,node_painting_data,node_shuffle toneRose
class node_visitor,node_member,node_artist,node_admin toneIndigo
```

## Components

### Gallery experience

- [Home page](https://github.com/nitinj1212/paintings_web/blob/main/app/page.tsx): `app/page.tsx`
- [Gallery page](https://github.com/nitinj1212/paintings_web/blob/main/app/gallery/page.tsx): `app/gallery/page.tsx`
- [Gallery experience](https://github.com/nitinj1212/paintings_web/blob/main/components/GalleryExperience.tsx): `components/GalleryExperience.tsx`
- [Painting stage](https://github.com/nitinj1212/paintings_web/blob/main/components/PaintingStage.tsx): `components/PaintingStage.tsx`
- [Painting navigation](https://github.com/nitinj1212/paintings_web/blob/main/components/PaintingNav.tsx): `components/PaintingNav.tsx`
- [Emotion picker](https://github.com/nitinj1212/paintings_web/blob/main/components/EmotionPicker.tsx): `components/EmotionPicker.tsx`
- [Rating repository](https://github.com/nitinj1212/paintings_web/blob/main/services/ratingRepository.ts): `services/ratingRepository.ts`
- [Local rating store](https://github.com/nitinj1212/paintings_web/blob/main/services/localRatingRepository.ts): `services/localRatingRepository.ts`

### Identity and roles

- [Sign-in page](https://github.com/nitinj1212/paintings_web/blob/main/app/signin/page.tsx): `app/signin/page.tsx`
- [Sign-up page](https://github.com/nitinj1212/paintings_web/blob/main/app/signup/page.tsx): `app/signup/page.tsx`
- [Auth forms](https://github.com/nitinj1212/paintings_web/blob/main/components/auth/SignInForm.tsx): `components/auth/SignInForm.tsx`
- [Auth API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/auth/route.js): `app/api/auth/route.js`
- [Auth guards](https://github.com/nitinj1212/paintings_web/blob/main/lib/auth-server.ts): `lib/auth-server.ts`
- [Session handling](https://github.com/nitinj1212/paintings_web/blob/main/lib/session.ts): `lib/session.ts`

### Artwork and catalog

- [Artist profiles](https://github.com/nitinj1212/paintings_web/blob/main/app/api/artist/profile/route.ts): `app/api/artist/profile/route.ts`
- [Painting catalog API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/paintings/route.ts): `app/api/paintings/route.ts`
- [Painting details API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/paintings/%5Bid%5D/route.ts): `app/api/paintings/[id]/route.ts`
- [Likes API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/likes/route.ts): `app/api/likes/route.ts`
- [Wishlists API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/wishlists/route.ts): `app/api/wishlists/route.ts`
- [Categories API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/categories/route.ts): `app/api/categories/route.ts`
- [Mediums API](https://github.com/nitinj1212/paintings_web/blob/main/app/api/mediums/route.ts): `app/api/mediums/route.ts`
- [User administration](https://github.com/nitinj1212/paintings_web/blob/main/app/api/admin/users/route.ts): `app/api/admin/users/route.ts`

### Data access

- [Server client](https://github.com/nitinj1212/paintings_web/blob/main/utils/supabase/server.js): `utils/supabase/server.js`
- **Supabase data service**
- [Painting data](https://github.com/nitinj1212/paintings_web/blob/main/data/paintings.ts): `data/paintings.ts`
- [Shuffle queue](https://github.com/nitinj1212/paintings_web/blob/main/lib/shuffleQueue.ts): `lib/shuffleQueue.ts`

### Other components

- **Visitor**
- **Signed-in member**
- **Artist**
- **Super admin**

## Connections

- Visitor → Home page: opens
- Visitor → Gallery page: browses
- Signed-in member → Sign-in page: signs in
- Signed-in member → Sign-up page: registers
- Artist → Painting catalog API: uploads
- Artist → Artist profiles: manages profile
- Super admin → User administration: administers
- Gallery page → Gallery experience: renders
- Gallery experience → Painting stage: presents
- Gallery experience → Painting navigation: offers navigation
- Gallery experience → Emotion picker: offers emotion choice
- Sign-in page → Auth forms: renders
- Sign-up page → Auth forms: uses form
- Auth forms → Auth API: submits
- Auth API → Server client: creates client
- Auth guards → Server client: creates client
- Painting catalog API → Auth guards: checks artist role
- Painting details API → Auth guards: checks user
- Likes API → Auth guards: requires user
- Wishlists API → Auth guards: requires user
- Artist profiles → Auth guards: requires user
- Categories API → Auth guards: checks admin role
- Mediums API → Auth guards: checks admin role
- User administration → Auth guards: checks admin role
- Painting catalog API → Server client: creates client
- Painting details API → Server client: creates client
- Likes API → Server client: creates client
- Wishlists API → Server client: creates client
- Artist profiles → Server client: creates client
- Categories API → Server client: creates client
- Mediums API → Server client: creates client
- User administration → Server client: creates client
- Server client → Supabase data service: queries and writes
- Gallery experience → Rating repository
- Rating repository → Local rating store
