Skip to main content
In this guide, you will:
  1. Set up a new React project with Basic
  2. Create a simple To-Do UI
  3. Connect to a Basic project and set up your schema
  4. Add sign in and sign out functionality
  5. Hook up to Basic DB so that your users can save their to-dos across their devices

Create a new React project

1

Create a new Vite React project

Terminal
2

Install Basic and Tailwind

Terminal
3

Configure Tailwind

Update tailwind.config.js:
tailwind.config.js
Replace src/index.css with:
src/index.css
4

Start your dev server

Terminal
Navigate to http://localhost:5173 to see your app running.

Create a simple To-Do UI

1

Create the basic layout

Replace the code in your src/App.tsx file:
src/App.tsx

Connect to a Basic project

1

Create a Basic account

Go to admin.basic.tech and create a free account. Then create a new project and copy your Project ID.
2

Create basic.config.ts

Create a basic.config.ts file in your project root:
basic.config.ts
3

Add BasicProvider to main.tsx

Update src/main.tsx:
src/main.tsx

Add sign in and sign out functionality

1

Add auth buttons to App.tsx

Update src/App.tsx:
src/App.tsx

Hook up to Basic DB

1

Add task creation

Update src/App.tsx to add state and the addTask function:
src/App.tsx
2

Display and delete tasks

Add useQuery to display tasks and a delete function:
src/App.tsx
And that’s it! You’ve built a local-first to-do app that allows your users to sign in and save their to-dos across their devices. Notice how snappily all the changes are reflected - from task creation to deletion. This is the power of local-first architecture!

Next steps