A modern, passwordless Single Sign-On (SSO) authentication frontend built with SvelteKit 5, providing seamless authentication through social providers (Google, GitHub) and email OTP verification.
🔐 Passwordless Authentication
⚡ Modern Tech Stack
🎨 Beautiful UI/UX
🔄 Token Management
🚀 Production Ready
@sveltejs/adapter-staticVITE_API_URL)Clone the repository
git clone <repository-url>
cd sso_web_v1
Install dependencies
npm install
# or
pnpm install
# or
yarn install
Configure environment variables
Create a .env file in the root directory:
VITE_API_URL=http://localhost:8181/api/v1
Start the development server:
npm run dev
# or start and open in browser
npm run dev -- --open
The application will be available at http://localhost:5173 (default Vite port).
Create a production build:
npm run build
Preview the production build:
npm run preview
sso_web_v1/
├── src/
│ ├── routes/
│ │ ├── +page.svelte # Main login page
│ │ ├── +layout.svelte # Root layout with SEO
│ │ └── success/
│ │ └── +page.svelte # Success redirect page
│ ├── helper/
│ │ └── axios.ts # Axios instance with interceptors
│ ├── lib/
│ │ └── index.ts # Library exports
│ ├── app.css # Global styles & Tailwind config
│ ├── app.html # HTML template
│ └── app.d.ts # TypeScript declarations
├── static/ # Static assets
│ ├── bg-auth-2.png # Login background
│ ├── bg-auth-success.png # Success background
│ ├── favicon.ico # Favicon
│ └── site.webmanifest # PWA manifest
├── package.json
├── svelte.config.js # SvelteKit configuration
├── vite.config.ts # Vite configuration
└── tsconfig.json # TypeScript configuration
The application expects the following backend endpoints:
POST /auth/otp - Request OTP codePOST /auth/otp/verify - Verify OTP codeGET /auth/social/google - Google OAuthGET /auth/social/github - GitHub OAuthPOST /auth/refresh - Refresh access token| Variable | Description | Default |
|---|---|---|
VITE_API_URL |
Backend API base URL | http://localhost:8181/api/v1 |
Update branding in src/routes/+layout.svelte:
Modify src/app.css to customize:
Replace images in static/ directory:
bg-auth-2.png - Login page backgroundbg-auth-success.png - Success page background^2.16.0 - Full-stack framework^5.0.0 - UI framework^5.5.0 - Type safety^0.48.4 - Component library^2.1.0 - Icon set^4.0.0 - Utility-first CSS^1.9.0 - HTTP client^0.0.9 - OTP input componentThis project uses @sveltejs/adapter-static for static site generation. Deploy to:
npm run build → Deploy build/ directorysvelte.config.jsbuild/ directoryThe static adapter generates:
| Script | Description |
|---|---|
npm run dev |
Start development server |
npm run build |
Build for production |
npm run preview |
Preview production build |
npm run check |
Run type checking |
npm run check:watch |
Type checking in watch mode |
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)+page.svelte?redirect= query parameterhttps://1001api.comEnable popups in browser settings for the application domain.
/auth/refresh endpoint