How patriciosebastian/personal-website works
Main Components
• Frontend (Client-Side UI and Pages):
• The Next.js “app” directory holds the routing for various pages (home page, blog, admin, freelance, analytics, secret-login). For example, you have routes like /blog/[slug] for dynamic blog posts and /admin/create-post for content creation.
• UI Components:
• Located in the “src/components” and “src/components/ui” directories, these include reusable pieces (buttons, dropdowns, theme toggle, mobile navigation, etc.) that compose the user interface.
• Rich Text Editor Module:
• The presence of TinyMCE components (in both “src/components/tinyMCE.jsx” and “src/utils/tinyMCE/” files) indicates integrated rich text editing functionality for blog posts or admin content creation.
• Backend Integration:
• Supabase is integrated as noted in “src/lib/supabaseClient.js” and files under “src/utils/supabase/”. This shows where the system handles connections to databases and possibly authentication or other backend processes.
• Styles & Configuration:
• Tailwind CSS and PostCSS (configured via tailwind.config.js and postcss.config.mjs) chart the styling approach, while configurations like jsconfig.json and next.config.mjs determine build and runtime behavior.
• Middleware and Routing:
• Files like “middleware.js” in the root and within supabase-specific middleware under “src/utils/supabase/middleware.js” indicate request handling/authorization at the routing level.
Relationships and Interactions
• Client–Server Communication:
• Next.js pages under “src/app” or its dynamic routes interact with backend endpoints (such as the “analytics/route.js”) or server-side functions (for authentication routes) to fetch or submit data.
• Reusable Components and UI Integration:
• UI components render the dynamic content fetched/edited through the rich text editor and display superseded data from Supabase.
• External Service Integration:
• Supabase is the primary external service for database and possibly authentication, with clear separation via lib and utils.
• The Admin and Blog modules:
• The admin pages create or manage content (using the TinyMCE editor and Supabase integration) which is then rendered in the blog pages.
Architectural Patterns & Design Principles
• Modular & Component-Based Architecture:
• The separation of UI-specific components, utilities, and page views follows the component-based design typical in Next.js and modern React applications.
• MVC or Similar Pattern:
• While not strictly MVC, the project structure splits “views” (pages under app), “controllers” (middleware and route handling), and “model” (Supabase interactions and util functions) to assist with maintainability.
• Server-Side Rendering (SSR) and Static Generation:
• Next.js routing indicates a mix of SSR and possibly static optimizations, beneficial for a personal website.
Relevant Technologies, Frameworks, and Libraries
• Next.js – for routing, server-side rendering, and overall application framework.
• React – powering the component-based UI.
• Supabase – for backend services and database access.
• TinyMCE – as the rich text editor for content creation.
• Tailwind CSS & PostCSS – for styling.
• ESLint – for code quality, as indicated by the .eslintrc.json file.