A professional, scalable eCommerce platform for IoT devices and solutions with comprehensive admin panel, secure payments, and lead management.
āāā 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
Set up environment variables in Val Town:
STRIPE_SECRET_KEY: Your Stripe secret keyJWT_SECRET: Secret for JWT token signingADMIN_EMAIL: Default admin emailThe 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 refreshGET /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 detailsGET /api/solutions - List IoT solutionsPOST /api/solutions/inquire - Submit solution inquiryGET /api/admin/dashboard - Dashboard statsGET /api/admin/orders - Manage ordersGET /api/admin/customers - Manage customers