TypeScript Types & Interfaces
Type definitions and interfaces used throughout the portfolio application.Chat & AI Types
Types related to the ChatBox component and AI interactions.Message
Represents a single chat message in the conversation.The role of the message sender:
user- Messages from the end userassistant- Responses from the AIsystem- System prompts and instructions
The text content of the message. Supports markdown formatting for assistant messages.
BlogContext
Context information about a blog post for AI summarization.The title of the blog post
The full markdown content of the blog post
A brief excerpt or description of the blog post
ChatBoxProps
Props interface for the ChatBox component.Controls visibility of the chat box
Callback function when chat is closed
Enables dark mode styling (defaults to true)
Optional initial message to send when chat opens
Optional blog context for AI summarization
Source Location
src/types/types.ts:1
Blog Types
Type definitions for blog posts and metadata.BlogPost
Complete blog post with full content.Unique identifier for the post (typically same as slug)
URL-friendly identifier used in routes (e.g., “welcome-to-my-blog”)
The title of the blog post
Publication date in ISO format (e.g., “2024-01-15”)
Alias for
date field, same valueBrief summary or description of the post
Full markdown content of the blog post
Category classification (e.g., “Technology”, “AI”, “Finance”)
Array of tag strings for categorization and filtering
Whether the post should be displayed in the featured section (defaults to false)
Estimated reading time in minutes, calculated automatically
BlogPostMetadata
Blog post metadata without full content (used for listings).BlogPostMetadata is identical to BlogPost except it lacks the content field. This optimizes performance when displaying lists of posts.BlogPost above, excluding content.
Source Location
src/types/blog.ts:1
System Context
TheSYSTEM_CONTEXT constant provides comprehensive information about the portfolio owner for the AI assistant.
Structure
Context Properties
Full name: “Ethan Clinick”
Educational background
Array of work experiences
Array of personal and professional projects
Array of skills with acquisition year in parenthesesExamples:
- “Python (2022)”
- “AWS (2024)”
- “React Native (2024)“
Instructions Properties
AI assistant role description and purpose
Expected tone of responses (“professional”)
Guidelines for response content and focus areas
Usage Example
Source Location
src/types/types.ts:20
Type Guards & Utilities
While not explicitly defined in the codebase, you can create type guards for runtime type checking:Best Practices
- Use BlogPostMetadata for lists - Avoid loading full content when displaying multiple posts
- Validate dates - Ensure date strings are in ISO format for consistent parsing
- Type imports - Import types with
import typefor better tree-shaking