Spaces:
Runtime error
Runtime error
Hanzo Dev
commited on
Commit
·
01fb201
1
Parent(s):
152fcf8
Fix @hanzo /ui import paths
Browse files- .npmrc +1 -0
- README.bak.md +279 -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,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Mobile App Builder Template
|
| 2 |
+
|
| 3 |
+
A mobile-first template for building cross-platform applications with Next.js 15, TypeScript, and @hanzo/ui components.
|
| 4 |
+
|
| 5 |
+
## Features
|
| 6 |
+
|
| 7 |
+
- ✨ Built with **@hanzo/ui** component library (shadcn/ui based)
|
| 8 |
+
- 📱 **Mobile-first** design approach
|
| 9 |
+
- 🎨 **Monochromatic color scheme** for clean aesthetics
|
| 10 |
+
- 📐 **Fully responsive** (mobile, tablet, desktop)
|
| 11 |
+
- 🌙 **Dark mode** support with next-themes
|
| 12 |
+
- 🚀 **Next.js 15** App Router with React 19
|
| 13 |
+
- 📲 **Touch-optimized** components
|
| 14 |
+
- ⚡ **TypeScript strict mode** enabled
|
| 15 |
+
- 🎯 **PWA-ready** architecture
|
| 16 |
+
|
| 17 |
+
## Quick Start
|
| 18 |
+
|
| 19 |
+
### Installation
|
| 20 |
+
|
| 21 |
+
```bash
|
| 22 |
+
# Install dependencies
|
| 23 |
+
npm install
|
| 24 |
+
|
| 25 |
+
# Start development server
|
| 26 |
+
npm run dev
|
| 27 |
+
```
|
| 28 |
+
|
| 29 |
+
Open [http://localhost:3000](http://localhost:3000) on your mobile device or desktop browser.
|
| 30 |
+
|
| 31 |
+
### Production Build
|
| 32 |
+
|
| 33 |
+
```bash
|
| 34 |
+
# Create production build
|
| 35 |
+
npm run build
|
| 36 |
+
|
| 37 |
+
# Start production server
|
| 38 |
+
npm start
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
## Project Structure
|
| 42 |
+
|
| 43 |
+
```
|
| 44 |
+
mobile/
|
| 45 |
+
├── app/ # Next.js App Router
|
| 46 |
+
│ ├── layout.tsx # Root layout with viewport
|
| 47 |
+
│ └── page.tsx # Home page
|
| 48 |
+
├── components/ # React components
|
| 49 |
+
│ └── sections/ # Page sections
|
| 50 |
+
│ ├── hero.tsx # Hero section (mobile-optimized)
|
| 51 |
+
│ └── features.tsx # Features grid (touch-friendly)
|
| 52 |
+
├── lib/ # Utilities and config
|
| 53 |
+
│ └── site.ts # Site configuration
|
| 54 |
+
├── public/ # Static assets & icons
|
| 55 |
+
└── package.json # Dependencies
|
| 56 |
+
```
|
| 57 |
+
|
| 58 |
+
## Component Usage
|
| 59 |
+
|
| 60 |
+
All components are imported from `@hanzo/ui` and optimized for mobile:
|
| 61 |
+
|
| 62 |
+
```tsx
|
| 63 |
+
import { Button, Card, CardContent, CardHeader, CardTitle } from '@hanzo/ui/components'
|
| 64 |
+
|
| 65 |
+
// Mobile-optimized button
|
| 66 |
+
<Button size="lg" className="w-full sm:w-auto">
|
| 67 |
+
Download App
|
| 68 |
+
</Button>
|
| 69 |
+
|
| 70 |
+
// Touch-friendly card
|
| 71 |
+
<Card className="hover:shadow-lg transition-shadow">
|
| 72 |
+
<CardHeader>
|
| 73 |
+
<CardTitle>Feature</CardTitle>
|
| 74 |
+
</CardHeader>
|
| 75 |
+
<CardContent>
|
| 76 |
+
Mobile-optimized content
|
| 77 |
+
</CardContent>
|
| 78 |
+
</Card>
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
## Mobile-First Design Patterns
|
| 82 |
+
|
| 83 |
+
### Responsive Breakpoints
|
| 84 |
+
|
| 85 |
+
```css
|
| 86 |
+
/* Mobile First Approach */
|
| 87 |
+
- Base: 320px (minimum mobile)
|
| 88 |
+
- sm: 640px (large phones)
|
| 89 |
+
- md: 768px (tablets)
|
| 90 |
+
- lg: 1024px (desktops)
|
| 91 |
+
- xl: 1280px (large screens)
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
### Touch Targets
|
| 95 |
+
|
| 96 |
+
All interactive elements follow mobile best practices:
|
| 97 |
+
- Minimum touch target: 44x44px
|
| 98 |
+
- Adequate spacing between tappable elements
|
| 99 |
+
- Clear visual feedback on touch
|
| 100 |
+
|
| 101 |
+
### Mobile Navigation
|
| 102 |
+
|
| 103 |
+
```tsx
|
| 104 |
+
// Example mobile-friendly navigation
|
| 105 |
+
<nav className="fixed bottom-0 sm:relative sm:bottom-auto">
|
| 106 |
+
{/* Tab bar for mobile, top nav for desktop */}
|
| 107 |
+
</nav>
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## Customization
|
| 111 |
+
|
| 112 |
+
### Site Configuration
|
| 113 |
+
|
| 114 |
+
Edit `lib/site.ts` to customize your app details:
|
| 115 |
+
|
| 116 |
+
```typescript
|
| 117 |
+
export const siteConfig = {
|
| 118 |
+
name: "Your App Name",
|
| 119 |
+
tagline: "Your App Tagline",
|
| 120 |
+
description: "What your app does",
|
| 121 |
+
url: "https://your-app.com",
|
| 122 |
+
features: [
|
| 123 |
+
"Feature 1",
|
| 124 |
+
"Feature 2",
|
| 125 |
+
"Feature 3",
|
| 126 |
+
"Feature 4"
|
| 127 |
+
]
|
| 128 |
+
}
|
| 129 |
+
```
|
| 130 |
+
|
| 131 |
+
### Styling
|
| 132 |
+
|
| 133 |
+
The template uses a monochromatic color scheme:
|
| 134 |
+
|
| 135 |
+
- Primary: Black (`#000000`)
|
| 136 |
+
- Secondary: Gray (`#666666`)
|
| 137 |
+
- Background: White/Dark gray
|
| 138 |
+
- Text: High contrast for readability
|
| 139 |
+
|
| 140 |
+
### Adding Pages
|
| 141 |
+
|
| 142 |
+
Create mobile-optimized pages:
|
| 143 |
+
|
| 144 |
+
```tsx
|
| 145 |
+
// app/features/page.tsx
|
| 146 |
+
import { Button, Card } from '@hanzo/ui/components'
|
| 147 |
+
|
| 148 |
+
export default function FeaturesPage() {
|
| 149 |
+
return (
|
| 150 |
+
<div className="container mx-auto py-8 px-4">
|
| 151 |
+
<h1 className="text-2xl sm:text-4xl font-bold">
|
| 152 |
+
Features
|
| 153 |
+
</h1>
|
| 154 |
+
{/* Mobile-first content */}
|
| 155 |
+
</div>
|
| 156 |
+
)
|
| 157 |
+
}
|
| 158 |
+
```
|
| 159 |
+
|
| 160 |
+
## Mobile Features
|
| 161 |
+
|
| 162 |
+
### Progressive Web App (PWA)
|
| 163 |
+
- Installable on mobile devices
|
| 164 |
+
- Offline capability
|
| 165 |
+
- App-like experience
|
| 166 |
+
|
| 167 |
+
### Touch Gestures
|
| 168 |
+
- Swipe navigation support
|
| 169 |
+
- Pull-to-refresh patterns
|
| 170 |
+
- Smooth scrolling
|
| 171 |
+
|
| 172 |
+
### Performance Optimization
|
| 173 |
+
- Lazy loading for images
|
| 174 |
+
- Code splitting by route
|
| 175 |
+
- Minimal bundle size
|
| 176 |
+
- Optimized for 3G connections
|
| 177 |
+
|
| 178 |
+
### Device Features
|
| 179 |
+
- Responsive viewport meta tag
|
| 180 |
+
- Safe area insets for notches
|
| 181 |
+
- Orientation change handling
|
| 182 |
+
- Native app feel
|
| 183 |
+
|
| 184 |
+
## Available Scripts
|
| 185 |
+
|
| 186 |
+
| Command | Description |
|
| 187 |
+
|---------|-------------|
|
| 188 |
+
| `npm run dev` | Start development server |
|
| 189 |
+
| `npm run build` | Build for production |
|
| 190 |
+
| `npm start` | Start production server |
|
| 191 |
+
| `npm run lint` | Run ESLint |
|
| 192 |
+
|
| 193 |
+
## Testing on Mobile Devices
|
| 194 |
+
|
| 195 |
+
### Local Network Testing
|
| 196 |
+
|
| 197 |
+
```bash
|
| 198 |
+
# Start dev server on all network interfaces
|
| 199 |
+
npm run dev -- --hostname 0.0.0.0
|
| 200 |
+
|
| 201 |
+
# Access from mobile device
|
| 202 |
+
http://[YOUR_LOCAL_IP]:3000
|
| 203 |
+
```
|
| 204 |
+
|
| 205 |
+
### Mobile Debugging
|
| 206 |
+
|
| 207 |
+
- Chrome DevTools: Remote debugging for Android
|
| 208 |
+
- Safari Web Inspector: iOS debugging
|
| 209 |
+
- Responsive Design Mode: Desktop browser testing
|
| 210 |
+
|
| 211 |
+
## Environment Variables
|
| 212 |
+
|
| 213 |
+
Create a `.env.local` file:
|
| 214 |
+
|
| 215 |
+
```env
|
| 216 |
+
# Example environment variables
|
| 217 |
+
NEXT_PUBLIC_API_URL=https://api.example.com
|
| 218 |
+
NEXT_PUBLIC_APP_NAME=MobileFirst
|
| 219 |
+
NEXT_PUBLIC_ANALYTICS_ID=UA-...
|
| 220 |
+
```
|
| 221 |
+
|
| 222 |
+
## Responsive Components
|
| 223 |
+
|
| 224 |
+
All components adapt to screen size:
|
| 225 |
+
|
| 226 |
+
```tsx
|
| 227 |
+
// Responsive grid
|
| 228 |
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4">
|
| 229 |
+
{/* Content */}
|
| 230 |
+
</div>
|
| 231 |
+
|
| 232 |
+
// Responsive typography
|
| 233 |
+
<h1 className="text-2xl sm:text-3xl md:text-4xl">
|
| 234 |
+
Responsive Heading
|
| 235 |
+
</h1>
|
| 236 |
+
|
| 237 |
+
// Responsive spacing
|
| 238 |
+
<div className="p-4 sm:p-6 md:p-8">
|
| 239 |
+
{/* Content */}
|
| 240 |
+
</div>
|
| 241 |
+
```
|
| 242 |
+
|
| 243 |
+
## TypeScript
|
| 244 |
+
|
| 245 |
+
Strict mode is enabled for type safety:
|
| 246 |
+
|
| 247 |
+
```json
|
| 248 |
+
{
|
| 249 |
+
"compilerOptions": {
|
| 250 |
+
"strict": true,
|
| 251 |
+
"noImplicitAny": true,
|
| 252 |
+
"strictNullChecks": true
|
| 253 |
+
}
|
| 254 |
+
}
|
| 255 |
+
```
|
| 256 |
+
|
| 257 |
+
## Browser & Device Support
|
| 258 |
+
|
| 259 |
+
- iOS Safari 13+
|
| 260 |
+
- Chrome Mobile 89+
|
| 261 |
+
- Samsung Internet 13+
|
| 262 |
+
- Firefox Mobile 86+
|
| 263 |
+
- Edge Mobile 89+
|
| 264 |
+
|
| 265 |
+
## Performance Metrics
|
| 266 |
+
|
| 267 |
+
Target metrics for mobile:
|
| 268 |
+
- First Contentful Paint: < 1.8s
|
| 269 |
+
- Time to Interactive: < 3.9s
|
| 270 |
+
- Cumulative Layout Shift: < 0.1
|
| 271 |
+
- Lighthouse Score: > 90
|
| 272 |
+
|
| 273 |
+
## License
|
| 274 |
+
|
| 275 |
+
MIT
|
| 276 |
+
|
| 277 |
+
## Support
|
| 278 |
+
|
| 279 |
+
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 (
|