2025-05-22 18:31:49 -05:00
2025-05-13 09:28:44 -05:00
2025-05-20 14:53:53 -05:00
2025-05-13 09:28:44 -05:00
2025-05-13 09:28:44 -05:00
2025-05-22 18:31:49 -05:00

T3 Template with Self Hosted Supabase

This is my template for self hosting both Next.js & Supabase in order to create a perfect app!!

What to do

  • Self Host Supabase
    • You will need to make sure you have some way to connect to the postgres database from the host. I had to remove the database port from the supabase-pooler and add it to the supabase-db in order to directly connect to it. This will be important for generating our types.
  • Clone this repo.
  • Go to src/server/db/schema.sql & run this SQL in the SQL editor on the Web UI of your Supabase instance.
  • Generate your types
    • This part is potentially super weird if you are self hosting. If you are connecting directly to your database that you plan to use for production, you will need to clone your repo on the host running supabase so that you can then use the supabase cli tool. Once you have done that, you will need to install the supabase-cli tool with sudo. I just run something like sudo npx supabase --help and then accept the prompt to install the program. Once you have done this, you can then run the following command, replacing the password and the port to match your supabase database. You can also try running the provided script ./scripts/generate_types
sudo npx supabase gen types typescript \
--db-url "postgres://postgres:password@localhost:5432/postgres" \
--schema public \
> ./src/lib/types
Description
Template App for T3 Stack using Supabase
Readme 999 KiB
Languages
TypeScript 68.9%
PLpgSQL 8.8%
HTML 7.3%
Shell 3.8%
JavaScript 3%
Other 8.2%