# sankar1912/journal.frontend architecture

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

- Interactive diagram: https://gitdiagram.com/sankar1912/journal.frontend
- Repository: https://github.com/sankar1912/journal.frontend

## Overview

1. **Overall shape**
This is a **Next.js App Router** application for a scholarly journal / manuscript submission platform. The architecture is split between:
- route-level page modules under `src/app`
- reusable feature components under `src/components`
- global client state in `src/redux`
- lightweight route protection wrappers in `src/routes`
- theming/context/hooks for cross-cutting concerns

2. **Top-level shells and routing**
`src/app/layout.jsx` and `src/app/provider.jsx` define the app-wide shell and providers. The route tree is organized by feature rather than by technical layer, with dedicated sections for:
- home/landing (`src/app/page.jsx`)
- journals (`src/app/journal/...`)
- search (`src/app/search`)
- authentication (`signin`, `signup`, `signout`, password reset/forgot)
- user profile and verification (`src/app/user/...`)
- not-found handling

This makes route structure itself a major architectural boundary.

3. **Public-facing landing / marketing area**
The landing page uses components in `src/components/lander` and related shared components like `Header`, `Footer`, `ThemeToggle`, and `Main`. This area appears to be a promotional entry point for the journal platform, with visually rich sections such as hero content, sketches, cards, and journal/author highlights. The `public/static/img` assets support this presentation layer.

4. **Journal domain**
The `journal` route family is the core domain area. It includes:
- journal overview pages
- per-journal submission entry points
- manuscript submission workflow
- management/admin views
- submissions listing views

The corresponding feature components live in `src/components/journals`, including journal article lists, submission redirects, manage editors, and manage submissions. The route structure suggests a nested journal ID boundary: each journal instance has its own pages, actions, and permissions.

5. **Submission workflow**
The submission flow is a distinct subsystem implemented in `src/components/submit` and surfaced through `src/app/journal/[id]/submit` and `src/app/journal/submit`. The workflow is broken into stages such as:
- instructions
- author info / author profile
- manuscript info
- file upload
- final review

This indicates a multi-step form-like process, likely with client-side state across steps and backend persistence through Redux actions and API calls.

6. **Authentication and account recovery**
Authentication is handled as a separate route family:
- sign in / sign up / sign out
- forgot password / reset password
- user verification
- user profile

Feature components in `src/components/Signin.jsx`, `Signup.jsx`, `Signout.jsx`, `passwords/*`, `personalize/UserProfile.jsx`, and `verification.jsx` map directly to these routes. This is a user lifecycle subsystem distinct from journal content and submission management.

7. **Search subsystem**
`src/app/search` and the `src/components/search` folder form a dedicated search experience. The search UI is separated into:
- a container
- search options
- search results

That separation implies a query/filter/results data flow where user input drives asynchronous fetching or filtering, rather than a single static search page.

8. **State management and server interaction**
`src/redux` is the main application data layer. It contains:
- `store.js` for store configuration
- `slices/*` for domain state: auth, app info, journals, manuscripts, notifications, search
- `actions/*` for async/domain operations
- `api.js` as the central API integration point

The architecture suggests that UI components dispatch actions, actions call the shared API layer, and slices hold the resulting state for rendering. This is the main data flow boundary between the view layer and backend services.

9. **Route protection and authorization**
`src/routes` contains wrappers such as `Authenticate`, `ManageEditor`, and `SubmissionsAuth`. These likely act as authorization gates for protected areas like journal management and submission administration. In the diagram, these are important boundary components between public pages and privileged editor/author workflows.

10. **Cross-cutting hooks and utilities**
Custom hooks in `src/hooks` handle reusable behavior:
- `useAppNavigate` for navigation abstraction
- `useCloudinaryFile` and `useCloudinaryImage` for media/file handling

These hooks indicate external upload/media handling, with Cloudinary likely used for manuscript and image assets. They sit beneath the UI and above the storage/service boundary.

11. **Theming and UI context**
`src/theme/ThemeContext.js` and `src/theme/theme.js` provide global theme support, likely toggling light/dark or brand variants. The presence of `ThemeToggle` in shared UI suggests theme state is global and affects both the landing experience and authenticated pages.

12. **Static content and assets**
`public/submission_system_content.json` appears to hold structured content for the submission system, likely used to render configurable text or instructions without hardcoding it into components. Combined with `public/static/img`, the app mixes code-driven UI with static content resources.

13. **Important architectural boundary summary**
A good diagram should show three major zones:
- **Presentation/routes**: Next.js pages and layouts under `src/app`
- **Feature/UI components**: domain-specific flows in `src/components`
- **State/service layer**: Redux actions/slices + `api.js`, plus Cloudinary hooks and auth guards

The main end-to-end flow is: route enters page/layout → page composes feature components → component dispatches Redux action or uses hooks → API/backend/cloud service responds → slice state updates → UI rerenders.

