# naritsarkkinen/moviebus architecture

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

- Interactive diagram: https://gitdiagram.com/naritsarkkinen/moviebus
- Repository: https://github.com/naritsarkkinen/moviebus

## Overview

MovieVerse is a browser-based social movie world: users explore searchable movie zones, view titles, rate and review films, customize profiles, and interact in simulated friend/community sessions. The React page coordinates catalogue, feedback, profile, navigation, and social hooks; API helpers can connect it to the Express/PostgreSQL starter backend, while the README says the demo currently relies on local sample data. The graph preserves the admin review dashboard and XP leaderboard as separate capabilities. Relationships reflect shown imports, routes, and calls; where wiring is documented only as a future integration, it is marked optional.

Main entry points: [`Frontend/src/pages/MovieVersePage.jsx`](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/MovieVersePage.jsx) (World page), [`Frontend/src/api/client.js`](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/client.js) (HTTP client), [`Backend/index.js`](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/index.js) (Express API), [`Backend/routes/movieRoutes.js`](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/movieRoutes.js) (Movie routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["World experience"]
  node_movie_page["World page<br/>[MovieVersePage.jsx]"]
  node_world["Movie world"]
  node_catalogue["Movie catalogue"]
  node_search["Movie search"]
  node_world_layout["World layout data"]
  node_movie_data["Sample movie data<br/>[MovieVerseData.js]"]
  node_popups["Movie dialogs"]
  node_movie_catalogue_hook["Catalogue state"]
  node_feedback_hook["Rating and review state"]
  node_profile_hook["Profile editor"]
end

subgraph group_social["Social features"]
  node_friends_hook["Friend sessions<br/>[useFriends.js]"]
  node_friends_panel["Friends panel"]
  node_party_reviews["Party reviews"]
  node_shared_review["Shared review"]
  node_leaderboard["XP leaderboard"]
  node_admin["Admin reviews<br/>[AdminDashboard.jsx]"]
end

subgraph group_frontend_services["Frontend services"]
  node_api_client["HTTP client<br/>[client.js]"]
  node_reviews_api["Review API<br/>[reviews.js]"]
  node_movies_api["Movie API<br/>[movies.js]"]
  node_communities_api["Communities API<br/>[communities.js]"]
  node_users_api["Users API<br/>[users.js]"]
end

subgraph group_api["Backend API"]
  node_backend["Express API<br/>[index.js]"]
  node_auth_routes["Authentication routes<br/>[authRoutes.js]"]
  node_auth_controller["Account handling<br/>[authController.js]"]
  node_movie_routes["Movie routes<br/>[movieRoutes.js]"]
  node_movie_controller["Movie queries<br/>[movieController.js]"]
  node_review_routes["Review routes<br/>[reviewRoutes.js]"]
  node_review_controller["Review handling"]
  node_rating_controller["Rating handling"]
  node_user_routes["User routes<br/>[userRoutes.js]"]
  node_user_controller["Profile handling<br/>[userController.js]"]
  node_community_routes["Community routes<br/>[communityRoutes.js]"]
  node_community_controller["Community handling"]
end

subgraph group_persistence["Persistence"]
end

node_visitor(("MovieVerse user"))

node_visitor -->|"explores"| node_movie_page
node_movie_page -->|"renders"| node_world
node_movie_page -->|"uses layout"| node_world_layout
node_movie_page -->|"uses samples"| node_movie_data
node_movie_page -->|"uses state"| node_movie_catalogue_hook
node_movie_page -->|"uses state"| node_feedback_hook
node_movie_page -->|"uses editor"| node_profile_hook
node_movie_page -->|"uses sessions"| node_friends_hook
node_movie_page -->|"loads reviews"| node_party_reviews
node_world -.->|"renders"| node_catalogue
node_catalogue -.->|"renders"| node_search
node_movie_page -.->|"renders"| node_popups
node_movie_catalogue_hook -->|"requests movies"| node_movies_api
node_movie_catalogue_hook -->|"requests communities"| node_communities_api
node_party_reviews -->|"fetches reviews"| node_reviews_api
node_friends_hook -->|"reads samples"| node_movie_data
node_friends_panel -.->|"uses sessions"| node_friends_hook
node_shared_review -.->|"shows reviews"| node_party_reviews
node_visitor -.->|"manages reviews"| node_admin
node_admin -.->|"uses review API"| node_api_client
node_reviews_api -->|"sends requests"| node_api_client
node_movies_api -->|"sends requests"| node_api_client
node_communities_api -->|"sends requests"| node_api_client
node_users_api -.->|"sends requests"| node_api_client
node_api_client -.->|"calls API"| node_backend
node_backend -->|"mounts routes"| node_auth_routes
node_backend -->|"mounts routes"| node_movie_routes
node_backend -->|"mounts routes"| node_community_routes
node_auth_routes -->|"dispatches"| node_auth_controller
node_movie_routes -->|"dispatches"| node_movie_controller
node_movie_routes -->|"dispatches"| node_review_controller
node_movie_routes -->|"dispatches"| node_rating_controller
node_review_routes -->|"dispatches"| node_review_controller
node_user_routes -->|"dispatches"| node_user_controller
node_user_routes -->|"dispatches"| node_review_controller
node_community_routes -->|"dispatches"| node_community_controller

click node_movie_page "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/MovieVersePage.jsx"
click node_world "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseWorld.jsx"
click node_catalogue "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseCatalogue.jsx"
click node_search "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseSearch.jsx"
click node_world_layout "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/data/MovieVerseWorldLayout.js"
click node_movie_data "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/data/MovieVerseData.js"
click node_popups "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/MovieVersePopups.jsx"
click node_movie_catalogue_hook "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useMovieCatalogue.js"
click node_feedback_hook "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useMovieFeedback.js"
click node_profile_hook "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useProfileEditor.js"
click node_friends_hook "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useFriends.js"
click node_friends_panel "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseFriendsPanel.jsx"
click node_party_reviews "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/usePartyUserReviews.js"
click node_shared_review "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseSharedReview.jsx"
click node_leaderboard "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseXpLeaderboard.jsx"
click node_admin "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/AdminDashboard.jsx"
click node_api_client "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/client.js"
click node_reviews_api "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/reviews.js"
click node_movies_api "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/movies.js"
click node_communities_api "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/communities.js"
click node_users_api "https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/users.js"
click node_backend "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/index.js"
click node_auth_routes "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/authRoutes.js"
click node_auth_controller "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/authController.js"
click node_movie_routes "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/movieRoutes.js"
click node_movie_controller "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/movieController.js"
click node_review_routes "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/reviewRoutes.js"
click node_review_controller "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/reviewController.js"
click node_rating_controller "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/ratingController.js"
click node_user_routes "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/userRoutes.js"
click node_user_controller "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/userController.js"
click node_community_routes "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/communityRoutes.js"
click node_community_controller "https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/communityController.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_movie_page,node_world,node_catalogue,node_search,node_world_layout,node_movie_data,node_popups,node_movie_catalogue_hook,node_feedback_hook,node_profile_hook,node_visitor toneBlue
class node_friends_hook,node_friends_panel,node_party_reviews,node_shared_review,node_leaderboard,node_admin toneAmber
class node_api_client,node_reviews_api,node_movies_api,node_communities_api,node_users_api toneMint
class node_backend,node_auth_routes,node_auth_controller,node_movie_routes,node_movie_controller,node_review_routes,node_review_controller,node_rating_controller,node_user_routes,node_user_controller,node_community_routes,node_community_controller toneRose
```

## Components

### World experience

- [World page](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/MovieVersePage.jsx): `Frontend/src/pages/MovieVersePage.jsx`
- [Movie world](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseWorld.jsx): `Frontend/src/components/MovieVerseWorld.jsx`
- [Movie catalogue](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseCatalogue.jsx): `Frontend/src/components/MovieVerseCatalogue.jsx`
- [Movie search](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseSearch.jsx): `Frontend/src/components/MovieVerseSearch.jsx`
- [World layout data](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/data/MovieVerseWorldLayout.js): `Frontend/src/data/MovieVerseWorldLayout.js`
- [Sample movie data](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/data/MovieVerseData.js): `Frontend/src/data/MovieVerseData.js`
- [Movie dialogs](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/MovieVersePopups.jsx): `Frontend/src/pages/MovieVersePopups.jsx`
- [Catalogue state](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useMovieCatalogue.js): `Frontend/src/hooks/useMovieCatalogue.js`
- [Rating and review state](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useMovieFeedback.js): `Frontend/src/hooks/useMovieFeedback.js`
- [Profile editor](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useProfileEditor.js): `Frontend/src/hooks/useProfileEditor.js`

### Social features

- [Friend sessions](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/useFriends.js): `Frontend/src/hooks/useFriends.js`
- [Friends panel](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseFriendsPanel.jsx): `Frontend/src/components/MovieVerseFriendsPanel.jsx`
- [Party reviews](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/hooks/usePartyUserReviews.js): `Frontend/src/hooks/usePartyUserReviews.js`
- [Shared review](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseSharedReview.jsx): `Frontend/src/components/MovieVerseSharedReview.jsx`
- [XP leaderboard](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/components/MovieVerseXpLeaderboard.jsx): `Frontend/src/components/MovieVerseXpLeaderboard.jsx`
- [Admin reviews](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/pages/AdminDashboard.jsx): `Frontend/src/pages/AdminDashboard.jsx`

### Frontend services

- [HTTP client](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/client.js): `Frontend/src/api/client.js`
- [Review API](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/reviews.js): `Frontend/src/api/reviews.js`
- [Movie API](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/movies.js): `Frontend/src/api/movies.js`
- [Communities API](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/communities.js): `Frontend/src/api/communities.js`
- [Users API](https://github.com/naritsarkkinen/moviebus/blob/main/Frontend/src/api/users.js): `Frontend/src/api/users.js`

### Backend API

- [Express API](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/index.js): `Backend/index.js`
- [Authentication routes](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/authRoutes.js): `Backend/routes/authRoutes.js`
- [Account handling](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/authController.js): `Backend/controllers/authController.js`
- [Movie routes](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/movieRoutes.js): `Backend/routes/movieRoutes.js`
- [Movie queries](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/movieController.js): `Backend/controllers/movieController.js`
- [Review routes](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/reviewRoutes.js): `Backend/routes/reviewRoutes.js`
- [Review handling](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/reviewController.js): `Backend/controllers/reviewController.js`
- [Rating handling](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/ratingController.js): `Backend/controllers/ratingController.js`
- [User routes](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/userRoutes.js): `Backend/routes/userRoutes.js`
- [Profile handling](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/userController.js): `Backend/controllers/userController.js`
- [Community routes](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/routes/communityRoutes.js): `Backend/routes/communityRoutes.js`
- [Community handling](https://github.com/naritsarkkinen/moviebus/blob/main/Backend/controllers/communityController.js): `Backend/controllers/communityController.js`

### Other components

- **MovieVerse user**

## Connections

- MovieVerse user → World page: explores (evidence: `README.md`)
- World page → Movie world: renders (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → World layout data: uses layout (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → Sample movie data: uses samples (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → Catalogue state: uses state (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → Rating and review state: uses state (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → Profile editor: uses editor (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → Friend sessions: uses sessions (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- World page → Party reviews: loads reviews (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- Movie world → Movie catalogue: renders
- Movie catalogue → Movie search: renders
- World page → Movie dialogs: renders (evidence: `Frontend/src/pages/MovieVersePage.jsx`)
- Catalogue state → Movie API: requests movies (evidence: `Frontend/src/hooks/useMovieCatalogue.js`)
- Catalogue state → Communities API: requests communities (evidence: `Frontend/src/hooks/useMovieCatalogue.js`)
- Party reviews → Review API: fetches reviews (evidence: `Frontend/src/hooks/usePartyUserReviews.js`)
- Friend sessions → Sample movie data: reads samples (evidence: `Frontend/src/hooks/useFriends.js`)
- Friends panel → Friend sessions: uses sessions
- Shared review → Party reviews: shows reviews
- MovieVerse user → Admin reviews: manages reviews
- Admin reviews → HTTP client: uses review API
- Review API → HTTP client: sends requests (evidence: `Frontend/src/api/reviews.js`)
- Movie API → HTTP client: sends requests
- Communities API → HTTP client: sends requests
- Users API → HTTP client: sends requests
- HTTP client → Express API: calls API (evidence: `README.md`)
- Express API → Authentication routes: mounts routes (evidence: `Backend/index.js`)
- Express API → Movie routes: mounts routes (evidence: `Backend/index.js`)
- Express API → Community routes: mounts routes (evidence: `Backend/index.js`)
- Authentication routes → Account handling: dispatches (evidence: `Backend/routes/authRoutes.js`)
- Movie routes → Movie queries: dispatches (evidence: `Backend/routes/movieRoutes.js`)
- Movie routes → Review handling: dispatches (evidence: `Backend/routes/movieRoutes.js`)
- Movie routes → Rating handling: dispatches (evidence: `Backend/routes/movieRoutes.js`)
- Review routes → Review handling: dispatches (evidence: `Backend/routes/reviewRoutes.js`)
- User routes → Profile handling: dispatches (evidence: `Backend/routes/userRoutes.js`)
- User routes → Review handling: dispatches (evidence: `Backend/routes/userRoutes.js`)
- Community routes → Community handling: dispatches (evidence: `Backend/routes/communityRoutes.js`)
