• Townie
    AI
  • Blog
  • Docs
  • Pricing
  • We’re hiring!
Log inSign up
lee_roy

lee_roy

Test2

Public
Like
Test2
Home
Code
4
backend
5
frontend
1
shared
2
README.md
Branches
1
Pull requests
Remixes
History
Environment variables
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.
Sign up now
Code
/
Code
/
Search
index.ts
https://lee_roy--d22a1a763e6511f09d1c76b3cceeab13.web.val.run
README.md

IoT Solutions Company Website

A professional, scalable eCommerce platform for IoT devices and solutions with comprehensive admin panel, secure payments, and lead management.

πŸš€ Features

Core Functionality

  • 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

Technical Stack

  • 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

πŸ“ Project Structure

β”œβ”€β”€ 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

πŸ—„οΈ Database Schema

Users

  • Authentication and profile management
  • Role-based access (customer, admin)

Products

  • IoT device catalog with specs and pricing
  • Categories and inventory tracking

Orders

  • Purchase transactions and order history
  • Payment and shipping status

Solutions

  • IoT solution offerings and descriptions
  • Lead capture and inquiry management

Analytics

  • Sales metrics and lead generation stats

πŸ” Security Features

  • JWT-based authentication
  • Role-based access control
  • Input validation and sanitization
  • Secure payment processing with Stripe
  • Environment variable protection

πŸš€ Getting Started

  1. Set up environment variables in Val Town:

    • STRIPE_SECRET_KEY: Your Stripe secret key
    • JWT_SECRET: Secret for JWT token signing
    • ADMIN_EMAIL: Default admin email
  2. The backend will automatically create database tables on first run

  3. Access the application at your Val Town URL

πŸ“± API Endpoints

Authentication

  • POST /api/auth/register - User registration
  • POST /api/auth/login - User login
  • POST /api/auth/refresh - Token refresh

Products

  • GET /api/products - List products
  • GET /api/products/:id - Get product details
  • POST /api/products - Create product (admin)
  • PUT /api/products/:id - Update product (admin)

Orders

  • POST /api/orders - Create order
  • GET /api/orders - Get user orders
  • GET /api/orders/:id - Get order details

Solutions

  • GET /api/solutions - List IoT solutions
  • POST /api/solutions/inquire - Submit solution inquiry

Admin

  • GET /api/admin/dashboard - Dashboard stats
  • GET /api/admin/orders - Manage orders
  • GET /api/admin/customers - Manage customers

🎨 UI/UX Features

  • Responsive design with Tailwind CSS
  • Modern component library
  • Professional IoT industry styling
  • Intuitive admin dashboard
  • Mobile-optimized checkout flow

πŸ“ˆ Analytics & Monitoring

  • Sales performance tracking
  • Lead generation metrics
  • Customer behavior analytics
  • Inventory monitoring
HTTP
  • index.ts
    lee_roy--d2…13.web.val.run
Code
backendfrontendsharedREADME.md
FeaturesVersion controlCode intelligenceCLI
Use cases
TeamsAI agentsSlackGTM
DocsShowcaseTemplatesNewestTrendingAPI examplesNPM packages
PricingNewsletterBlogAboutCareers
We’re hiring!
Brandhi@val.townStatus
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Terms of usePrivacy policyAbuse contact
Β© 2025 Val Town, Inc.