Project Structure
Understanding the SvelteBolt folder structure to help you navigate and modify the codebase effectively.
Folder Tree
sveltebolt/
├── src/ # Main application source code
│ ├── routes/ # 🔥 SvelteKit routes (pages)
│ │ ├── (landing)/ # Landing page routes
│ │ │ ├── +page.svelte # Homepage
│ │ │ └── contact/ # Contact page
│ │ ├── auth/ # Authentication routes
│ │ │ ├── login/ # Login page
│ │ │ └── signup/ # Signup page
│ │ ├── dashboard/ # 🔥 Protected dashboard routes
│ │ │ ├── +page.svelte # Dashboard home
│ │ │ ├── settings/ # Settings pages
│ │ │ └── premium-feature/ # Premium content example
│ │ ├── api/ # API endpoints
│ │ │ ├── auth/ # Auth API routes
│ │ │ └── stripe/ # Stripe webhook handlers
│ │ ├── legal/ # Legal pages
│ │ ├── payment/ # Payment success/cancel pages
│ │ ├── +layout.svelte # Root layout
│ │ └── +layout.server.ts # Server-side layout logic
│ ├── lib/ # 🔥 Shared utilities and components
│ │ ├── components/ # Reusable UI components
│ │ │ ├── ui/ # shadcn-svelte components
│ │ │ ├── landing/ # Landing page components
│ │ │ ├── login-form.svelte
│ │ │ ├── signup-form.svelte
│ │ │ └── app-sidebar.svelte
│ │ ├── server/ # Server-side utilities
│ │ │ ├── database.ts # Supabase client setup
│ │ │ └── stripe.ts # Stripe configuration
│ │ ├── stripe/ # Stripe utilities
│ │ ├── config.ts # 🔥 App configuration
│ │ └── utils.ts # Utility functions
│ ├── app.css # Global styles
│ ├── app.html # HTML template
│ └── hooks.server.ts # 🔥 Server hooks for auth
├── static/ # Static assets
│ ├─ ─ favicon.ico
│ └── avatars/ # User avatar images
├── supabase/ # Database configuration
│ ├── config.toml # Supabase project config
│ └── migrations/ # Database migrations
├── .env.example # Environment variables template
├── package.json # Dependencies and scripts
├── svelte.config.js # SvelteKit configuration
├── tailwind.config.js # Tailwind CSS configuration
├── tsconfig.json # TypeScript configuration
└── vite.config.ts # Vite build configuration
Key Files to Modify
🔥 Most Important Files
src/lib/config.ts
- App configuration, API keys, and settingssrc/hooks.server.ts
- Authentication logic and session handlingsrc/routes/+layout.server.ts
- Global server-side data loadingsupabase/migrations/
- Database schema and tables
Core Routes Structure
src/routes/(landing)/+page.svelte
- Landing pagesrc/routes/dashboard/+page.svelte
- Dashboard homesrc/routes/auth/
- Authentication pagessrc/routes/api/
- Backend API endpoints
Component Organization
src/lib/components/ui/
- Base UI components (shadcn-svelte)src/lib/components/landing/
- Landing page specific componentssrc/lib/components/*.svelte
- Shared form and layout components
Configuration Files
.env
- Environment variables (create from.env.example
)supabase/config.toml
- Supabase project configurationtailwind.config.js
- UI styling configuration
Route Patterns
SvelteBolt uses SvelteKit's file-based routing:
(landing)
- Route group for public pagesdashboard
- Protected routes requiring authenticationapi
- Server-side API endpoints+page.svelte
- Page component+layout.svelte
- Layout wrapper+page.server.ts
- Server-side page logic
Next Steps
- Explore the environment variables
- Set up your Supabase database
- Configure Stripe payments