95 | );
96 | }
97 |
98 | export default App;
99 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # Todo List App with Supabase, React, and Vite
2 |
3 | This is a simple Todo List application built with **React**, **Supabase**, and **Vite**. It allows users to create, read, update, and delete their own tasks, stored securely in a Supabase database.
4 |
5 | Check out my YouTube channel for more tutorials: [@pedrotechnologies](https://www.youtube.com/@pedrotechnologies)
6 |
7 | ## Features
8 |
9 | - Create a new todo item
10 | - Read (view) all todos created by the authenticated user
11 | - Update the name or completion status of a todo
12 | - Delete a todo item
13 |
14 | ## Technologies Used
15 |
16 | - **React**: Frontend library for building the user interface
17 | - **Supabase**: Backend as a service for managing the database and authentication
18 | - **Vite**: Build tool for fast development
19 | - **PostgreSQL**: Database for storing todo items
20 |
21 | ## Setup
22 |
23 | Follow these steps to set up the project locally.
24 |
25 | ### 1. Clone the repository
26 |
27 | Clone this repository to your local machine:
28 |
29 | ```
30 | git clone https://github.com/yourusername/todo-app.git
31 | cd todo-app
32 | ```
33 |
34 | ### 2. Install dependencies
35 |
36 | Install the required dependencies using npm:
37 |
38 | ```
39 | npm install
40 | ```
41 |
42 | ### 3. Set up Supabase
43 |
44 | 1. Go to [Supabase](https://supabase.com) and create a new project.
45 | 2. Set up your database by creating a `todos` table with the following columns:
46 | - `id` (Integer, Primary Key, Auto-increment)
47 | - `created_at` (Timestamp, default to `now()`)
48 | - `name` (Text)
49 | - `isCompleted` (Boolean)
50 | 3. Copy your Supabase **URL** and **anon key** from the project settings.
51 |
52 | ### 4. Configure Supabase Client
53 |
54 | In your project folder, create a new file named `src/supabaseClient.js` and paste the following configuration:
55 |
56 | ```javascript
57 | import { createClient } from "@supabase/supabase-js";
58 |
59 | // Initialize Supabase client with your credentials
60 | const supabaseUrl = "https://your-project-id.supabase.co";
61 | const supabaseKey = "your-public-anon-key";
62 | const supabase = createClient(supabaseUrl, supabaseKey);
63 |
64 | export default supabase;
65 | ```
66 |
67 | Replace `your-project-id` and `your-public-anon-key` with your actual Supabase credentials.
68 |
69 | ### 5. Run the Application
70 |
71 | Start the development server with:
72 |
73 | ```
74 | npm run dev
75 | ```
76 |
77 | Visit `http://localhost:5173` in your browser to see the Todo List app in action.
78 |
79 | ## Usage
80 |
81 | 1. **Create Todos**: Add a new todo by typing in the input field and clicking the "Add Todo" button.
82 | 2. **Read Todos**: View your todos listed below the input field.
83 | 3. **Update Todos**: Edit the name of a todo by clicking the "Edit" button and updating it.
84 | 4. **Mark as Completed**: Toggle the completion status of a todo by clicking the "Complete" button.
85 | 5. **Delete Todos**: Remove a todo by clicking the "Delete" button.
86 |
87 | ## Contributing
88 |
89 | Feel free to fork this project and submit pull requests for bug fixes or enhancements.
90 |
--------------------------------------------------------------------------------
/src/assets/react.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------