Spaces:
Runtime error
Runtime error
Hanzo Dev
commited on
Commit
·
6310e51
1
Parent(s):
f9f5cae
Fix @hanzo /ui import paths
Browse files- .npmrc +1 -0
- README.bak.md +294 -0
- components/sections/features.tsx +1 -1
- components/sections/hero.tsx +1 -1
.npmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
legacy-peer-deps=true
|
README.bak.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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template built with Next.js 15, TypeScript, and @hanzo/ui components for creating modern development utilities.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- ✨ Built with **@hanzo/ui** component library (shadcn/ui based)
|
| 8 |
+
- 🎨 **Monochromatic color scheme** with developer-focused aesthetics
|
| 9 |
+
- 📱 **Fully responsive** design (mobile, tablet, desktop)
|
| 10 |
+
- 🌙 **Dark mode** support with next-themes
|
| 11 |
+
- 🚀 **Next.js 15** App Router with React 19
|
| 12 |
+
- 🛠️ **Developer-centric** components
|
| 13 |
+
- ⚡ **TypeScript strict mode** enabled
|
| 14 |
+
- 🎯 **Performance optimized** for tool interfaces
|
| 15 |
+
|
| 16 |
+
## Quick Start
|
| 17 |
+
|
| 18 |
+
### Installation
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
# Install dependencies
|
| 22 |
+
npm install
|
| 23 |
+
|
| 24 |
+
# Start development server
|
| 25 |
+
npm run dev
|
| 26 |
+
```
|
| 27 |
+
|
| 28 |
+
Open [http://localhost:3000](http://localhost:3000) to view your dev tool platform.
|
| 29 |
+
|
| 30 |
+
### Production Build
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
# Create production build
|
| 34 |
+
npm run build
|
| 35 |
+
|
| 36 |
+
# Start production server
|
| 37 |
+
npm start
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## Project Structure
|
| 41 |
+
|
| 42 |
+
```
|
| 43 |
+
devtool/
|
| 44 |
+
├── app/ # Next.js App Router
|
| 45 |
+
│ ├── layout.tsx # Root layout with theming
|
| 46 |
+
│ └── page.tsx # Landing page
|
| 47 |
+
├── components/ # React components
|
| 48 |
+
│ └── sections/ # Page sections
|
| 49 |
+
│ ├── hero.tsx # Hero with CTA
|
| 50 |
+
│ └── features.tsx # Feature cards
|
| 51 |
+
├── lib/ # Utilities and config
|
| 52 |
+
│ └── site.ts # Site configuration
|
| 53 |
+
├── public/ # Static assets
|
| 54 |
+
└── package.json # Dependencies
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Component Usage
|
| 58 |
+
|
| 59 |
+
All components are imported from `@hanzo/ui` with developer-friendly styling:
|
| 60 |
+
|
| 61 |
+
```tsx
|
| 62 |
+
import { Button, Card, CardContent, CardHeader, CardTitle } from '@hanzo/ui/components'
|
| 63 |
+
|
| 64 |
+
// Developer-styled button with monospace font
|
| 65 |
+
<Button size="lg" className="font-mono">
|
| 66 |
+
npm install @your-tool
|
| 67 |
+
</Button>
|
| 68 |
+
|
| 69 |
+
// Feature card with technical styling
|
| 70 |
+
<Card className="border-2 hover:border-black dark:hover:border-white">
|
| 71 |
+
<CardHeader>
|
| 72 |
+
<CardTitle className="font-mono">Feature Name</CardTitle>
|
| 73 |
+
</CardHeader>
|
| 74 |
+
<CardContent>
|
| 75 |
+
Technical description here
|
| 76 |
+
</CardContent>
|
| 77 |
+
</Card>
|
| 78 |
+
```
|
| 79 |
+
|
| 80 |
+
## Customization
|
| 81 |
+
|
| 82 |
+
### Site Configuration
|
| 83 |
+
|
| 84 |
+
Edit `lib/site.ts` to customize your dev tool details:
|
| 85 |
+
|
| 86 |
+
```typescript
|
| 87 |
+
export const siteConfig = {
|
| 88 |
+
name: "Your Tool Name",
|
| 89 |
+
tagline: "Your Tool Tagline",
|
| 90 |
+
description: "What your tool does",
|
| 91 |
+
url: "https://your-tool.com",
|
| 92 |
+
features: [
|
| 93 |
+
"Feature 1",
|
| 94 |
+
"Feature 2",
|
| 95 |
+
"Feature 3",
|
| 96 |
+
"Feature 4"
|
| 97 |
+
]
|
| 98 |
+
}
|
| 99 |
+
```
|
| 100 |
+
|
| 101 |
+
### Styling
|
| 102 |
+
|
| 103 |
+
The template uses a monochromatic color scheme perfect for developer tools:
|
| 104 |
+
|
| 105 |
+
- Primary: Black (`#000000`)
|
| 106 |
+
- Secondary: Gray (`#666666`)
|
| 107 |
+
- Accent: Dark gradients for depth
|
| 108 |
+
- Code: Monospace fonts throughout
|
| 109 |
+
- Borders: High contrast for clarity
|
| 110 |
+
|
| 111 |
+
### Adding Tool Pages
|
| 112 |
+
|
| 113 |
+
Create new pages for different tools:
|
| 114 |
+
|
| 115 |
+
```tsx
|
| 116 |
+
// app/editor/page.tsx
|
| 117 |
+
import { Button, Card } from '@hanzo/ui/components'
|
| 118 |
+
|
| 119 |
+
export default function EditorPage() {
|
| 120 |
+
return (
|
| 121 |
+
<div className="container mx-auto py-12">
|
| 122 |
+
<h1 className="text-4xl font-mono font-bold mb-8">
|
| 123 |
+
Code Editor
|
| 124 |
+
</h1>
|
| 125 |
+
{/* Your editor implementation */}
|
| 126 |
+
</div>
|
| 127 |
+
)
|
| 128 |
+
}
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
## Developer Features
|
| 132 |
+
|
| 133 |
+
### Code Display Components
|
| 134 |
+
|
| 135 |
+
```tsx
|
| 136 |
+
// Code block with syntax highlighting
|
| 137 |
+
<pre className="bg-gray-900 text-gray-100 p-4 rounded-lg overflow-x-auto">
|
| 138 |
+
<code className="language-javascript">
|
| 139 |
+
{codeString}
|
| 140 |
+
</code>
|
| 141 |
+
</pre>
|
| 142 |
+
|
| 143 |
+
// Terminal-style output
|
| 144 |
+
<div className="bg-black text-green-400 p-4 font-mono text-sm">
|
| 145 |
+
$ npm install your-package
|
| 146 |
+
<br />
|
| 147 |
+
✓ Installation complete
|
| 148 |
+
</div>
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
### API Integration
|
| 152 |
+
|
| 153 |
+
```tsx
|
| 154 |
+
// Example API endpoint structure
|
| 155 |
+
// app/api/tools/[tool]/route.ts
|
| 156 |
+
export async function POST(request: Request) {
|
| 157 |
+
const data = await request.json()
|
| 158 |
+
// Process tool request
|
| 159 |
+
return Response.json({ result })
|
| 160 |
+
}
|
| 161 |
+
```
|
| 162 |
+
|
| 163 |
+
### Keyboard Shortcuts
|
| 164 |
+
|
| 165 |
+
```tsx
|
| 166 |
+
// Example keyboard shortcut handler
|
| 167 |
+
useEffect(() => {
|
| 168 |
+
const handleKeyPress = (e: KeyboardEvent) => {
|
| 169 |
+
if (e.metaKey && e.key === 'k') {
|
| 170 |
+
// Open command palette
|
| 171 |
+
}
|
| 172 |
+
}
|
| 173 |
+
document.addEventListener('keydown', handleKeyPress)
|
| 174 |
+
return () => document.removeEventListener('keydown', handleKeyPress)
|
| 175 |
+
}, [])
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
## Available Scripts
|
| 179 |
+
|
| 180 |
+
| Command | Description |
|
| 181 |
+
|---------|-------------|
|
| 182 |
+
| `npm run dev` | Start development server |
|
| 183 |
+
| `npm run build` | Build for production |
|
| 184 |
+
| `npm start` | Start production server |
|
| 185 |
+
| `npm run lint` | Run ESLint |
|
| 186 |
+
|
| 187 |
+
## Tool Categories
|
| 188 |
+
|
| 189 |
+
### Supported Tool Types
|
| 190 |
+
- **Code Generators**: Templates, boilerplate, snippets
|
| 191 |
+
- **Testing Tools**: Unit tests, integration tests, E2E
|
| 192 |
+
- **Build Tools**: Bundlers, compilers, transpilers
|
| 193 |
+
- **Documentation**: API docs, README generators
|
| 194 |
+
- **Analysis Tools**: Linters, formatters, profilers
|
| 195 |
+
- **Deployment**: CI/CD, containerization, monitoring
|
| 196 |
+
|
| 197 |
+
## Environment Variables
|
| 198 |
+
|
| 199 |
+
Create a `.env.local` file for configuration:
|
| 200 |
+
|
| 201 |
+
```env
|
| 202 |
+
# Example environment variables
|
| 203 |
+
NEXT_PUBLIC_API_URL=https://api.your-tool.com
|
| 204 |
+
NEXT_PUBLIC_GITHUB_TOKEN=ghp_...
|
| 205 |
+
DATABASE_URL=postgresql://...
|
| 206 |
+
REDIS_URL=redis://...
|
| 207 |
+
```
|
| 208 |
+
|
| 209 |
+
## Responsive Design
|
| 210 |
+
|
| 211 |
+
The template adapts to different screen sizes:
|
| 212 |
+
|
| 213 |
+
```tsx
|
| 214 |
+
// Responsive layout
|
| 215 |
+
<div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
|
| 216 |
+
{/* Tool cards */}
|
| 217 |
+
</div>
|
| 218 |
+
|
| 219 |
+
// Responsive navigation
|
| 220 |
+
<nav className="flex flex-col md:flex-row gap-4">
|
| 221 |
+
{/* Navigation items */}
|
| 222 |
+
</nav>
|
| 223 |
+
```
|
| 224 |
+
|
| 225 |
+
## TypeScript
|
| 226 |
+
|
| 227 |
+
Strict mode is enabled for better type safety:
|
| 228 |
+
|
| 229 |
+
```json
|
| 230 |
+
{
|
| 231 |
+
"compilerOptions": {
|
| 232 |
+
"strict": true,
|
| 233 |
+
"noImplicitAny": true,
|
| 234 |
+
"strictNullChecks": true,
|
| 235 |
+
"noUnusedLocals": true,
|
| 236 |
+
"noUnusedParameters": true
|
| 237 |
+
}
|
| 238 |
+
}
|
| 239 |
+
```
|
| 240 |
+
|
| 241 |
+
## Performance Optimization
|
| 242 |
+
|
| 243 |
+
- Lazy loading for heavy components
|
| 244 |
+
- Code splitting by feature
|
| 245 |
+
- Optimized bundle size
|
| 246 |
+
- Service worker for offline support
|
| 247 |
+
- WebAssembly support for compute-intensive tasks
|
| 248 |
+
|
| 249 |
+
## Integration Examples
|
| 250 |
+
|
| 251 |
+
### GitHub Integration
|
| 252 |
+
```tsx
|
| 253 |
+
// Connect to GitHub API
|
| 254 |
+
const octokit = new Octokit({
|
| 255 |
+
auth: process.env.GITHUB_TOKEN,
|
| 256 |
+
})
|
| 257 |
+
```
|
| 258 |
+
|
| 259 |
+
### Database Integration
|
| 260 |
+
```tsx
|
| 261 |
+
// Prisma ORM example
|
| 262 |
+
import { PrismaClient } from '@prisma/client'
|
| 263 |
+
const prisma = new PrismaClient()
|
| 264 |
+
```
|
| 265 |
+
|
| 266 |
+
### Real-time Features
|
| 267 |
+
```tsx
|
| 268 |
+
// WebSocket connection
|
| 269 |
+
const ws = new WebSocket('wss://your-api.com')
|
| 270 |
+
ws.on('message', handleMessage)
|
| 271 |
+
```
|
| 272 |
+
|
| 273 |
+
## Browser Support
|
| 274 |
+
|
| 275 |
+
- Chrome 90+
|
| 276 |
+
- Firefox 88+
|
| 277 |
+
- Safari 14+
|
| 278 |
+
- Edge 90+
|
| 279 |
+
|
| 280 |
+
## Contributing
|
| 281 |
+
|
| 282 |
+
1. Fork the repository
|
| 283 |
+
2. Create your feature branch
|
| 284 |
+
3. Commit your changes
|
| 285 |
+
4. Push to the branch
|
| 286 |
+
5. Create a Pull Request
|
| 287 |
+
|
| 288 |
+
## License
|
| 289 |
+
|
| 290 |
+
MIT
|
| 291 |
+
|
| 292 |
+
## Support
|
| 293 |
+
|
| 294 |
+
For questions or issues, visit [github.com/hanzoai/templates](https://github.com/hanzoai/templates)
|
components/sections/features.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import { siteConfig } from '@/lib/site'
|
| 2 |
-
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@hanzo/ui
|
| 3 |
|
| 4 |
export function Features() {
|
| 5 |
return (
|
|
|
|
| 1 |
import { siteConfig } from '@/lib/site'
|
| 2 |
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@hanzo/ui'
|
| 3 |
|
| 4 |
export function Features() {
|
| 5 |
return (
|
components/sections/hero.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import { siteConfig } from '@/lib/site'
|
| 2 |
-
import { Button } from '@hanzo/ui
|
| 3 |
|
| 4 |
export function Hero() {
|
| 5 |
return (
|
|
|
|
| 1 |
import { siteConfig } from '@/lib/site'
|
| 2 |
+
import { Button } from '@hanzo/ui'
|
| 3 |
|
| 4 |
export function Hero() {
|
| 5 |
return (
|