How nirbhay007/portfolio-new works
Core Components
• Frontend Application (Next.js):
• Pages (located in the app directory): These include the home page, about, blog, portfolio, services, contact, error pages, and even dynamic routes (e.g., [slug] pages).
• Layouts & Global Styling: The app directory includes global layout files and CSS (globals.css) that ensure consistent styling and structure.
• MDX and Content Integration: The presence of components like mdx-components.js and the content directory (with blog MDX files) show that some pages are rendered using MDX (a mix of Markdown and JSX).
• UI Components Library: A robust set of reusable UI components (in the components/ui and other components subdirectories) is used to assemble different sections (headers, footers, cards, dialogs, etc.).
• Animation & Effects: Components that use Framer Motion (as noted in the README) and other visual elements (e.g., animated-text.tsx, floating-astronaut.tsx, parallax-effect.tsx) indicate advanced UI interactions.
• Backend/API Routes:
• API Endpoints: Found in the app/api directory (e.g., send-email/route.ts) that handle serverless functions, such as processing the contact form submission.
• External Integrations: The README states that the contact form submission leverages Formspree, so although a local API route exists, there is also an external service interaction.
• Static Assets & Configuration:
• Public folder: Contains images, favicon, and other public-facing assets.
• Configuration Files: Files such as next.config.mjs, tailwind.config.ts, postcss.config.js, and tsconfig.json indicate build-time configurations and type settings.
• Supporting Utilities:
• Custom hooks (in the hooks directory) and libraries (located in the lib and types directories) provide business logic and type definitions.
Relationships & Data Flow
• Client Requests: Users access the website by navigating to different pages (home, blog, portfolio, etc.) rendered by Next.js.
• Page Rendering: Each page utilizes shared layouts and UI components (e.g., header, footer, sections) which are consistently structured across the site.
• API Interaction: When a user submits the contact form, the request is handled by the API route (app/api/send-email/route.ts) potentially forwarding data to Formspree for processing.
• Content Delivery: Blog posts and project data are served from the content directory, with static/dynamic routing provided by Next.js file system routing.
Architectural Patterns and Technologies
• File-Based Routing and Dynamic Route Generation: In Next.js, the app/ directory drives routing automatically (note folders like blog/[slug] and services/[...slug]).
• Component-Based Architecture: Reusable components in the components and components/ui directories encourage modular design.
• Theming and Styling: Utilization of Tailwind CSS and a theme provider (components/theme-provider.tsx) shows theme management, including support for a dark theme.
• Animation Libraries: Framer Motion is used for animations, enhancing the user interface.
• Serverless API: The send-email route represents a serverless API endpoint for handling form submissions.
• External Service Integration: Although not depicted physically in the codebase, the documentation reflects that forms use Formspree.