# gunuzello/nocturne architecture

> Architecture diagram of the GitHub repository gunuzello/nocturne, 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/gunuzello/nocturne
- Repository: https://github.com/gunuzello/nocturne

## Overview

Nocturne is a community platform for discovering and sharing Seoul night-view spots. Visitors browse and filter spots on a map or open details; registered users can submit and manage spots, upload photos, and interact through comments, likes, and bookmarks. The frontend’s API client connects those experiences to Express routes, handlers, and SQLite-backed models. The graph preserves documented features whose implementation excerpts were incomplete; those links cite the README or SOURCE INDEX, rather than implying unsampled code was inspected.

Main entry points: [`server/routes/spots.js`](https://github.com/gunuzello/nocturne/blob/main/server/routes/spots.js) (Spot routes), [`client/js/api.js`](https://github.com/gunuzello/nocturne/blob/main/client/js/api.js) (API client), [`client/index.html`](https://github.com/gunuzello/nocturne/blob/main/client/index.html) (Static client), [`server/db/database.js`](https://github.com/gunuzello/nocturne/blob/main/server/db/database.js) (SQLite database)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web experience"]
  node_client["Static client<br/>[index.html]"]
  node_map["Spot map<br/>[map.js]"]
  node_detail["Spot details<br/>[spotDetail.js]"]
  node_submit["Spot submission<br/>[postSpot.js]"]
  node_myspots["My spots<br/>[mySpots.js]"]
  node_bookmarksui["Saved spots<br/>[bookmarks.js]"]
  node_commentsui["Comment thread<br/>[commentThread.js]"]
  node_authui["Account forms<br/>[auth.js]"]
  node_apiui["API client<br/>[api.js]"]
end

subgraph group_api["API and identity"]
  node_app["Express app<br/>[app.js]"]
  node_spotroutes["Spot routes<br/>[spots.js]"]
  node_authroutes["Auth routes<br/>[auth.js]"]
  node_userroutes["User routes<br/>[users.js]"]
  node_authhandler["Auth handlers<br/>[authController.js]"]
  node_authmw["JWT verification<br/>[auth.js]"]
end

subgraph group_domain["Spot interactions"]
  node_spotshandler["Spot handlers<br/>[spotsController.js]"]
  node_commentshandler["Comment handlers"]
  node_likeshandler["Like handlers<br/>[likesController.js]"]
  node_bookmarkshandler["Bookmark handlers"]
end

subgraph group_storage["Persistence"]
  node_spotsmodel["Spot data access<br/>[spots.js]"]
  node_commentsmodel["Comment data access<br/>[comments.js]"]
  node_likesmodel["Like data access<br/>[likes.js]"]
  node_bookmarksmodel["Bookmark data access<br/>[bookmarks.js]"]
  node_usersmodel["User data access<br/>[users.js]"]
  node_photosmodel["Photo data access<br/>[photos.js]"]
  node_sqlite[("SQLite database<br/>[database.js]")]
end

node_visitor(("Visitor"))
node_kakao["Kakao Maps"]

node_visitor -->|"browses"| node_client
node_client -->|"opens map"| node_map
node_client -->|"opens details"| node_detail
node_client -->|"submits spots"| node_submit
node_client -->|"manages spots"| node_myspots
node_client -->|"views saved"| node_bookmarksui
node_detail -->|"renders thread"| node_commentsui
node_map -.->|"renders map"| node_kakao
node_map -->|"requests spots"| node_apiui
node_detail -->|"loads details"| node_apiui
node_submit -->|"creates spots"| node_apiui
node_myspots -->|"manages spots"| node_apiui
node_bookmarksui -->|"loads bookmarks"| node_apiui
node_commentsui -->|"requests comments"| node_apiui
node_authui -->|"authenticates"| node_apiui
node_apiui -->|"sends API requests"| node_app
node_app -->|"mounts routes"| node_spotroutes
node_app -->|"mounts routes"| node_authroutes
node_app -->|"mounts routes"| node_userroutes
node_authroutes -->|"dispatches"| node_authhandler
node_spotroutes -->|"guards writes"| node_authmw
node_authmw -->|"checks user"| node_usersmodel
node_authhandler -->|"reads and creates"| node_usersmodel
node_spotroutes -->|"dispatches"| node_spotshandler
node_spotroutes -->|"dispatches"| node_commentshandler
node_spotroutes -->|"dispatches"| node_likeshandler
node_spotroutes -->|"dispatches"| node_bookmarkshandler
node_spotroutes -->|"reads and updates"| node_spotsmodel
node_spotroutes -->|"stores uploads"| node_photosmodel
node_userroutes -->|"lists user spots"| node_spotsmodel
node_userroutes -->|"lists likes"| node_likesmodel
node_userroutes -->|"lists bookmarks"| node_bookmarksmodel
node_commentshandler -->|"reads and writes"| node_commentsmodel
node_likeshandler -->|"manages likes"| node_likesmodel
node_bookmarkshandler -->|"manages bookmarks"| node_bookmarksmodel
node_spotshandler -->|"manages spots"| node_spotsmodel
node_spotsmodel -->|"queries"| node_sqlite
node_commentsmodel -->|"queries"| node_sqlite
node_likesmodel -->|"queries"| node_sqlite
node_bookmarksmodel -->|"queries"| node_sqlite
node_usersmodel -->|"queries"| node_sqlite
node_photosmodel -->|"queries"| node_sqlite

click node_client "https://github.com/gunuzello/nocturne/blob/main/client/index.html"
click node_map "https://github.com/gunuzello/nocturne/blob/main/client/js/map.js"
click node_detail "https://github.com/gunuzello/nocturne/blob/main/client/js/spotDetail.js"
click node_submit "https://github.com/gunuzello/nocturne/blob/main/client/js/postSpot.js"
click node_myspots "https://github.com/gunuzello/nocturne/blob/main/client/js/mySpots.js"
click node_bookmarksui "https://github.com/gunuzello/nocturne/blob/main/client/js/bookmarks.js"
click node_commentsui "https://github.com/gunuzello/nocturne/blob/main/client/js/commentThread.js"
click node_authui "https://github.com/gunuzello/nocturne/blob/main/client/js/auth.js"
click node_apiui "https://github.com/gunuzello/nocturne/blob/main/client/js/api.js"
click node_app "https://github.com/gunuzello/nocturne/blob/main/server/app.js"
click node_spotroutes "https://github.com/gunuzello/nocturne/blob/main/server/routes/spots.js"
click node_authroutes "https://github.com/gunuzello/nocturne/blob/main/server/routes/auth.js"
click node_userroutes "https://github.com/gunuzello/nocturne/blob/main/server/routes/users.js"
click node_authhandler "https://github.com/gunuzello/nocturne/blob/main/server/controllers/authController.js"
click node_authmw "https://github.com/gunuzello/nocturne/blob/main/server/middleware/auth.js"
click node_spotshandler "https://github.com/gunuzello/nocturne/blob/main/server/controllers/spotsController.js"
click node_commentshandler "https://github.com/gunuzello/nocturne/blob/main/server/controllers/commentsController.js"
click node_likeshandler "https://github.com/gunuzello/nocturne/blob/main/server/controllers/likesController.js"
click node_bookmarkshandler "https://github.com/gunuzello/nocturne/blob/main/server/controllers/bookmarksController.js"
click node_spotsmodel "https://github.com/gunuzello/nocturne/blob/main/server/models/spots.js"
click node_commentsmodel "https://github.com/gunuzello/nocturne/blob/main/server/models/comments.js"
click node_likesmodel "https://github.com/gunuzello/nocturne/blob/main/server/models/likes.js"
click node_bookmarksmodel "https://github.com/gunuzello/nocturne/blob/main/server/models/bookmarks.js"
click node_usersmodel "https://github.com/gunuzello/nocturne/blob/main/server/models/users.js"
click node_photosmodel "https://github.com/gunuzello/nocturne/blob/main/server/models/photos.js"
click node_sqlite "https://github.com/gunuzello/nocturne/blob/main/server/db/database.js"

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_client,node_map,node_detail,node_submit,node_myspots,node_bookmarksui,node_commentsui,node_authui,node_apiui toneBlue
class node_app,node_spotroutes,node_authroutes,node_userroutes,node_authhandler,node_authmw toneAmber
class node_spotshandler,node_commentshandler,node_likeshandler,node_bookmarkshandler toneMint
class node_spotsmodel,node_commentsmodel,node_likesmodel,node_bookmarksmodel,node_usersmodel,node_photosmodel,node_sqlite toneRose
class node_visitor,node_kakao toneIndigo
```

## Components

### Web experience

- [Static client](https://github.com/gunuzello/nocturne/blob/main/client/index.html): `client/index.html`
- [Spot map](https://github.com/gunuzello/nocturne/blob/main/client/js/map.js): `client/js/map.js`
- [Spot details](https://github.com/gunuzello/nocturne/blob/main/client/js/spotDetail.js): `client/js/spotDetail.js`
- [Spot submission](https://github.com/gunuzello/nocturne/blob/main/client/js/postSpot.js): `client/js/postSpot.js`
- [My spots](https://github.com/gunuzello/nocturne/blob/main/client/js/mySpots.js): `client/js/mySpots.js`
- [Saved spots](https://github.com/gunuzello/nocturne/blob/main/client/js/bookmarks.js): `client/js/bookmarks.js`
- [Comment thread](https://github.com/gunuzello/nocturne/blob/main/client/js/commentThread.js): `client/js/commentThread.js`
- [Account forms](https://github.com/gunuzello/nocturne/blob/main/client/js/auth.js): `client/js/auth.js`
- [API client](https://github.com/gunuzello/nocturne/blob/main/client/js/api.js): `client/js/api.js`

### API and identity

- [Express app](https://github.com/gunuzello/nocturne/blob/main/server/app.js): `server/app.js`
- [Spot routes](https://github.com/gunuzello/nocturne/blob/main/server/routes/spots.js): `server/routes/spots.js`
- [Auth routes](https://github.com/gunuzello/nocturne/blob/main/server/routes/auth.js): `server/routes/auth.js`
- [User routes](https://github.com/gunuzello/nocturne/blob/main/server/routes/users.js): `server/routes/users.js`
- [Auth handlers](https://github.com/gunuzello/nocturne/blob/main/server/controllers/authController.js): `server/controllers/authController.js`
- [JWT verification](https://github.com/gunuzello/nocturne/blob/main/server/middleware/auth.js): `server/middleware/auth.js`

### Spot interactions

- [Spot handlers](https://github.com/gunuzello/nocturne/blob/main/server/controllers/spotsController.js): `server/controllers/spotsController.js`
- [Comment handlers](https://github.com/gunuzello/nocturne/blob/main/server/controllers/commentsController.js): `server/controllers/commentsController.js`
- [Like handlers](https://github.com/gunuzello/nocturne/blob/main/server/controllers/likesController.js): `server/controllers/likesController.js`
- [Bookmark handlers](https://github.com/gunuzello/nocturne/blob/main/server/controllers/bookmarksController.js): `server/controllers/bookmarksController.js`

### Persistence

- [Spot data access](https://github.com/gunuzello/nocturne/blob/main/server/models/spots.js): `server/models/spots.js`
- [Comment data access](https://github.com/gunuzello/nocturne/blob/main/server/models/comments.js): `server/models/comments.js`
- [Like data access](https://github.com/gunuzello/nocturne/blob/main/server/models/likes.js): `server/models/likes.js`
- [Bookmark data access](https://github.com/gunuzello/nocturne/blob/main/server/models/bookmarks.js): `server/models/bookmarks.js`
- [User data access](https://github.com/gunuzello/nocturne/blob/main/server/models/users.js): `server/models/users.js`
- [Photo data access](https://github.com/gunuzello/nocturne/blob/main/server/models/photos.js): `server/models/photos.js`
- [SQLite database](https://github.com/gunuzello/nocturne/blob/main/server/db/database.js): `server/db/database.js`

### Other components

- **Visitor**
- **Kakao Maps**

## Connections

- Visitor → Static client: browses (evidence: `README.md`)
- Static client → Spot map: opens map (evidence: `README.md`)
- Static client → Spot details: opens details (evidence: `README.md`)
- Static client → Spot submission: submits spots (evidence: `README.md`)
- Static client → My spots: manages spots (evidence: `README.md`)
- Static client → Saved spots: views saved (evidence: `README.md`)
- Spot details → Comment thread: renders thread (evidence: `client/js/spotDetail.js`)
- Spot map → Kakao Maps: renders map (evidence: `README.md`)
- Spot map → API client: requests spots (evidence: `client/js/map.js`)
- Spot details → API client: loads details (evidence: `client/js/spotDetail.js`)
- Spot submission → API client: creates spots (evidence: `client/js/postSpot.js`)
- My spots → API client: manages spots (evidence: `client/js/mySpots.js`)
- Saved spots → API client: loads bookmarks (evidence: `client/js/bookmarks.js`)
- Comment thread → API client: requests comments (evidence: `client/js/commentThread.js`)
- Account forms → API client: authenticates (evidence: `client/js/auth.js`)
- API client → Express app: sends API requests (evidence: `README.md`)
- Express app → Spot routes: mounts routes (evidence: `server/app.js`)
- Express app → Auth routes: mounts routes (evidence: `server/app.js`)
- Express app → User routes: mounts routes (evidence: `server/app.js`)
- Auth routes → Auth handlers: dispatches (evidence: `server/routes/auth.js`)
- Spot routes → JWT verification: guards writes (evidence: `server/routes/spots.js`)
- JWT verification → User data access: checks user (evidence: `server/middleware/auth.js`)
- Auth handlers → User data access: reads and creates (evidence: `server/controllers/authController.js`)
- Spot routes → Spot handlers: dispatches (evidence: `server/routes/spots.js`)
- Spot routes → Comment handlers: dispatches (evidence: `server/routes/spots.js`)
- Spot routes → Like handlers: dispatches (evidence: `server/routes/spots.js`)
- Spot routes → Bookmark handlers: dispatches (evidence: `server/routes/spots.js`)
- Spot routes → Spot data access: reads and updates (evidence: `server/routes/spots.js`)
- Spot routes → Photo data access: stores uploads (evidence: `server/routes/spots.js`)
- User routes → Spot data access: lists user spots (evidence: `server/routes/users.js`)
- User routes → Like data access: lists likes (evidence: `server/routes/users.js`)
- User routes → Bookmark data access: lists bookmarks (evidence: `server/routes/users.js`)
- Comment handlers → Comment data access: reads and writes (evidence: `server/controllers/commentsController.js`)
- Like handlers → Like data access: manages likes (evidence: `server/controllers/likesController.js`)
- Bookmark handlers → Bookmark data access: manages bookmarks (evidence: `server/controllers/bookmarksController.js`)
- Spot handlers → Spot data access: manages spots (evidence: `server/controllers/spotsController.js`)
- Spot data access → SQLite database: queries (evidence: `server/models/spots.js`)
- Comment data access → SQLite database: queries (evidence: `server/models/comments.js`)
- Like data access → SQLite database: queries (evidence: `server/models/likes.js`)
- Bookmark data access → SQLite database: queries (evidence: `server/models/bookmarks.js`)
- User data access → SQLite database: queries (evidence: `server/models/users.js`)
- Photo data access → SQLite database: queries (evidence: `server/models/photos.js`)
