This repository is a modular template for building Svelte-based applications. It provides a collection of reusable components and modules designed to accelerate the development of future projects, eliminating the need to rebuild common functionality from scratch.
The template contains pre-built, production-ready modules including authentication forms, payment processing forms (mock integration layer), user profile management, and responsive UI components. The primary goal is to serve as an internal development accelerator - a kit of battle-tested components that can be dropped into new projects.
src/
├── lib/
│ ├── components/ # AuthForm, PaymentForm, WelcomeCard, ThemeToggle, LanguageToggle
│ ├── stores/ # themeStore, languageStore, authStore
│ ├── i18n/ # translations for ru/en, i18n store
│ └── layouts/ # BaseLayout.svelte
├── routes/
│ ├── +layout.svelte # Main layout with theme and language integration
│ └── +page.svelte # Home page with WelcomeCard
├── app.html
└── app.css
Create a .env file based on .env.example:
PUBLIC_APP_NAME=ModularSvelteBase
PUBLIC_APP_URL=http://localhost:5173
PUBLIC_AUTH_API_URL=https://your-auth-api.com
AUTH_SECRET=your-secret-key-here
PUBLIC_PAYMENT_PROVIDER=stripe
PUBLIC_STRIPE_PUBLIC_KEY=pk_test_xxx
STRIPE_SECRET_KEY=sk_test_xxx
PUBLIC_BASE_PATH=/
Variables with PUBLIC_ prefix are accessible on the client side.
# Clone the repository
git clone https://github.com/your-repo/modular-svelte-template.git
cd modular-svelte-template
# Run setup script
./scripts/setup.sh
# Or manually:
npm install
cp .env.example .env
npm run build
{
"dev": "vite dev",
"build": "vite build",
"preview": "vite preview",
"check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
"lint": "eslint .",
"format": "prettier --write .",
"setup": "./scripts/setup.sh"
}
The scripts/setup.sh script performs:
.env from .env.example if missingnpm run dev # Start development server
npm run build # Build for production
npm run preview # Preview production build
| Module | Description |
|---|---|
| AuthForm | Login, registration, password recovery forms |
| PaymentForm | Payment form with mock integration layer |
| WelcomeCard | Welcome component with project description and theme/language toggles |
| ThemeToggle | Light/dark theme switcher |
| LanguageToggle | RU/EN language switcher |
MIT
This is an internal template for team use. For suggestions or issues, contact the development team.