Main entry points: [`src/redux/store.js`](https://github.com/sankar1912/journal.frontend/blob/main/src/redux/store.js) (Redux store), [`src/components/submit`](https://github.com/sankar1912/journal.frontend/tree/main/src/components/submit) (Submission flow), [`src/components/Signin.jsx`](https://github.com/sankar1912/journal.frontend/blob/main/src/components/Signin.jsx) (Account UI), [`src/app/journal`](https://github.com/sankar1912/journal.frontend/tree/main/src/app/journal) (Journal routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_routes["App Router"]
  node_app_layout["App shell<br/>Next.js layout<br/>[layout.jsx]"]
  node_home_page["Landing<br/>Route page<br/>[page.jsx]"]
  node_journal_routes["Journal routes<br/>Route family"]
  node_search_route["Search page<br/>Route page"]
  node_auth_routes["Auth routes<br/>Route family"]
  node_user_routes["User routes<br/>Route family"]
end

subgraph group_components["Feature UI"]
  node_landers["Lander UI<br/>Landing components"]
  node_journal_ui["Journal UI<br/>Journal components"]
  node_submission_flow["Submission flow<br/>Multi-step form"]
  node_search_ui["Search UI<br/>Search components"]
  node_account_ui["Account UI<br/>Auth/profile components<br/>[Signin.jsx]"]
end

subgraph group_state["Data Layer"]
  node_store[("Redux store<br/>[store.js]")]
  node_actions["Actions<br/>Async ops"]
  node_slices["Slices"]
  node_api["API layer<br/>API client<br/>[api.js]"]
end

subgraph group_guards["Guards"]
  node_guards["Route guards<br/>Auth wrappers"]
end

subgraph group_crosscutting["Shared Concerns"]
  node_hooks["App hooks<br/>Custom hooks"]
  node_theme["Theme<br/>Context and tokens"]
  node_assets["Static assets<br/>Content/assets"]
end

node_app_layout -->|"provides"| node_theme
node_app_layout -->|"wraps"| node_store
node_home_page -->|"composes"| node_landers
node_journal_routes -->|"renders"| node_journal_ui
node_journal_routes -->|"launches"| node_submission_flow
node_journal_routes -->|"protects"| node_guards
node_search_route -->|"renders"| node_search_ui
node_auth_routes -->|"renders"| node_account_ui
node_user_routes -->|"renders"| node_account_ui
node_journal_ui -->|"reads/writes"| node_store
node_submission_flow -->|"tracks"| node_store
node_search_ui -->|"queries"| node_store
node_account_ui -->|"auth state"| node_store
node_store -->|"dispatches"| node_actions
node_actions -->|"calls"| node_api
node_api -->|"updates"| node_slices
node_guards -->|"checks"| node_store
node_guards -->|"uses"| node_hooks
node_submission_flow -->|"uploads"| node_hooks
node_home_page -->|"loads"| node_assets
node_submission_flow -->|"reads"| node_assets
node_theme -->|"styles"| node_landers
node_theme -->|"styles"| node_account_ui

click node_app_layout "https://github.com/sankar1912/journal.frontend/blob/main/src/app/layout.jsx"
click node_home_page "https://github.com/sankar1912/journal.frontend/blob/main/src/app/page.jsx"
click node_journal_routes "https://github.com/sankar1912/journal.frontend/tree/main/src/app/journal"
click node_search_route "https://github.com/sankar1912/journal.frontend/tree/main/src/app/search"
click node_auth_routes "https://github.com/sankar1912/journal.frontend/tree/main/src/app/signin"
click node_user_routes "https://github.com/sankar1912/journal.frontend/tree/main/src/app/user"
click node_landers "https://github.com/sankar1912/journal.frontend/tree/main/src/components/lander"
click node_journal_ui "https://github.com/sankar1912/journal.frontend/tree/main/src/components/journals"
click node_submission_flow "https://github.com/sankar1912/journal.frontend/tree/main/src/components/submit"
click node_search_ui "https://github.com/sankar1912/journal.frontend/tree/main/src/components/search"
click node_account_ui "https://github.com/sankar1912/journal.frontend/blob/main/src/components/Signin.jsx"
click node_store "https://github.com/sankar1912/journal.frontend/blob/main/src/redux/store.js"
click node_actions "https://github.com/sankar1912/journal.frontend/tree/main/src/redux/actions"
click node_slices "https://github.com/sankar1912/journal.frontend/tree/main/src/redux/slices"
click node_api "https://github.com/sankar1912/journal.frontend/blob/main/src/redux/api.js"
click node_guards "https://github.com/sankar1912/journal.frontend/tree/main/src/routes"
click node_hooks "https://github.com/sankar1912/journal.frontend/tree/main/src/hooks"
click node_theme "https://github.com/sankar1912/journal.frontend/tree/main/src/theme"
click node_assets "https://github.com/sankar1912/journal.frontend/blob/main/public/submission_system_content.json"

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_layout,node_home_page,node_journal_routes,node_search_route,node_auth_routes,node_user_routes toneBlue
class node_landers,node_journal_ui,node_submission_flow,node_search_ui,node_account_ui toneAmber
class node_store,node_actions,node_slices,node_api toneMint
class node_guards toneRose
class node_hooks,node_theme,node_assets toneIndigo
```

## Components

### App Router

Next.js route shells and page entrypoints

- [App shell](https://github.com/sankar1912/journal.frontend/blob/main/src/app/layout.jsx): Next.js layout · Root layout and provider composition · `src/app/layout.jsx`
- [Landing](https://github.com/sankar1912/journal.frontend/blob/main/src/app/page.jsx): Route page · Public home and marketing entry point · `src/app/page.jsx`
- [Journal routes](https://github.com/sankar1912/journal.frontend/tree/main/src/app/journal): Route family · Journal overview, detail, submission, management, and submissions pages · `src/app/journal`
- [Search page](https://github.com/sankar1912/journal.frontend/tree/main/src/app/search): Route page · Dedicated search experience · `src/app/search`
- [Auth routes](https://github.com/sankar1912/journal.frontend/tree/main/src/app/signin): Route family · Sign in, sign up, sign out, and password recovery routes · `src/app/signin`
- [User routes](https://github.com/sankar1912/journal.frontend/tree/main/src/app/user): Route family · Profile and verification routes · `src/app/user`

### Feature UI

Reusable domain components and flows

- [Lander UI](https://github.com/sankar1912/journal.frontend/tree/main/src/components/lander): Landing components · Hero, about, cards, and visual landing sections · `src/components/lander`
- [Journal UI](https://github.com/sankar1912/journal.frontend/tree/main/src/components/journals): Journal components · Journal lists, articles, redirects, and management views · `src/components/journals`
- [Submission flow](https://github.com/sankar1912/journal.frontend/tree/main/src/components/submit): Multi-step form · Instructions, author info, manuscript info, upload, and review · `src/components/submit`
- [Search UI](https://github.com/sankar1912/journal.frontend/tree/main/src/components/search): Search components · Container, options, and results presentation · `src/components/search`
- [Account UI](https://github.com/sankar1912/journal.frontend/blob/main/src/components/Signin.jsx): Auth/profile components · Sign in, sign up, sign out, password recovery, verification, profile · `src/components/Signin.jsx`

### Data Layer

Redux state, actions, and API integration

- [Redux store](https://github.com/sankar1912/journal.frontend/blob/main/src/redux/store.js): Store · Global client state configuration · `src/redux/store.js`
- [Actions](https://github.com/sankar1912/journal.frontend/tree/main/src/redux/actions): Async ops · Domain actions for auth, journals, manuscripts, search, and app info · `src/redux/actions`
- [Slices](https://github.com/sankar1912/journal.frontend/tree/main/src/redux/slices): State slices · Auth, app info, journals, manuscripts, notifications, and search state · `src/redux/slices`
- [API layer](https://github.com/sankar1912/journal.frontend/blob/main/src/redux/api.js): API client · Shared backend integration point · `src/redux/api.js`

### Guards

Route protection wrappers

- [Route guards](https://github.com/sankar1912/journal.frontend/tree/main/src/routes): Auth wrappers · Authenticate, editor management, and submissions authorization · `src/routes`

### Shared Concerns

Hooks, theme, and static resources

- [App hooks](https://github.com/sankar1912/journal.frontend/tree/main/src/hooks): Custom hooks · Navigation and Cloudinary media helpers · `src/hooks`
- [Theme](https://github.com/sankar1912/journal.frontend/tree/main/src/theme): Context and tokens · Global theming context and theme definitions · `src/theme`
- [Static assets](https://github.com/sankar1912/journal.frontend/blob/main/public/submission_system_content.json): Content/assets · Submission system content and public images · `public/submission_system_content.json`

## Connections

- App shell → Theme: provides · App shell wires global theming and shared context
- App shell → Redux store: wraps · Provider setup exposes Redux state to routes
- Landing → Lander UI: composes · Landing route is assembled from marketing sections
- Journal routes → Journal UI: renders · Journal pages are backed by journal-specific UI components
- Journal routes → Submission flow: launches · Submit routes enter the manuscript workflow
- Journal routes → Route guards: protects · Management and submission areas are gated
- Search page → Search UI: renders · Search page composes container, options, and results
- Auth routes → Account UI: renders · Authentication pages map to account components
- User routes → Account UI: renders · Profile and verification screens share account components
- Journal UI → Redux store: reads/writes · Journal views use global state for lists and management
- Submission flow → Redux store: tracks · Multi-step submission state is coordinated through Redux
- Search UI → Redux store: queries · Search state and results flow through Redux
- Account UI → Redux store: auth state · User lifecycle screens use auth state
- Redux store → Actions: dispatches · UI triggers domain actions through the store
- Actions → API layer: calls · Async actions centralize backend requests through the API layer
- API layer → Slices: updates · Fetched results are committed into slices
- Route guards → Redux store: checks · Authorization wrappers consult authenticated state
- Route guards → App hooks: uses · Guards reuse navigation and media helpers where needed
- Submission flow → App hooks: uploads · Submission workflow uses Cloudinary file/image hooks
- Landing → Static assets: loads · Landing content is supported by static imagery and content data
- Submission flow → Static assets: reads · Submission guidance content is sourced from static JSON
- Theme → Lander UI: styles · Theme affects public landing presentation
- Theme → Account UI: styles · Theme is shared across authenticated screens
