A modern web application starter template built with SvelteKit and Supabase, featuring authentication, real-time data capabilities, and a clean UI with Tailwind CSS.
Clone this repository
git clone https://github.com/zxdev7/sveltekit-supabase.git
cd sveltekit-supabase
Install dependencies
npm install
# or
yarn install
# or
pnpm install
Set up Supabase
.env file in the root directory based on .env.examplePUBLIC_SUPABASE_URL=your-supabase-url
PUBLIC_SUPABASE_ANON_KEY=your-supabase-anon-key
Start the development server:
npm run dev
# or
yarn dev
# or
pnpm dev
Open http://localhost:5173 with your browser to see the result.
This template assumes you have the following tables in your Supabase database:
create table profiles (
id uuid references auth.users on delete cascade not null primary key,
username text unique,
full_name text,
avatar_url text,
created_at timestamp with time zone default now() not null,
updated_at timestamp with time zone default now() not null
);
-- Enable Row Level Security
alter table profiles enable row level security;
-- Create policies
create policy "Public profiles are viewable by everyone."
on profiles for select
using (true);
create policy "Users can insert their own profile."
on profiles for insert
with check (auth.uid() = id);
create policy "Users can update their own profile."
on profiles for update
using (auth.uid() = id);
Build the application for production:
npm run build
# or
yarn build
# or
pnpm build
You can preview the production build with:
npm run preview
# or
yarn preview
# or
pnpm preview
Deploy to platforms like Vercel, Netlify, or your own hosting solution.
├── src/
│ ├── lib/
│ │ ├── components/ # Reusable components
│ │ │ └── auth/ # Authentication components
│ │ └── supabase/ # Supabase client and utilities
│ ├── routes/ # SvelteKit routes
│ │ ├── auth/ # Authentication routes
│ │ ├── dashboard/ # Dashboard page
│ │ └── profile/ # User profile page
│ ├── app.css # Global styles
│ └── app.html # HTML template
├── static/ # Static files
├── .env.example # Environment variables example
└── ... # Config files
MIT