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