AlexJSully-Portfolio

Components Documentation

This document describes the internal architecture, relationships, and usage of major UI components in the Alexander Sullivan’s Portfolio project. Components are modular, reusable, and styled with Material-UI and Emotion.

Component List & Hierarchy

Core Components

Component Hierarchy

flowchart TD
    RootLayout[Root Layout] --> Navbar
    RootLayout --> Main[Main Content]
    RootLayout --> Footer
    RootLayout --> ServiceWorkerRegister

    Main --> Banner
    Main --> ProjectsGrid
    Main --> Publications
    Main --> StarsBackground
    Main --> CookieSnackbar

    Banner --> Avatar

    ProjectsGrid --> ProjectCards[Project Cards]
    Publications --> PublicationCards[Publication Cards]
    Footer --> SocialLinks[Social Links]

Component Details

Location: src/components/navbar/Navbar.tsx

Top navigation bar with smooth scrolling to page sections.

Features:

See: Navbar Documentation

Location: src/components/banner/Banner.tsx, Avatar.tsx

Header section with animated profile picture featuring a sneeze animation and Easter egg.

Features:

See: Banner & Avatar Documentation

ProjectsGrid

Location: src/components/projects/ProjectsGrid.tsx

Displays project cards in a responsive grid layout.

Features:

See: Projects Documentation

Publications

Location: src/components/publications/Publications.tsx

Lists publications with authors, abstracts, and metadata.

Features:

See: Publications Documentation

Location: src/components/footer/Footer.tsx

Social media links and copyright information.

Features:

See: Socials Documentation

StarsBackground

Location: src/components/Stars/StarsBackground.tsx

Animated starfield background with twinkling stars.

Features:

See: Stars Documentation

CookieSnackbar

Location: src/components/cookie-snackbar/CookieSnackbar.tsx

Cookie consent notification with localStorage persistence.

Features:

See: Cookie Snackbar Documentation

ServiceWorkerRegister

Location: src/components/ServiceWorkerRegister.tsx

Client component that registers the service worker for PWA functionality.

Features:

See: Service Worker Documentation

Relationships & Composition

Components are composed in the GeneralLayout:

export default function GeneralLayout({ children }) {
	return (
		<div id='content'>
			<Navbar />
			<main>
				{children}
				<StarsBackground />
				<CookieSnackbar />
			</main>
			<footer>
				<Footer />
			</footer>
		</div>
	);
}

Data flow:

sequenceDiagram
    participant Page
    participant Data
    participant Component
    participant Firebase

    Page->>Data: Import projects, publications, socials
    Data-->>Page: Static data arrays
    Page->>Component: Pass data as props
    Component->>Component: Render UI
    Component->>Firebase: Log analytics events
    Firebase-->>Component: Event logged

How Components Work

Component Organization:

Data Integration:

Styling:

Testing:

Component Data Flow

flowchart LR
    Data[src/data/] -->|Import| Page[page.tsx]
    Page -->|Props| ProjectsGrid
    Page -->|Props| Publications
    Page -->|Static| Footer
    Page -->|Static| Navbar
    Page -->|Static| Avatar

    Navbar -->|Events| Firebase[Firebase]
    Avatar -->|Events| Firebase
    ProjectsGrid -->|Events| Firebase
    Publications -->|Events| Firebase
    Footer -->|Events| Firebase