-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from hcs-t4sg/supabase
Supabase Setup
- Loading branch information
Showing
17 changed files
with
501 additions
and
487 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ | |
"files.associations": { | ||
"*.css": "tailwindcss" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,20 +3,20 @@ | |
- [T4SG Starter Project](#t4sg-starter-project) | ||
- [Introduction](#introduction) | ||
- [Setup](#setup) | ||
- [Clone repository](#clone-repository) | ||
- [Package installation](#package-installation) | ||
- [Supabase Connection Setup](#supabase-connection-setup) | ||
- [Supabase Database Setup](#supabase-database-setup) | ||
- [Supabase CLI Setup](#supabase-cli-setup) | ||
- [Run the webapp](#run-the-webapp) | ||
- [(Recommended) Configure git message template](#recommended-configure-git-message-template) | ||
- [Clone repository](#clone-repository) | ||
- [Package installation](#package-installation) | ||
- [Supabase Connection Setup](#supabase-connection-setup) | ||
- [Supabase Database Setup](#supabase-database-setup) | ||
- [Supabase CLI Setup](#supabase-cli-setup) | ||
- [Run the webapp](#run-the-webapp) | ||
- [(Recommended) Configure git message template](#recommended-configure-git-message-template) | ||
- [Stack references](#stack-references) | ||
- [Typescript](#typescript) | ||
- [Components and Styling: `shadcn/ui`, Radix, and Tailwind CSS](#components-and-styling-shadcnui-radix-and-tailwind-css) | ||
- [Next.js](#nextjs) | ||
- [Tips for learning:](#tips-for-learning) | ||
- [Supabase](#supabase) | ||
- [Troubleshooting the Supabase CLI](#troubleshooting-the-supabase-cli) | ||
- [Troubleshooting the Supabase CLI](#troubleshooting-the-supabase-cli) | ||
- [Environment variables](#environment-variables) | ||
- [Development tools](#development-tools) | ||
- [Code formatting and linting tools](#code-formatting-and-linting-tools) | ||
|
@@ -77,10 +77,10 @@ git clone [email protected]:hcs-t4sg/starter-project-2023-v2.git | |
|
||
```bash | ||
added 414 packages, and audited 415 packages in 13s | ||
|
||
149 packages are looking for funding | ||
run `npm fund` for details | ||
|
||
found 0 vulnerabilities | ||
``` | ||
|
||
|
@@ -92,7 +92,7 @@ git clone [email protected]:hcs-t4sg/starter-project-2023-v2.git | |
|
||
1. Visit the Supabase website, create an account (or login if you already have one), and create a new project. You will be prompted to set a **Database Password; remember it**. Wait for your database provisioning and setup to finish. | ||
|
||
* Try to avoid using special characters like `?`, `$`, etc. in your password. | ||
- Try to avoid using special characters like `?`, `$`, etc. in your password. | ||
|
||
2. There is a `.env.example` file in your local project directory (e.g. in VSCode). Duplicate it (into the same directory) and rename to `.env`. Inside `.env`, set the following variables according to your Supabase project settings: | ||
|
||
|
@@ -101,7 +101,6 @@ git clone [email protected]:hcs-t4sg/starter-project-2023-v2.git | |
- `SECRET_SUPABASE_CONNECTION_STRING`: From Project Settings > Database > Connection String > Nodejs. Replace `[YOUR-PASSWORD]` with your database password. | ||
- If you insist on using special characters in your password you will need to replace them with the **percent-encoded** version ([see this reference](https://stackoverflow.com/a/76551917)) | ||
|
||
|
||
The final result should look something like this: | ||
|
||
```shell | ||
|
@@ -401,9 +400,8 @@ Deployment guides for [Vercel](https://create.t3.gg/en/deployment/vercel), [Netl | |
|
||
When deploying, make sure you set the appropriate environment variables for your deployment corresponding to those found in `.env`. That is, if you're using a separate Supabase project for production, use the environment variables for that project, but if you're just using your development database, you can paste in the contents of your local `.env` file. | ||
|
||
Additionally, you need to make sure you configure Supabase's redirect URLs to accept login requests from your deployed site. Specifically, it needs to accept `https://my-domain-name.com/auth/callback`, since Supabase redirects to the `/auth/callback` route after login. | ||
Additionally, you need to make sure you configure Supabase's redirect URLs to accept login requests from your deployed site. Specifically, it needs to accept `https://my-domain-name.com/auth/callback`, since Supabase redirects to the `/auth/callback` route after login. | ||
|
||
The easiest way to do this is to login to your Supabase dashboard and navigate to Authentication (left sidebar) > URL Configuration > Redirect URLs > Add URL, and add the following URL: `https://my-domain-name.com/**`. | ||
|
||
Read more about it [here](https://supabase.com/docs/guides/auth#redirect-urls-and-wildcards). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,22 @@ | ||
import * as React from "react" | ||
import * as React from "react"; | ||
|
||
import { cn } from "@/lib/utils" | ||
import { cn } from "@/lib/utils"; | ||
|
||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement> | ||
export type InputProps = React.InputHTMLAttributes<HTMLInputElement>; | ||
|
||
const Input = React.forwardRef<HTMLInputElement, InputProps>( | ||
({ className, type, ...props }, ref) => { | ||
return ( | ||
<input | ||
type={type} | ||
className={cn( | ||
"flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", | ||
className | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
) | ||
} | ||
) | ||
Input.displayName = "Input" | ||
const Input = React.forwardRef<HTMLInputElement, InputProps>(({ className, type, ...props }, ref) => { | ||
return ( | ||
<input | ||
type={type} | ||
className={cn( | ||
"flex h-10 w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50", | ||
className, | ||
)} | ||
ref={ref} | ||
{...props} | ||
/> | ||
); | ||
}); | ||
Input.displayName = "Input"; | ||
|
||
export { Input } | ||
export { Input }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,19 @@ | ||
"use client" | ||
"use client"; | ||
|
||
import * as React from "react" | ||
import * as LabelPrimitive from "@radix-ui/react-label" | ||
import { cva, type VariantProps } from "class-variance-authority" | ||
import * as LabelPrimitive from "@radix-ui/react-label"; | ||
import { cva, type VariantProps } from "class-variance-authority"; | ||
import * as React from "react"; | ||
|
||
import { cn } from "@/lib/utils" | ||
import { cn } from "@/lib/utils"; | ||
|
||
const labelVariants = cva( | ||
"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70" | ||
) | ||
const labelVariants = cva("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"); | ||
|
||
const Label = React.forwardRef< | ||
React.ElementRef<typeof LabelPrimitive.Root>, | ||
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & | ||
VariantProps<typeof labelVariants> | ||
React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root> & VariantProps<typeof labelVariants> | ||
>(({ className, ...props }, ref) => ( | ||
<LabelPrimitive.Root | ||
ref={ref} | ||
className={cn(labelVariants(), className)} | ||
{...props} | ||
/> | ||
)) | ||
Label.displayName = LabelPrimitive.Root.displayName | ||
<LabelPrimitive.Root ref={ref} className={cn(labelVariants(), className)} {...props} /> | ||
)); | ||
Label.displayName = LabelPrimitive.Root.displayName; | ||
|
||
export { Label } | ||
export { Label }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.