Hermes is a modern multi-tenant eCommerce platform built with SvelteKit and TypeScript, deployed on Cloudflare Pages with D1 database and R2 storage. It features a WYSIWYG page builder, responsive design, and comprehensive theme system. It supports role-based authentication and is designed for scalability and maintainability. It includes a robust testing suite and follows strict code quality standards. It is intended to serve as a foundation for building customizable online stores with ease. It has a modular architecture to facilitate future enhancements. It will prioritize security best practices and data integrity. It has a way for site owners to manage products, orders, and customers through an admin dashboard which will include analytics and reporting features. It will also support integrations with third-party services such as payment gateways and shipping providers. It will be optimized for performance and SEO. It has detailed documentation to assist developers in understanding and extending the platform. It has features for AI assistance in content creation and customer support. It will comply with relevant data protection regulations.
- SvelteKit - Modern web framework with TypeScript support
- Cloudflare Pages - Edge deployment for global performance
- Cloudflare D1 - Serverless SQL database with multi-tenant support
- TypeScript - Type-safe development
- Multi-Tenant Architecture - Support for multiple stores/sites
- Multi-Provider SSO - OAuth 2.0 authentication with Google, LinkedIn, Apple, Facebook, GitHub, X (Twitter), and Microsoft
- PKCE Security - Enhanced OAuth security with Proof Key for Code Exchange
- Account Linking - Automatic linking of provider accounts with same email
- Responsive Design - Mobile-first approach
- Modern Tooling - ESLint, Prettier, and Vitest configured
- Node.js 18+
- npm
# Install dependencies
npm install
# Start development server
npm run dev
# Open http://localhost:4236npm run dev- Start development server (auto-migrates and seeds database)npm run preview- Preview production build locally (auto-migrates and seeds)npm test- Run tests with Vitestnpm run test:coverage- Run tests with coverage report
npm run build- Build for productionnpm run deploy- Deploy to Cloudflare (auto-migrates database)npm run check- Type check with svelte-checknpm run lint- Run ESLintnpm run format- Format code with Prettier
npm run db:setup:local- Migrate and seed local databasenpm run db:migrate:local- Run migrations on local databasenpm run db:seed:local- Seed local database with sample datanpm run db:setup:preview- Migrate and seed preview databasenpm run db:migrate- Run migrations on production database
See docs/DATABASE_MANAGEMENT.md for detailed database management guide.
src/
βββ routes/ # SvelteKit routes
β βββ +layout.svelte
β βββ +page.svelte
βββ lib/ # Shared components and utilities
β βββ server/ # Server-side code
β β βββ db/ # Database layer (multi-tenant)
β βββ stores/ # Svelte stores
β βββ types/ # TypeScript types
β βββ utils/ # Utility functions
βββ hooks.server.ts # Server hooks (multi-tenant context)
βββ app.html # HTML template
βββ app.css # Global styles
βββ app.d.ts # Type definitions
migrations/ # D1 database migrations
docs/ # Documentation
The platform uses Cloudflare D1 for data persistence with full multi-tenant support. Database migrations and seeding are automated:
- Development: Auto-migrates and seeds when running
npm run dev - Preview: Auto-migrates and seeds when running
npm run preview - Production: Auto-migrates when deploying (seeding is blocked for safety)
# Create D1 database
wrangler d1 create hermes-db
# Update wrangler.toml with the database_id from above
# Setup database (migrate + seed for local dev)
npm run db:setup:local
# Or just run dev (database setup is automatic)
npm run dev# Local development
npm run db:migrate:local # Run migrations only
npm run db:seed:local # Seed with sample data
npm run db:setup:local # Both migrate and seed
# Production
npm run db:migrate # Run migrations only (no seed)
npm run deploy # Deploy and auto-migrateSee docs/DATABASE_MANAGEMENT.md for complete database management guide.
The project is configured for deployment on Cloudflare Pages:
- Automatic Deployment: Connect your repository to Cloudflare Pages
- Manual Deployment: Run
npm run deploywith Wrangler CLI
- Build Command:
npm run build - Output Directory:
.svelte-kit/cloudflare - Node.js Version: 18+
- D1 Database: Configured in
wrangler.toml
The project uses @sveltejs/adapter-cloudflare configured in svelte.config.js
for:
- Edge-side rendering
- Static asset optimization
- Platform proxy support
See wrangler.toml for Cloudflare Workers configuration.
This foundation includes:
- β SvelteKit project with TypeScript
- β Cloudflare Pages adapter configuration
- β Modern tooling setup (ESLint, Prettier, Vitest)
- β Basic styling and responsive layout
- β Multi-tenant architecture (site-scoped data)
- β Products, users, orders, and carts tables
- β Repository pattern for data access
- β Migration system
- β Type-safe database queries
- Payment integration
- Advanced admin features
- Inventory management
- Analytics and reporting
This project is configured with comprehensive GitHub Copilot instructions to ensure:
- β Consistent Code Quality: Automatic adherence to project standards
- β Test Coverage: Enforced 80%+ coverage (target: 90%)
- β Type Safety: Strict TypeScript with explicit return types
- β Formatting: Automatic Prettier formatting (2 spaces, single quotes, no trailing commas)
- β TDD Approach: Tests written before implementation
Before ANY code is considered complete:
npm run prepare # Runs format, lint, check, and testAll code must pass:
npm run format- Prettier formattingnpm run lint- ESLint checksnpm run check- TypeScript type checkingnpm run test:coverage- Test coverage β₯80%
See docs/GITHUB_COPILOT_SETUP.md for complete Copilot configuration details.
- Fork the repository
- Create a feature branch
- Make your changes following GitHub Copilot Guidelines
- Run
npm run prepareto verify quality gates - Submit a pull request