A production-ready e-commerce starter kit with SvelteKit frontend and Go Echo backend.
| Frontend | Backend |
|---|---|
| SvelteKit 5 | Go Echo v4 |
| Tailwind CSS 4 | GORM |
| TypeScript | PostgreSQL/SQLite |
| Lucide Icons | JWT Auth |
cd backend
# Copy environment file
cp .env.example .env
# Edit .env with your settings
# DATABASE_URL=./data/starterkit.db (SQLite for dev)
# DATABASE_URL=postgres://user:pass@host:5432/db (PostgreSQL for prod)
# JWT_SECRET=change-this-to-a-secure-random-string
# Install dependencies
go mod tidy
# Run database migrations (creates tables)
go run cmd/main.go -migrate
# Seed default data (admin user)
go run cmd/main.go -seed
# Start development server
make dev
# or
go run cmd/main.go
Backend runs on: http://localhost:3078
cd frontend
# Install dependencies
npm install
# Start development server
npm run dev
Frontend runs on: http://localhost:5173
After seeding:
| Role | Username | Password |
|---|---|---|
| Admin | admin | admin123 |
| Staff | staff | staff123 |
Important: Change these immediately in production!
svelte-go-starterkit/
├── backend/
│ ├── cmd/main.go # Entry point
│ ├── internal/
│ │ ├── config/ # Configuration
│ │ ├── handler/ # HTTP handlers (in service package)
│ │ ├── middleware/ # Auth, Role middleware
│ │ ├── model/ # Database models
│ │ ├── repository/ # Data access layer
│ │ ├── service/ # Business logic
│ │ └── payment/ # Payment gateway interface
│ └── pkg/utils/ # Shared utilities
│
└── frontend/
└── src/
├── lib/
│ ├── api/ # API client
│ ├── stores/ # Svelte stores (auth, theme)
│ └── components/ # UI components
└── routes/
├── +page.svelte # Landing page
├── (auth)/ # Login, Register
├── (app)/ # Customer dashboard
└── admin/ # Admin panel
| Method | Path | Description |
|---|---|---|
| GET | /api/public/settings |
App branding & config |
| POST | /api/auth/register |
Customer registration |
| POST | /api/auth/login |
Login |
| POST | /api/auth/refresh |
Refresh access token |
| Method | Path | Description |
|---|---|---|
| GET | /api/customer/me |
Get current user |
| PUT | /api/customer/profile |
Update profile |
| GET | /api/customer/orders |
List own orders |
| GET | /api/customer/orders/:id |
Get order details |
| Method | Path | Description |
|---|---|---|
| GET | /api/admin/users |
List users |
| POST | /api/admin/users |
Create user |
| GET | /api/admin/products |
List products |
| POST | /api/admin/products |
Create product |
| PUT | /api/admin/products/:id |
Update product |
| DELETE | /api/admin/products/:id |
Delete product |
| GET | /api/admin/orders |
List all orders |
| PUT | /api/admin/orders/:id |
Update order |
| GET | /api/admin/activity-logs |
Activity logs |
| GET/PUT | /api/admin/settings |
Settings |
| Role | Permissions |
|---|---|
| admin | All permissions |
| manager | manage_orders, manage_products, view_reports |
| staff | view_orders, update_order_status |
| customer | own_orders, own_profile |
OTP can be enabled via settings:
# In admin settings panel or directly in database:
otp_enabled = true
otp_provider = whatsapp # or email, sms
Users can customize the theme via settings:
{
"ui_theme_mode": "dark" | "light",
"ui_theme_primary": "#0ea5e9"
}
Available color presets: Sky, Blue, Pink, Violet, Rose, Emerald, Amber, Orange
# Backend
cd backend
go test ./...
# Frontend
cd frontend
npm run test
# Backend
cd backend
make build
# Binary: bin/server
# Frontend
cd frontend
npm run build
# Output: frontend/build/
MIT