How thimirasadeesha/myportfolio works
Main Components
• Next.js Application: This is the core of the project, responsible for rendering pages and handling routing. Key files like _app.tsx and _document.tsx set the stage for the app’s global behavior.
• UI & Components Layer: This includes all the React components found in the “src/components” directory (such as about-hero, landing-hero, experience showcase, projects, skills, and utility components). Also include the animation components (in “src/animation”) that integrate Framer Motion to create smooth transitions.
• API Backend: The “src/pages/api/sendmail.ts” file represents the backend part of the portfolio that uses Nodemailer to process outgoing emails from the contact form.
• Data & Content: The “src/data” folder contains JSON-like files for education, experience, projects, navigation routes, and site metadata. They provide the content that populates your UI components.
• Custom Hooks & Utilities: The “src/hooks” and “src/utility” directories encapsulate application-level logic (for example, auto-sizing text areas, debouncing, or rate-limiting) — important to illustrate how behavior is abstracted away from the UI.
• Layout & Styling: The “src/layout” contains key layout components like the navbar, footer, and main layout container. Also, the “src/styles” and Tailwind configurations define the look and feel.
Relationships and Interactions Between Components
• The Next.js framework organizes page rendering: the “src/pages” directory contains all rendered pages, each of which combines multiple UI components.
• Pages (like index.tsx, about.tsx, projects.tsx) leverage layout components (navbar, footer, main-layout) and integrate various component subsets (like animations, project cards, and testimonials).
• The API endpoint (sendmail.ts) is triggered by actions within the contact form (components in “src/components/contact-form”) and makes use of Nodemailer.
• Data files supply static content to these components and are imported as needed.
• Global styles and Tailwind CSS ensure the presentation stays consistent across the application.
• Utility files and hooks provide cross-cutting functionalities (e.g., debouncing input, managing screen breakpoints) that other components depend on.
Architectural Patterns and Design Principles
• Component-Based Architecture: The UI is built in a modular way with reusable, isolated React components.
• Separation of Concerns: There’s a clear partition between UI (pages, components, layout), business logic (custom hooks and utilities), content (data), and API interactions.
• Single-Page Application (SPA) Routing: Next.js handles both client-side and server-side rendering through its built-in routing system.
• Incremental Static Regeneration and API Endpoints: Though primarily a front-end portfolio, there is a built-in API layer to support interactivity (sending emails).
Relevant Technologies
• For the frontend: Next.js, React, TypeScript, Tailwind CSS, and Framer Motion.
• For the backend/API: A simple Node.js-based endpoint using Nodemailer.
• Utility libraries or custom solutions used in hooks and custom utilities.