Dashboard
The ShipKit dashboard provides a centralized interface for accessing various development tools and features. This guide covers the dashboard's components, features, and customization options.
Tools Section
The tools section is a key component of the dashboard that provides quick access to various development utilities. It includes a searchable, filterable grid of tools organized by category.
Core Features
// Tool Categories
type ToolCategory =
| "Formatters"
| "Testing"
| "Generators"
| "Converters"
| "Security"
| "Design";
// Tool Interface
interface Tool {
title: string;
description: string;
icon: React.ComponentType<{ className?: string }>;
href: string;
isExternal?: boolean;
category: ToolCategory;
keywords: string[];
}
Available Tools
The dashboard includes several built-in tools:
CSS Easing
Visual easing function generator for animations
Category: Design
Features: Animation curves, timing functions, bezier curves
RegEx Tester
Test and debug regular expressions
Category: Testing
Features: Pattern matching, capture groups, flags
Cron Expression Generator
Generate and validate cron expressions
Category: Generators
Features: Schedule generation, time expressions
Hash Generator
Generate various hash types
Category: Security
Features: MD5, SHA256, encryption tools
JWT Debugger
Debug and verify JWT tokens
Category: Security
Features: Token validation, payload inspection
CSS Grid Generator
Visual grid layout builder
Category: Design
Features: Layout templates, responsive design
Features
Search Functionality
const filteredTools = tools.filter((tool) => {
const searchTerms = searchQuery.toLowerCase().split(" ");
return searchTerms.every(term =>
tool.title.toLowerCase().includes(term) ||
tool.description.toLowerCase().includes(term) ||
tool.keywords.some(keyword => keyword.toLowerCase().includes(term))
);
});
Category Filtering
const categories = [
"all",
...new Set(tools.map((tool) => tool.category)),
] as const;
Star/Favorite Tools
const toggleStar = (toolTitle: string) => {
setStarredTools((prev) => {
const next = new Set(prev);
if (next.has(toolTitle)) {
next.delete(toolTitle);
} else {
next.add(toolTitle);
}
localStorage.setItem(STORAGE_KEY, JSON.stringify([...next]));
return next;
});
};
Tool Cards
const ToolCardContent = ({
tool,
isStarred,
onToggleStar,
}: {
tool: Tool;
isStarred: boolean;
onToggleStar: (e: React.MouseEvent) => void;
}) => (
// Card implementation with title, description, keywords, and actions
);
Customization
Adding New Tools
const newTool: Tool = {
title: "Tool Name",
description: "Tool description",
icon: IconComponent,
href: "https://tool-url.com",
isExternal: true,
category: "Category",
keywords: ["keyword1", "keyword2"],
};
Styling
// Card styling with Tailwind CSS
<Card className="cursor-pointer transition-colors hover:bg-muted/50 group">
{/* Card content */}
</Card>
Layout
// Responsive grid layout
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-3">
{/* Tool cards */}
</div>
Best Practices
Performance
Use useAutoAnimate
for smooth transitions
Implement efficient search filtering
Cache starred tools in localStorage
Accessibility
Include proper ARIA labels
Ensure keyboard navigation
Provide screen reader support
User Experience
Smooth animations
Responsive design
Clear visual feedback
Error Handling
External Tool Links
<Link
href={tool.href}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
>
{/* Link content */}
</Link>
Local Storage
useEffect(() => {
try {
const stored = localStorage.getItem(STORAGE_KEY);
if (stored) {
setStarredTools(new Set(JSON.parse(stored)));
}
} catch (error) {
console.error('Failed to load starred tools:', error);
}
}, []);
Integration
Adding to Layout
// src/app/(app)/(dashboard)/layout.tsx
import { ToolsSection } from './_components/tools-section';
export default function DashboardLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<div className="container mx-auto p-6">
<ToolsSection />
{children}
</div>
);
}
State Management
The dashboard uses React's built-in state management with hooks:
const [searchQuery, setSearchQuery] = useState("");
const [selectedCategory, setSelectedCategory] = useState<ToolCategory | "all">("all");
const [selectedTool, setSelectedTool] = useState<Tool | null>(null);
const [starredTools, setStarredTools] = useState<Set<string>>(new Set());
const [showStarredOnly, setShowStarredOnly] = useState(false);
Testing
Component Tests
describe('ToolsSection', () => {
it('should filter tools based on search', () => {
// Test implementation
});
it('should filter tools by category', () => {
// Test implementation
});
it('should handle starring tools', () => {
// Test implementation
});
});
Integration Tests
describe('Dashboard Integration', () => {
it('should load and display tools', () => {
// Test implementation
});
it('should persist starred tools', () => {
// Test implementation
});
});
Security Considerations
External Links
Use rel="noopener noreferrer"
for external links
Validate external tool URLs
Implement CSP headers
Local Storage
Sanitize stored data
Handle storage errors
Clear sensitive data
Performance Optimization
Code Splitting
Lazy load tool components
Optimize images and icons
Implement virtual scrolling for large lists
Caching
Cache tool data
Implement service workers
Use localStorage efficiently