1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { Product } from "../../shared/types";
4
8}
9
10const ProductList: React.FC<ProductListProps> = ({ products, onProductSelect }) => {
11 if (products.length === 0) {
12 return (
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3
4interface HeaderProps {
9}
10
11const Header: React.FC<HeaderProps> = ({
12 cartItemCount,
13 onCartClick,
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
3import { Product, Cart, CartItem } from "../../shared/types";
4import ProductList from "./ProductList";
17}
18
19const App: React.FC<AppProps> = ({ initialProducts, projectInfo }) => {
20 const [products, setProducts] = useState<Product[]>(initialProducts);
21 const [selectedProduct, setSelectedProduct] = useState<Product | null>(null);
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import App from "./components/App";
5import { InitialData } from "../shared/types";
24const root = createRoot(document.getElementById("app")!);
25root.render(
26 <React.StrictMode>
27 <App
28 initialProducts={initialData.products}
29 projectInfo={initialData.projectInfo}
30 />
31 </React.StrictMode>
32);
19 <div id="app" class="min-h-screen flex flex-col"></div>
20
21 <!-- React app entry point -->
22 <script type="module" src="/frontend/index.tsx"></script>
23</body>
11โ โโโ routes/ # API route handlers
12โโโ frontend/
13โ โโโ components/ # React components
14โ โโโ index.html # Main HTML template
15โ โโโ index.tsx # Frontend entry point
30
31- Backend: Hono framework on Val Town
32- Frontend: React with Tailwind CSS
33- Data: Shopify API integration
34- Deployment: Val Town HTTP trigger
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3
4export default function Header() {
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React, { useState, useEffect } from "https://esm.sh/react@18.2.0";
3import { Property, PropertyFilters, ProjectInfo } from "../../shared/types.ts";
4import Header from "./Header.tsx";
1/** @jsxImportSource https://esm.sh/react@18.2.0 */
2import React from "https://esm.sh/react@18.2.0";
3import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
4import App from "./components/App.tsx";
5
16const root = createRoot(document.getElementById("app")!);
17root.render(
18 <React.StrictMode>
19 <App initialData={window.__INITIAL_DATA__} />
20 </React.StrictMode>
21);
14
15- `/backend` - Server-side code using Hono for API endpoints and SQLite for data storage
16- `/frontend` - Client-side code using React and TailwindCSS
17- `/shared` - Shared types and utilities used by both frontend and backend
18
25- Hono (Backend API framework)
26- SQLite (Database)
27- React (Frontend UI)
28- TailwindCSS (Styling)
29- TypeScript (Type safety)
Starter template with client-side React & Hono server
Starter template with client-side React & Hono server
Write business logic with ease
Meet the new standard for modern TypeScript development.
Type-safe, reactive, framework-agnostic library to manage your business logic.
Follow me if you learn more about JavaScript | TypeScript | React.js | Next.js | Linux | NixOS | Frontend Developer | https://linktr.ee/officialrajdeepsingh