Test2
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data β all from the browser, and deployed in milliseconds.
index.ts
https://lee_roy--d22a1a763e6511f09d1c76b3cceeab13.web.val.run
A professional, scalable eCommerce platform for IoT devices and solutions with comprehensive admin panel, secure payments, and lead management.
- Product Storefront: Browse IoT devices, view specs, add to cart, secure checkout
- IoT Solutions Portal: Showcase vertical solutions with lead capture
- Admin Panel: Manage products, orders, customers, and analytics
- Customer Accounts: Order history, invoices, shipping tracking
- Secure Payments: Stripe integration for transactions
- Frontend: React 18 with TypeScript and Tailwind CSS
- Backend: Hono (modern web framework) with TypeScript
- Database: SQLite (Val Town hosted)
- Authentication: JWT with role-based access
- Storage: Val Town Blob storage for images/files
- Email: Val Town email service
- Payments: Stripe integration
βββ backend/
β βββ database/
β β βββ migrations.ts # Database schema setup
β β βββ queries.ts # Database query functions
β β βββ README.md
β βββ routes/
β β βββ auth.ts # Authentication routes
β β βββ products.ts # Product management
β β βββ orders.ts # Order processing
β β βββ solutions.ts # IoT solutions
β β βββ admin.ts # Admin panel APIs
β β βββ static.ts # Static file serving
β βββ middleware/
β β βββ auth.ts # JWT middleware
β β βββ validation.ts # Request validation
β βββ services/
β β βββ stripe.ts # Payment processing
β β βββ email.ts # Email notifications
β β βββ analytics.ts # Analytics tracking
β βββ index.ts # Main entry point
β βββ README.md
βββ frontend/
β βββ components/
β β βββ common/ # Shared components
β β βββ product/ # Product-related components
β β βββ admin/ # Admin panel components
β β βββ layout/ # Layout components
β βββ pages/ # Page components
β βββ hooks/ # Custom React hooks
β βββ utils/ # Frontend utilities
β βββ index.html # Main HTML template
β βββ index.tsx # Frontend entry point
β βββ README.md
βββ shared/
β βββ types.ts # Shared TypeScript types
β βββ constants.ts # Shared constants
β βββ utils.ts # Shared utility functions
βββ README.md
- Authentication and profile management
- Role-based access (customer, admin)
- IoT device catalog with specs and pricing
- Categories and inventory tracking
- Purchase transactions and order history
- Payment and shipping status
- IoT solution offerings and descriptions
- Lead capture and inquiry management
- Sales metrics and lead generation stats
- JWT-based authentication
- Role-based access control
- Input validation and sanitization
- Secure payment processing with Stripe
- Environment variable protection
-
Set up environment variables in Val Town:
STRIPE_SECRET_KEY
: Your Stripe secret keyJWT_SECRET
: Secret for JWT token signingADMIN_EMAIL
: Default admin email
-
The backend will automatically create database tables on first run
-
Access the application at your Val Town URL
POST /api/auth/register
- User registrationPOST /api/auth/login
- User loginPOST /api/auth/refresh
- Token refresh
GET /api/products
- List productsGET /api/products/:id
- Get product detailsPOST /api/products
- Create product (admin)PUT /api/products/:id
- Update product (admin)
POST /api/orders
- Create orderGET /api/orders
- Get user ordersGET /api/orders/:id
- Get order details
GET /api/solutions
- List IoT solutionsPOST /api/solutions/inquire
- Submit solution inquiry
GET /api/admin/dashboard
- Dashboard statsGET /api/admin/orders
- Manage ordersGET /api/admin/customers
- Manage customers
- Responsive design with Tailwind CSS
- Modern component library
- Professional IoT industry styling
- Intuitive admin dashboard
- Mobile-optimized checkout flow
- Sales performance tracking
- Lead generation metrics
- Customer behavior analytics
- Inventory monitoring