# tusharpawar1241/solar-scope architecture

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

- Interactive diagram: https://gitdiagram.com/tusharpawar1241/solar-scope
- Repository: https://github.com/tusharpawar1241/solar-scope

## Overview

SolarScope is a React solar-system experience with a blog and account features, backed by an Express API. The visible user journey is route selection into the home, blog, login, or admin interface; the backend exposes registration/login and blog read/write endpoints, with JWT and ownership checks for protected actions. The tree also indicates a solar visualization and admin area, but their internals and frontend API wiring were not sampled, so those links remain unverified or are omitted.

Main entry points: [`src/App.jsx`](https://github.com/tusharpawar1241/solar-scope/blob/main/src/App.jsx) (Route shell), [`backend/routes/blogRoutes.js`](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/routes/blogRoutes.js) (Blog routes), [`backend/server.js`](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/server.js) (HTTP server), [`src/assets/components/Home/Home.jsx`](https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Home/Home.jsx) (Solar home)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_app["Route shell<br/>[App.jsx]"]
  node_home["Solar home<br/>[Home.jsx]"]
  node_planets["Planet scenes"]
  node_blogui["Blog interface<br/>[BlogPage.jsx]"]
  node_loginui["Login interface<br/>[LoginPage.jsx]"]
  node_adminui["Admin portal<br/>[AdminPanel.jsx]"]
end

subgraph group_client["API client"]
  node_authclient["Auth API client<br/>[auth.js]"]
  node_blogclient["Blog API client<br/>[blogs.js]"]
end

subgraph group_api["Backend API"]
  node_server["HTTP server<br/>[server.js]"]
  node_authroutes["Auth routes<br/>[authRoutes.js]"]
  node_authcontroller["Auth logic<br/>[authController.js]"]
  node_authmiddleware["JWT guard<br/>[requireAuth.js]"]
  node_blogroutes["Blog routes<br/>[blogRoutes.js]"]
  node_ownership["Ownership guard"]
  node_blogcontroller["Blog logic<br/>[blogController.js]"]
end

subgraph group_data["Persistence"]
  node_users[("User records<br/>[User.js]")]
  node_blogs[("Blog records<br/>[Blog.js]")]
end

node_visitor(("Visitor"))
node_mongodb[("MongoDB")]

node_visitor -.->|"opens"| node_app
node_app -->|"routes to"| node_home
node_app -->|"routes to"| node_blogui
node_app -->|"routes to"| node_loginui
node_app -->|"guards route"| node_adminui
node_home -.->|"renders"| node_planets
node_loginui -.->|"uses"| node_authclient
node_blogui -.->|"uses"| node_blogclient
node_server -->|"mounts"| node_authroutes
node_server -->|"mounts"| node_blogroutes
node_authroutes -->|"dispatches"| node_authcontroller
node_authcontroller -->|"reads and writes"| node_users
node_blogroutes -->|"guards writes"| node_authmiddleware
node_blogroutes -->|"guards edits"| node_ownership
node_blogroutes -->|"dispatches"| node_blogcontroller
node_ownership -->|"loads post"| node_blogs
node_blogcontroller -->|"reads and writes"| node_blogs
node_server -->|"connects"| node_mongodb

click node_app "https://github.com/tusharpawar1241/solar-scope/blob/main/src/App.jsx"
click node_home "https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Home/Home.jsx"
click node_planets "https://github.com/tusharpawar1241/solar-scope/tree/main/src/assets/components/Home/planets"
click node_blogui "https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Blogs/BlogPage.jsx"
click node_loginui "https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Login/LoginPage.jsx"
click node_adminui "https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Admin/AdminPanel.jsx"
click node_authclient "https://github.com/tusharpawar1241/solar-scope/blob/main/src/lib/api/auth.js"
click node_blogclient "https://github.com/tusharpawar1241/solar-scope/blob/main/src/lib/api/blogs.js"
click node_server "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/server.js"
click node_authroutes "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/routes/authRoutes.js"
click node_authcontroller "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/controllers/authController.js"
click node_authmiddleware "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/middleware/requireAuth.js"
click node_blogroutes "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/routes/blogRoutes.js"
click node_ownership "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/middleware/requireOwnership.js"
click node_blogcontroller "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/controllers/blogController.js"
click node_users "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/models/User.js"
click node_blogs "https://github.com/tusharpawar1241/solar-scope/blob/main/backend/models/Blog.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_app,node_home,node_planets,node_blogui,node_loginui,node_adminui toneBlue
class node_authclient,node_blogclient,node_mongodb toneAmber
class node_server,node_authroutes,node_authcontroller,node_authmiddleware,node_blogroutes,node_ownership,node_blogcontroller toneMint
class node_users,node_blogs toneRose
class node_visitor toneIndigo
```

## Components

### Web experience

- [Route shell](https://github.com/tusharpawar1241/solar-scope/blob/main/src/App.jsx): `src/App.jsx`
- [Solar home](https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Home/Home.jsx): `src/assets/components/Home/Home.jsx`
- [Planet scenes](https://github.com/tusharpawar1241/solar-scope/tree/main/src/assets/components/Home/planets): `src/assets/components/Home/planets`
- [Blog interface](https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Blogs/BlogPage.jsx): `src/assets/components/Blogs/BlogPage.jsx`
- [Login interface](https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Login/LoginPage.jsx): `src/assets/components/Login/LoginPage.jsx`
- [Admin portal](https://github.com/tusharpawar1241/solar-scope/blob/main/src/assets/components/Admin/AdminPanel.jsx): `src/assets/components/Admin/AdminPanel.jsx`

### API client

- [Auth API client](https://github.com/tusharpawar1241/solar-scope/blob/main/src/lib/api/auth.js): `src/lib/api/auth.js`
- [Blog API client](https://github.com/tusharpawar1241/solar-scope/blob/main/src/lib/api/blogs.js): `src/lib/api/blogs.js`

### Backend API

- [HTTP server](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/server.js): `backend/server.js`
- [Auth routes](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/routes/authRoutes.js): `backend/routes/authRoutes.js`
- [Auth logic](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/controllers/authController.js): `backend/controllers/authController.js`
- [JWT guard](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/middleware/requireAuth.js): `backend/middleware/requireAuth.js`
- [Blog routes](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/routes/blogRoutes.js): `backend/routes/blogRoutes.js`
- [Ownership guard](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/middleware/requireOwnership.js): `backend/middleware/requireOwnership.js`
- [Blog logic](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/controllers/blogController.js): `backend/controllers/blogController.js`

### Persistence

- [User records](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/models/User.js): `backend/models/User.js`
- [Blog records](https://github.com/tusharpawar1241/solar-scope/blob/main/backend/models/Blog.js): `backend/models/Blog.js`

### Other components

- **Visitor**
- **MongoDB**

## Connections

- Visitor → Route shell: opens
- Route shell → Solar home: routes to (evidence: `src/App.jsx`)
- Route shell → Blog interface: routes to (evidence: `src/App.jsx`)
- Route shell → Login interface: routes to (evidence: `src/App.jsx`)
- Route shell → Admin portal: guards route (evidence: `src/App.jsx`)
- Solar home → Planet scenes: renders
- Login interface → Auth API client: uses
- Blog interface → Blog API client: uses
- HTTP server → Auth routes: mounts (evidence: `backend/server.js`)
- HTTP server → Blog routes: mounts (evidence: `backend/server.js`)
- Auth routes → Auth logic: dispatches (evidence: `backend/routes/authRoutes.js`)
- Auth logic → User records: reads and writes (evidence: `backend/controllers/authController.js`)
- Blog routes → JWT guard: guards writes (evidence: `backend/routes/blogRoutes.js`)
- Blog routes → Ownership guard: guards edits (evidence: `backend/routes/blogRoutes.js`)
- Blog routes → Blog logic: dispatches (evidence: `backend/routes/blogRoutes.js`)
- Ownership guard → Blog records: loads post (evidence: `backend/middleware/requireOwnership.js`)
- Blog logic → Blog records: reads and writes (evidence: `backend/controllers/blogController.js`)
- HTTP server → MongoDB: connects (evidence: `backend/server.js`)
