|
1 | | -This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). |
| 1 | +# Hirachu |
| 2 | + |
| 3 | +A modern e-commerce storefront for handcrafted Japanese dolls, built with Next.js 16 and Shopify's Storefront API. Features a Tokyo-inspired minimalist design with smooth animations and progressive web app capabilities. |
| 4 | + |
| 5 | +## Features |
| 6 | + |
| 7 | +- **Headless Shopify** - Full integration with Shopify Storefront API 2025-10 |
| 8 | +- **Tokyo Minimalist Design** - Clean, editorial aesthetic with smooth interactions |
| 9 | +- **Full E-commerce** - Cart, checkout, wishlist, and product search |
| 10 | +- **Command Palette Search** - Lightning-fast product search with Ctrl+K (⌘K) |
| 11 | +- **Progressive Web App** - Offline support with custom service worker |
| 12 | +- **Performance Optimized** - ISR caching, lazy loading, image optimization |
| 13 | +- **SEO Ready** - Dynamic OG images, structured data, and metadata |
| 14 | +- **Server Actions** - Modern form handling with Next.js Server Actions |
| 15 | +- **Analytics** - Vercel Analytics and Speed Insights integrated |
| 16 | + |
| 17 | +## Tech Stack |
| 18 | + |
| 19 | +- **Framework:** Next.js 16 (App Router, Turbopack) |
| 20 | +- **Styling:** Tailwind CSS v4 |
| 21 | +- **Animations:** Framer Motion |
| 22 | +- **E-commerce:** Shopify Storefront API |
| 23 | +- **Search:** cmdk (Command Palette) |
| 24 | +- **Icons:** Phosphor Icons |
| 25 | +- **Fonts:** Geist, Geist Mono, Hachi Maru Pop |
2 | 26 |
|
3 | 27 | ## Getting Started |
4 | 28 |
|
5 | | -First, run the development server: |
| 29 | +### Prerequisites |
| 30 | + |
| 31 | +- Node.js 18+ |
| 32 | +- pnpm (recommended) or npm |
| 33 | +- Shopify store with Storefront API access |
| 34 | + |
| 35 | +### Installation |
| 36 | + |
| 37 | +1. Clone the repository: |
| 38 | +```bash |
| 39 | +git clone https://github.com/yourusername/hirachu.git |
| 40 | +cd hirachu |
| 41 | +``` |
| 42 | + |
| 43 | +2. Install dependencies: |
| 44 | +```bash |
| 45 | +pnpm install |
| 46 | +``` |
| 47 | + |
| 48 | +3. Set up environment variables: |
| 49 | + |
| 50 | +Create a `.env.local` file: |
| 51 | + |
| 52 | +```env |
| 53 | +NEXT_PUBLIC_SHOPIFY_STORE_DOMAIN=your-store.myshopify.com |
| 54 | +NEXT_PUBLIC_SHOPIFY_STOREFRONT_ACCESS_TOKEN=your_storefront_access_token |
| 55 | +``` |
6 | 56 |
|
| 57 | +**Getting Shopify credentials:** |
| 58 | +1. Shopify Admin → Settings → Apps and sales channels |
| 59 | +2. "Develop apps" → "Create an app" |
| 60 | +3. Configure Storefront API scopes (products, collections, cart) |
| 61 | +4. Install and copy your Storefront Access Token |
| 62 | + |
| 63 | +4. Run development server: |
7 | 64 | ```bash |
8 | | -npm run dev |
9 | | -# or |
10 | | -yarn dev |
11 | | -# or |
12 | 65 | pnpm dev |
13 | | -# or |
14 | | -bun dev |
15 | 66 | ``` |
16 | 67 |
|
17 | | -Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. |
| 68 | +Open [http://localhost:3000](http://localhost:3000) |
| 69 | + |
| 70 | +### Build for Production |
| 71 | + |
| 72 | +```bash |
| 73 | +pnpm build |
| 74 | +pnpm start |
| 75 | +``` |
| 76 | + |
| 77 | +## Project Structure |
| 78 | + |
| 79 | +``` |
| 80 | +hirachu/ |
| 81 | +├── app/ # App directory |
| 82 | +│ ├── api/ # API routes (OG images) |
| 83 | +│ ├── shop/ # Product pages |
| 84 | +│ └── ... # Static pages |
| 85 | +├── components/ # React components |
| 86 | +│ ├── sections/ # Page sections |
| 87 | +│ ├── cart/ # Cart components |
| 88 | +│ └── ... |
| 89 | +├── lib/ # Utilities |
| 90 | +│ ├── shopify.ts # Shopify client |
| 91 | +│ ├── actions.ts # Server Actions |
| 92 | +│ └── ... |
| 93 | +├── public/ # Static assets |
| 94 | +│ ├── images/ # Product images |
| 95 | +│ └── sw.js # Service worker |
| 96 | +└── ... |
| 97 | +``` |
| 98 | + |
| 99 | +## Configuration |
| 100 | + |
| 101 | +### Email Integration |
| 102 | + |
| 103 | +Add your email service in `lib/actions.ts`: |
| 104 | + |
| 105 | +```typescript |
| 106 | +// Newsletter: subscribeToNewsletter() |
| 107 | +// Contact: submitContactForm() |
| 108 | +``` |
| 109 | + |
| 110 | +Recommended: Resend, SendGrid, or Postmark. |
| 111 | + |
| 112 | +### Customization |
| 113 | + |
| 114 | +- **Colors:** `app/globals.css` |
| 115 | +- **Fonts:** `app/layout.tsx` |
| 116 | +- **Products:** Import CSV from `files/` to Shopify |
| 117 | + |
| 118 | +## Key Features |
| 119 | + |
| 120 | +### Product Search |
| 121 | +- Press `Ctrl+K` (⌘K on Mac) |
| 122 | +- Fuzzy search with instant results |
| 123 | +- ESC to close |
| 124 | + |
| 125 | +### Wishlist |
| 126 | +- Click heart icon to save products |
| 127 | +- Persisted in localStorage |
| 128 | +- Badge shows count |
| 129 | + |
| 130 | +### Cart |
| 131 | +- Add from product pages |
| 132 | +- Drawer interface |
| 133 | +- Redirects to Shopify checkout |
| 134 | + |
| 135 | +### PWA |
| 136 | +- Offline support for key pages |
| 137 | +- Auto-registers in production |
| 138 | + |
| 139 | +## Deployment |
| 140 | + |
| 141 | +### Vercel (Recommended) |
| 142 | + |
| 143 | +1. Push to GitHub |
| 144 | +2. Import in Vercel |
| 145 | +3. Add environment variables |
| 146 | +4. Deploy |
| 147 | + |
| 148 | +### Other Platforms |
18 | 149 |
|
19 | | -You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. |
| 150 | +Works on any Next.js hosting: |
| 151 | +- Netlify |
| 152 | +- Railway |
| 153 | +- Fly.io |
| 154 | +- Self-hosted |
20 | 155 |
|
21 | | -This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. |
| 156 | +## Performance |
22 | 157 |
|
23 | | -## Learn More |
| 158 | +- ISR revalidation: 1 hour |
| 159 | +- Lighthouse scores: 95+ |
| 160 | +- Image optimization |
| 161 | +- Route-based code splitting |
| 162 | +- Automatic prefetching |
24 | 163 |
|
25 | | -To learn more about Next.js, take a look at the following resources: |
| 164 | +## License |
26 | 165 |
|
27 | | -- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. |
28 | | -- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. |
| 166 | +MIT License |
29 | 167 |
|
30 | | -You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! |
| 168 | +## Author |
31 | 169 |
|
32 | | -## Deploy on Vercel |
| 170 | +**The Teleporter** |
| 171 | +- Website: [dex.codes](https://dex.codes) |
| 172 | +- Twitter: [@theteleporter_](https://x.com/theteleporter_) |
33 | 173 |
|
34 | | -The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. |
| 174 | +--- |
35 | 175 |
|
36 | | -Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. |
| 176 | +Built for doll collectors worldwide |
0 commit comments