A modern, responsive todo application built with SvelteKit and Supabase. Stay organized and get things done with a clean, intuitive interface.
git clone <repository-url>
cd my-todo-app
npm install
Create a .env
file in the root directory:
PUBLIC_SUPABASE_URL=your-supabase-project-url
PUBLIC_SUPABASE_PUBLISHABLE_KEY=your-supabase-anon-key
Get these values from your Supabase Dashboard โ Settings โ API.
Run this SQL in your Supabase SQL Editor to create the todos table:
-- Enable Row Level Security
create table if not exists todos (
id uuid default gen_random_uuid() primary key,
user_id uuid references auth.users(id) on delete cascade not null,
task text not null,
is_done boolean default false,
created_at timestamp with time zone default timezone('utc'::text, now()) not null,
updated_at timestamp with time zone default timezone('utc'::text, now()) not null
);
-- Enable RLS
alter table todos enable row level security;
-- Create policies
create policy "Users can view their own todos" on todos
for select using (auth.uid() = user_id);
create policy "Users can create their own todos" on todos
for insert with check (auth.uid() = user_id);
create policy "Users can update their own todos" on todos
for update using (auth.uid() = user_id);
create policy "Users can delete their own todos" on todos
for delete using (auth.uid() = user_id);
npm run dev
Visit http://localhost:5173 to see your app! ๐
src/
โโโ lib/
โ โโโ components/
โ โ โโโ ui/ # Reusable UI components
โ โ โโโ Auth.svelte # Authentication component
โ โ โโโ TodoApp.svelte# Main todo application
โ โ โโโ TodoItem.svelte# Individual todo item
โ โโโ database.types.ts # TypeScript definitions
โ โโโ supabase.ts # Supabase client
โ โโโ utils.ts # Utility functions
โโโ routes/
โ โโโ +layout.svelte # App layout
โ โโโ +layout.server.ts# Layout server logic
โ โโโ +page.svelte # Home page
โ โโโ +page.server.ts # Page server actions
โ โโโ auth/ # Authentication routes
โโโ app.html # HTML template
The project includes comprehensive unit tests using Vitest with TypeScript support.
src/
โโโ lib/
โ โโโ utils.test.ts # Utility function tests
โ โโโ formatters.test.ts # Date formatting and helper tests
โโโ demo.spec.ts # Demo test file
# Run all tests
npm run test
# Run tests in watch mode
npm run test:unit
# Run tests with coverage
npm run test -- --coverage
# Development
npm run dev # Start dev server
npm run build # Build for production
npm run preview # Preview production build
# Quality
npm run check # Type checking
npm run check:watch # Type checking in watch mode
npm run lint # Run ESLint
npm run format # Format code with Prettier
# Testing
npm run test # Run all tests
npm run test:unit # Run unit tests
The app uses a custom component library built on top of Tailwind CSS:
Configured with:
Strict TypeScript configuration with:
git checkout -b feature/amazing-feature
)git commit -m 'Add amazing feature'
)git push origin feature/amazing-feature
)This project is open source and available under the MIT License.
Built with โค๏ธ using SvelteKit and Supabase