Ayfri

antawwtodo-list by antaww

No description provided.

Svelte
0 stars
0 forks
5/15/2025

โœจ Svelte Todo List

Live Demo

A modern, reactive todo list application built with Svelte, TypeScript, and Supabase. Features real-time updates, multiple lists support, and a beautiful glassmorphism design.

๐Ÿš€ Features

  • โœ… Real-time updates with Supabase
  • ๐Ÿ“ Multiple todo lists support
  • ๐ŸŽจ Modern glassmorphism UI design
  • ๐Ÿ”„ Smooth animations and transitions
  • โšก Optimistic updates for instant feedback
  • ๐Ÿ”ผ Task reordering with up/down arrows
  • ๐Ÿ“ฑ Fully responsive design
  • ๐Ÿ”„ Automatic polling fallback for real-time updates
  • ๐Ÿ–Š๏ธ Inline editing for todos and list titles
  • ๐ŸŽฏ Focus mode while editing
  • ๐Ÿ—‘๏ธ Automatic cleanup of empty lists

๐Ÿ› ๏ธ Tech Stack

๐Ÿ—๏ธ Project Structure

todo-list/
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ lib/
โ”‚   โ”‚   โ”œโ”€โ”€ TodoList.svelte    # Main todo list component
โ”‚   โ”‚   โ”œโ”€โ”€ supabase.ts        # Supabase client configuration
โ”‚   โ”‚   โ””โ”€โ”€ types.ts           # TypeScript interfaces
โ”‚   โ”œโ”€โ”€ App.svelte             # Root component
โ”‚   โ”œโ”€โ”€ app.css                # Global styles
โ”‚   โ””โ”€โ”€ main.ts                # Application entry point
โ””โ”€โ”€ supabase/                  # Supabase configuration and migrations

๐Ÿšฆ Getting Started

  1. Clone the repository:
git clone https://github.com/antaww/todo-list.git
cd todo-list
  1. Install dependencies:
pnpm install
  1. Create a .env file with your Supabase credentials:
VITE_SUPABASE_URL=your_supabase_url
VITE_SUPABASE_ANON_KEY=your_supabase_anon_key
  1. Start the development server:
pnpm run dev

๐Ÿ“ Database Schema

Todos Table

CREATE TABLE todos (
  id TEXT PRIMARY KEY,
  title TEXT NOT NULL,
  completed BOOLEAN DEFAULT FALSE,
  order INTEGER,
  list_id TEXT NOT NULL,
  created_at TIMESTAMPTZ DEFAULT NOW()
);

Lists Table

CREATE TABLE lists (
  id TEXT PRIMARY KEY,
  title TEXT NOT NULL DEFAULT 'Untitled List',
  created_at TIMESTAMPTZ DEFAULT NOW()
);

-- Enable Row Level Security
ALTER TABLE lists ENABLE ROW LEVEL SECURITY;

-- Allow public access
CREATE POLICY "Allow public access on lists"
  ON lists
  FOR ALL
  TO public
  USING (true)
  WITH CHECK (true);

๐Ÿ”„ Real-time Updates

The application uses Supabase's real-time functionality to keep todos synchronized across all clients. As a fallback mechanism, it also implements polling to ensure updates are received even if the real-time connection is interrupted.

๐Ÿงน Automatic Cleanup

Empty lists (lists without any todos) are automatically cleaned up from the database to maintain data consistency. This is handled by a SQL trigger that removes lists when their last todo is deleted.

๐Ÿค Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

Statistics

0Stars
0Forks
2Watchers
0Issues
120Commits
2Contributors
637 KBSize

Timeline

Created1/17/2025
Last Updated5/15/2025
Last Push5/15/2025

Status

VisibilityPublic
TemplateNo
ArchivedNo
ForkNo