This is a starter kit for React with Next.js and Typescript. It includes an optional SDK and Supabase database.
- Install bun
curl -fsSL https://bun.sh/install | bash
- Clone the repository
git clone https://github.com/seanwessmith/starter-kit
- In the repo root
bun install
to install the dependencies - In the repo root
bun start
to start the project
- New pages go in
/app/[page name]/page.tsx
. Where page name is the name of the page and the route. - Update /app/clientComponent.tsx to navigate to the appropriate page.
- New sdk routes go in
/src/server/routers/[route name]
. Where route name is the new route. - Create an
/src/server/routers/[route name]/index.ts
file that will mergeRouters from sibling files. - Create sibling files with the second route name
/src/server/routers/[route name]/[second route name].ts
.
-
In the repo root install Supabase cli
brew install supabase/tap/supabase
-
In the repo root run
supabase login
-
In the repo root run
bun supabase:create:demo
-
Open the SQL editor on supabase.com. replace XXXXX with your project id ex:
https://supabase.com/dashboard/project/XXXXX/sql
-
In the Supabase sql text area run:
CREATE TABLE people ( id bigint primary key generated always as identity, name VARCHAR(255) NOT NULL, title VARCHAR(255) NOT NULL, startDateTimestamp TIMESTAMP NOT NULL ); INSERT INTO people (name, title, startDateTimestamp) VALUES ('John Doe', 'Software Engineer', timestamp '2021-01-01 00:00:00.001'), ('Jane Doe', 'Product Manager', timestamp '2022-02-02 00:00:00.001'), ('Alice Doe', 'Designer', timestamp '2023-03-03 00:00:00.001'), ('Bob Doe', 'QA Engineer', timestamp '2024-04-04 00:00:00.001');
-
Back in the repo root run
bun run supabase:types
. -
Uncomment
/app/about/page.tsx
supabase lines. comment out the SDK lines. Alternatively you can comment out the Supabase lines in the SDK if you'd prefer for supabase calls to come from the server. -
[NOTE] Anytime the schema changes run
bun run supabase:types
.