A simple todo application built with React, TypeScript, and Supabase, featuring GitHub authentication and real-time updates.
- Clone the repository
- Install dependencies:
npm install
-
Create your environment file:
- Copy the
env.example
file to.env
:
cp .env.example .env
- Update the
.env
file with your Supabase credentials:VITE_SUPABASE_URL
: Your Supabase project URLVITE_SUPABASE_KEY
: Your Supabase project's anon/public key
- Copy the
-
Start the development server:
npm run dev
- GitHub Authentication
- Create, read, update, and delete todos
- Mark todos as complete/incomplete
- Real-time updates
- Responsive design with Tailwind CSS
- React
- TypeScript
- Vite
- Supabase
- Tailwind CSS
- @supabase/auth-ui-react for authentication UI
The application requires a todos
table in your Supabase database with the following schema:
create table todos (
id bigint generated by default as identity primary key,
user_id uuid references auth.users not null,
task text not null,
is_complete boolean default false,
created_at timestamp with time zone default timezone('utc'::text, now()) not null
);
-- Enable Row Level Security
alter table todos enable row level security;
-- Create policy to only allow users to see their own todos
create policy "Users can only see their own todos" on todos
for all using (auth.uid() = user_id);
The application uses environment variables for configuration. A template file .env.example
is provided with all required variables. To configure:
- Copy
.env.example
to.env
- Replace the placeholder values with your actual Supabase credentials
Required variables:
Variable | Description |
---|---|
VITE_SUPABASE_URL | Your Supabase project URL |
VITE_SUPABASE_KEY | Your Supabase project's anon/public key |
You can find these values in your Supabase project settings under Project Settings > API.
To start the development server:
npm run dev
To build for production:
npm run build
To preview the production build:
npm run preview