diff --git a/apps/docs/components/Clippy/Clippy.tsx b/apps/docs/components/Clippy/Clippy.tsx index 8b32b2c042f..8a49e2a9306 100644 --- a/apps/docs/components/Clippy/Clippy.tsx +++ b/apps/docs/components/Clippy/Clippy.tsx @@ -7,24 +7,21 @@ import clippyImage from '../../public/img/clippy.png' import ClippyBubble from './ClippyBubble' import ClippyModal from './ClippyModal' import { useClippy } from './ClippyProvider' -import { useFlag } from '~/hooks/useFlag' + const Clippy: FC = () => { const { isDarkMode } = useTheme() const { isOpen, open, close } = useClippy() - const enableClippy = useFlag('enableClippy') return ( <> {!isOpen && (
- {enableClippy && ( - <> + {/* <>
Clippy
- - )} + */}
)} {isOpen && createPortal(, document.body)} diff --git a/apps/docs/components/Clippy/ClippyModal.tsx b/apps/docs/components/Clippy/ClippyModal.tsx index cb38781fda1..3bbbd7c69de 100644 --- a/apps/docs/components/Clippy/ClippyModal.tsx +++ b/apps/docs/components/Clippy/ClippyModal.tsx @@ -123,7 +123,7 @@ const ClippyModal: FC = ({ onClose }) => { return (
e.stopPropagation()} >
@@ -237,7 +237,7 @@ const ClippyModal: FC = ({ onClose }) => {
Powered by OpenAI. - + Read the blog post
diff --git a/apps/docs/components/MDX/project_setup.mdx b/apps/docs/components/MDX/project_setup.mdx index f1f72f08e64..2003a3a2220 100644 --- a/apps/docs/components/MDX/project_setup.mdx +++ b/apps/docs/components/MDX/project_setup.mdx @@ -2,22 +2,19 @@ import UserManagementSQLTemplate from './user_management_quickstart_sql_template import { Tabs } from 'ui' export const TabPanel = Tabs.Panel -# Project set up +## Project setup -Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase -and then creating a "schema" inside the database. +Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase and then creating a "schema" inside the database. -## Create a project +### Create a project -1. Go to [app.supabase.com](https://app.supabase.com). -1. Click on "New Project". +1. [Create a new project](https://app.supabase.com) in the Supabase Dashboard. 1. Enter your project details. 1. Wait for the new database to launch. -## Set up the database schema +### Set up the database schema -Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor, -or you can just copy/paste the SQL from below and run it yourself. +Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor, or you can just copy/paste the SQL from below and run it yourself. - - - @@ -48,20 +36,10 @@ or you can just copy/paste the SQL from below and run it yourself. -## Get the API Keys +### Get the API Keys Now that you've created some database tables, you are ready to insert data using the auto-generated API. -We just need to get the URL and `anon` key from the API settings. +We just need to get the Project URL and `anon` key from the API settings. -1. Go to the [Settings](https://app.supabase.com/project/_/settings) page in the Dashboard. -2. Click **API** in the sidebar. -3. Find your API `URL`, `anon`, and `service_role` keys on this page. - - +1. Go to the [API Settings](https://app.supabase.com/project/_/settings/api) page in the Dashboard. +1. Find your Project `URL`, `anon`, and `service_role` keys on this page. diff --git a/apps/docs/components/MDX/quickstart_intro.mdx b/apps/docs/components/MDX/quickstart_intro.mdx index f0e62650870..d20d9f32ece 100644 --- a/apps/docs/components/MDX/quickstart_intro.mdx +++ b/apps/docs/components/MDX/quickstart_intro.mdx @@ -1,9 +1,5 @@ -This example provides the steps to build a basic user management app. It includes: +This tutorial demonstrates how to build a basic user management app. The app authenticates and identifies the user, stores their profile information in the database, and allows the user to log in, update their profile details, and upload a profile photo. The app uses: -- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data. -- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email). -- Supabase [Storage](/docs/guides/storage): users can upload a photo. -- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data. -- Instant [APIs](/docs/guides/database/api): APIs will be automatically generated when you create your database tables. - -By the end of this guide you'll have an app which allows users to login and update some basic profile details: +- [Supabase Database](/docs/guides/database) - a Postgres database for storing your user data and [Row Level Security](/docs/guides/auth#row-level-security) so data is protected and users can only access their own information. +- [Supabase Auth](/docs/guides/auth) - users log in through magic links sent to their email (without having to set up passwords). +- [Supabase Storage](/docs/guides/storage) - users can upload a profile photo. diff --git a/apps/docs/components/Navigation/Navigation.constants.ts b/apps/docs/components/Navigation/Navigation.constants.ts index bac77730696..94f40fce1ee 100644 --- a/apps/docs/components/Navigation/Navigation.constants.ts +++ b/apps/docs/components/Navigation/Navigation.constants.ts @@ -278,6 +278,7 @@ export const menuItems: NavMenu = { { name: 'Performance Tuning', url: '/guides/platform/performance', items: [] }, { name: 'Permissions', url: '/guides/platform/permissions', items: [] }, { name: 'Production Readiness', url: '/guides/platform/going-into-prod', items: [] }, + { name: 'SSL Enforcement', url: '/guides/platform/ssl-enforcement', items: [] }, { name: 'Troubleshooting', url: '/guides/platform/troubleshooting', items: [] }, ], }, diff --git a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts index f4e2f661f21..6354ad15db1 100644 --- a/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts +++ b/apps/docs/components/Navigation/NavigationMenu/NavigationMenu.constants.ts @@ -51,7 +51,7 @@ export const gettingstarted = { { name: 'Framework Quickstarts', items: [ - { name: 'ReactJS', url: '/guides/getting-started/quickstarts/reactjs', items: [] }, + { name: 'React', url: '/guides/getting-started/quickstarts/reactjs', items: [] }, { name: 'NextJS', url: '/guides/getting-started/quickstarts/nextjs', items: [] }, { name: 'Flutter', url: '/guides/getting-started/quickstarts/flutter', items: [] }, { name: 'SvelteKit', url: '/guides/getting-started/quickstarts/sveltekit', items: [] }, @@ -63,7 +63,7 @@ export const gettingstarted = { name: 'Web app tutorials', items: [ { - name: 'Next.js', + name: 'NextJS', url: '/guides/getting-started/tutorials/with-nextjs', items: [], }, @@ -498,6 +498,7 @@ export const functions = { { name: 'Storage Caching', url: '/guides/functions/examples/storage-caching', items: [] }, { name: 'Stripe Webhooks', url: '/guides/functions/examples/stripe-webhooks', items: [] }, { name: 'Telegram Bot', url: '/guides/functions/examples/telegram-bot', items: [] }, + { name: 'Upstash Redis', url: '/guides/functions/examples/upstash-redis', items: [] }, ], }, ], @@ -586,6 +587,7 @@ export const platform = { { name: 'Network Restrictions', url: '/guides/platform/network-restrictions', items: [] }, { name: 'Performance Tuning', url: '/guides/platform/performance', items: [] }, { name: 'Permissions', url: '/guides/platform/permissions', items: [] }, + { name: 'SSL Enforcement', url: '/guides/platform/ssl-enforcement', items: [] }, ], }, { @@ -850,14 +852,14 @@ export const reference = { export const reference_javascript_v1 = { icon: 'reference-javascript', - title: 'javascript', + title: 'JavaScript', url: '/guides/reference/javascript', parent: '/reference', } export const reference_javascript_v2 = { icon: 'reference-javascript', - title: 'javascript', + title: 'JavaScript', url: '/guides/reference/javascript', parent: '/reference', } @@ -878,7 +880,7 @@ export const reference_dart_v1 = { export const reference_csharp_v0 = { icon: 'reference-csharp', - title: 'c#', + title: 'C#', url: 'guides/reference/csharp', parent: '/reference', } diff --git a/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx b/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx index 4588fc5864e..2fd9b545aa8 100644 --- a/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx +++ b/apps/docs/components/Navigation/NavigationMenu/TopNavBarRef.tsx @@ -89,16 +89,7 @@ const TopNavBarRef: FC = () => {
-
- Clippy -
- +
+ Clippy +
-### Tutorials +### Framework Quickstarts + +
+ {quickstarts.map((item) => { + return ( + + + + {item.description} + + + + ) + })} +
+ +### Web App Tutorials
{webapps.map((item) => { @@ -52,6 +68,46 @@ export const meta = { })}
+### Mobile Tutorials + +
+ {mobile.map((item) => { + return ( + + + + {item.description} + + + + ) + })} +
+ +export const quickstarts = [ + { + title: 'React', + href: '/guides/getting-started/quickstarts/reactjs', + description: + 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a React app.', + icon: '/docs/img/icons/react-icon', + }, + { + title: 'NextJS', + href: '/guides/getting-started/quickstarts/nextjs', + description: + 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a NextJS app.', + icon: '/docs/img/icons/nextjs-icon', + }, + { + title: 'Flutter', + href: '/guides/getting-started/quickstarts/flutter', + description: + 'Learn how to create a Supabase project, add some sample data to your database, and query the data from a Flutter app.', + icon: '/docs/img/icons/flutter-icon', + }, +] + export const webapps = [ { title: 'NextJS', @@ -109,6 +165,9 @@ export const webapps = [ 'Learn how to build a user management app with SvelteKit and Supabase Database, Auth, and Storage functionality.', icon: '/docs/img/icons/svelte-icon', }, +] + +export const mobile = [ { title: 'Flutter', href: '/guides/getting-started/tutorials/with-flutter', diff --git a/apps/docs/pages/guides/getting-started/quickstarts/sveltekit.mdx b/apps/docs/pages/guides/getting-started/quickstarts/sveltekit.mdx index 2bea7515a9a..f4989365455 100644 --- a/apps/docs/pages/guides/getting-started/quickstarts/sveltekit.mdx +++ b/apps/docs/pages/guides/getting-started/quickstarts/sveltekit.mdx @@ -67,7 +67,7 @@ export const meta = { ```bash Terminal - cd my-app && npm install @supabase/supabase-js + cd myapp && npm install @supabase/supabase-js ``` diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx index ae2870332c2..819cf492c20 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-angular.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-angular', - title: 'Quickstart: Angular', + title: 'Build a User Management App with Angular', description: 'Learn how to use Supabase in your Angular App.', - sidebar_label: 'Angular', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/angular-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/angular-user-management). + @@ -192,11 +191,7 @@ export class AuthComponent { />
-
@@ -529,13 +524,8 @@ export class AccountComponent implements OnInit { -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx index 192caa40725..5c47ae577b3 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-expo.mdx @@ -1,20 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-expo', - title: 'Quickstart: Expo', + title: 'Build a User Management App with Expo', description: 'Learn how to use Supabase in your React Native App.', - sidebar_label: 'Expo', - hide_table_of_contents: false, } ![Supabase User Management example](/docs/img/supabase-flutter-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/expo-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/expo-user-management). + @@ -504,13 +502,8 @@ expo prebuild -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-flutter.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-flutter.mdx index 478390cf7c0..af7ff9fd3e6 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-flutter.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-flutter.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-flutter', - title: 'Quickstart: Flutter', + title: 'Build a User Management App with Flutter', description: 'Learn how to use Supabase in your Flutter App.', - sidebar_label: 'Flutter', } ![Supabase User Management example](/docs/img/supabase-flutter-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/flutter-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/flutter-user-management). + @@ -77,7 +76,7 @@ Add an intent-filter to enable deep linking: ``` -For iOS, edit the ios/Runner/Info.plist file. +For iOS, edit the ios/Runner/Info.plist file. Add CFBundleURLTypes to enable deep linking: @@ -797,14 +796,13 @@ class _AccountPageState extends State { -Congratulations, that is it! You have now built a fully functional user management app using Flutter and Supabase! +Congratulations, you've built a fully functional user management app using Flutter and Supabase! ## See also - [Flutter Tutorial: building a Flutter chat app](https://supabase.com/blog/flutter-tutorial-building-a-chat-app) - [Flutter Tutorial - Part 2: Authentication and Authorization with RLS](https://supabase.com/blog/flutter-authentication-and-authorization-with-rls) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx index 4616bb796b0..43516ef65f3 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-angular.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-ionic-angular', - title: 'Quickstart: Ionic Angular', + title: 'Build a User Management App with Ionic Angular', description: 'Learn how to use Supabase in your Ionic Angular App.', - sidebar_label: 'Ionic Angular', } ![Supabase User Management example](/docs/img/ionic-demos/ionic-angular-account.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-angular). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/mhartington/supabase-ionic-angular). + @@ -526,14 +525,9 @@ template: ` -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - -## Resources +## See also - [Authentication in Ionic Angular with Supabase](https://supabase.com/blog/authentication-in-ionic-angular) diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx index 3c7c9847b96..3e3d261a5e4 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-react.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-ionic-react', - title: 'Quickstart: Ionic React', + title: 'Build a User Management App with Ionic React', description: 'Learn how to use Supabase in your Ionic React App.', - sidebar_label: 'Ionic React', } ![Supabase User Management example](/docs/img/ionic-demos/ionic-angular-account.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-react). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/mhartington/supabase-ionic-react). + @@ -499,13 +498,8 @@ return ( -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx index b5599980212..dc884f9d8d5 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-ionic-vue.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-ionic-vue', - title: 'Quickstart: Ionic Vue', + title: 'Build a User Management App with Ionic Vue', description: 'Learn how to use Supabase in your Ionic Vue App.', - sidebar_label: 'Ionic Vue', } ![Supabase User Management example](/docs/img/ionic-demos/ionic-angular-account.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/mhartington/supabase-ionic-vue). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/mhartington/supabase-ionic-vue). + @@ -559,13 +558,8 @@ export default defineComponent({ -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx index a63a164a42b..bbee6933442 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-nextjs.mdx @@ -1,10 +1,8 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-nextjs', - title: 'Quickstart: Next.js', + title: 'Build a User Management App with NextJS', description: 'Learn how to use Supabase in your Next App.', - sidebar_label: 'Next.js', video: 'https://www.youtube.com/v/0Fs96oZ4se0', } @@ -12,7 +10,7 @@ export const meta = { ![Supabase User Management example](/docs/img/user-management-demo.png) -### Video Guide +## Video Guide
-### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management). + @@ -723,17 +722,15 @@ return ( -## Next steps - At this stage you have a fully functional application! -- See the complete [example on GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management) and deploy it to Vercel. -- Explore the [pre-built Auth UI for React](/docs/guides/auth/auth-helpers/auth-ui). -- Explore the [Auth Helpers for Next.js](/docs/guides/auth/auth-helpers/nextjs). -- Explore the [Supabase Cache Helpers](https://github.com/psteinroe/supabase-cache-helpers). -- See the [Next.js Subscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub. -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) +## See also + +- See the complete [example on GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nextjs-ts-user-management) and deploy it to Vercel +- Explore the [pre-built Auth UI for React](/docs/guides/auth/auth-helpers/auth-ui) +- Explore the [Auth Helpers for Next.js](/docs/guides/auth/auth-helpers/nextjs) +- Explore the [Supabase Cache Helpers](https://github.com/psteinroe/supabase-cache-helpers) +- See the [Next.js Subscription Payments Starter](https://github.com/vercel/nextjs-subscription-payments) template on GitHub export const Page = ({ children }) => diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx index 844c10dc2a4..be8fcf69c34 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-nuxt-3.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-nuxt-3', - title: 'Quickstart: Nuxt 3', + title: 'Build a User Management App with Nuxt 3', description: 'Learn how to use Supabase in your Nuxt 3 App.', - sidebar_label: 'Nuxt 3', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### Github - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/nuxt3-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/nuxt3-user-management). + @@ -66,7 +65,27 @@ export default defineNuxtConfig({ Let's set up a Vue component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords. -```html title=/components/Auth.vue +```vue title=/components/Auth.vue + + - - ``` ### User state @@ -116,7 +116,70 @@ To access the user information, use the composable [useSupabaseUser](https://sup After a user is signed in we can allow them to edit their profile details and manage their account. Let's create a new component for that called `Account.vue`. -```html title=components/Account.vue +```vue title=components/Account.vue + + - - ``` ### Launch! Now that we have all the components in place, let's update `app.vue`: -```html title=app.vue +```vue title=app.vue + + - - ``` Once that's done, run this in a terminal window: @@ -242,7 +246,65 @@ Every Supabase project is configured with [Storage](/docs/guides/storage) for ma Let's create an avatar for the user so that they can upload a profile photo. We can start by creating a new component: -```html title=components/Avatar.vue +```vue title=components/Avatar.vue + + - - ``` ### Add the new widget And then we can add the widget to the Account page: -```html title=components/Account.vue +```vue title=components/Account.vue + + - - ``` -That is it! You should now be able to upload a profile photo to Supabase Storage. - ### Storage management -## Next steps - -At this stage you have a fully functional application! - -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) +That is it! You should now be able to upload a profile photo to Supabase Storage and you have a fully functional application. export const Page = ({ children }) => diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx index 981c7b33d9b..73c30cd56cb 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-react.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-react', - title: 'Quickstart: React', + title: 'Build a User Management App with React', description: 'Learn how to use Supabase in your React App.', - sidebar_label: 'React', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/react-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/react-user-management). + @@ -401,13 +400,8 @@ return ( -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx index bb541748411..cbc647692aa 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-redwoodjs.mdx @@ -1,49 +1,19 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-redwoodjs', - title: 'Quickstart: RedwoodJS', + title: 'Build a User Management App with RedwoodJS', description: 'Learn how to use Supabase in your RedwoodJS App.', - sidebar_label: 'RedwoodJS', } -## Intro - -For the sake of consistency with the other framework Quickstart examples, we'll build a RedwoodJS a little differently than normal. - -We **_won't use_** Prisma to connect to the Supabase Postgres database or [Prisma migrations](https://redwoodjs.com/docs/cli-commands#prisma-migrate) as one typically might in a Redwood app. -Instead, we'll rely on the Supabase client to do some of the work on the **web** side and use the client again on the **API** side to do data fetching as well. - -That means you will want to refrain from running any `yarn rw prisma migrate` commands and also double check your build commands on deployment to ensure Prisma won't reset your database. - - - -TLDR; Prisma currently doesn't support cross-schema foreign keys, so introspecting the schema fails due to how your Supabase `public` schema references the `auth.users`. - - - -This example provides the steps to build a simple user management app (from scratch!) using Supabase and [RedwoodJS](https://redwoodjs.com/docs/introduction). It includes: - -- Supabase [Database](/docs/guides/database): a Postgres database for storing your user data. -- Supabase [Auth](/docs/guides/auth): users can sign in with magic links (no passwords, only email). -- Supabase [Storage](/docs/guides/storage): users can upload a photo. -- Instant [APIs](/docs/guides/database/api): APIs will be automatically generated when you create your database tables. -- [Row Level Security](/docs/guides/auth#row-level-security): data is protected so that individuals can only access their own data. - -By the end of this guide you'll have an app which allows users to login and update some basic profile details: + ![Supabase User Management example](/docs/img/user-management-demo.png) - -Note: For RedwoodJS apps, port will be 8910 - + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/redwoodjs/redwoodjs-supabase-quickstart). -### GitHub - -If you get stuck at any point, take a look at [this repo](https://github.com/redwoodjs/redwoodjs-supabase-quickstart). - {/* ## Video demo */} {/* Coming soon. */} @@ -84,138 +54,14 @@ The **`web side`** is built with React. Redwood's router makes it simple to map Pages may contain a "Layout" component to wrap content. They also contain "Cells" and regular React components. Cells allow you to declaratively manage the lifecycle of a component that fetches and displays data. - - -For the sake of consistency with the other framework Quickstart examples, we'll build a RedwoodJS a little differently than normal. +For the sake of consistency with the other framework tutorials, we'll build this app a little differently than normal. We **_won't use_** Prisma to connect to the Supabase Postgres database or [Prisma migrations](https://redwoodjs.com/docs/cli-commands#prisma-migrate) as one typically might in a Redwood app. Instead, we'll rely on the Supabase client to do some of the work on the **`web`** side and use the client again on the **`api`** side to do data fetching as well. - +That means you will want to refrain from running any `yarn rw prisma migrate` commands and also double check your build commands on deployment to ensure Prisma won't reset your database. Prisma currently doesn't support cross-schema foreign keys, so introspecting the schema fails due +to how your Supabase `public` schema references the `auth.users`. -## Project set up - -Before we start building we're going to set up our Database and API. This is as simple as starting a new Project in Supabase -and then creating a "schema" inside the database. - - - -When setting up Supabase, you'll interact with your project dashboard. However, most of the RedwoodJS setup steps will interact with the [Redwood CLI](https://redwoodjs.com/docs/cli-commands) to generate routes, pages, components, and more. -So be sure to have a terminal at the ready and in your project directory. - - - -### Create a project - -1. Go to [app.supabase.com](https://app.supabase.com). -1. Click on "New Project". -1. Enter your project details. -1. Wait for the new database to launch. - -### Set up the database schema - -Now we are going to set up the database schema. We can use the "User Management Starter" quickstart in the SQL Editor, -or you can just copy/paste the SQL from below and run it yourself. - - - - -1. Go to the [SQL Editor](https://app.supabase.com/project/_/sql) page in the Dashboard. -2. Click **User Management Starter**. -3. Click **Run**. - - - - - - -```sql --- Create a table for public "profiles" -create table profiles ( - id uuid references auth.users not null, - updated_at timestamp with time zone, - username text unique, - avatar_url text, - website text, - - primary key (id), - unique(username), - constraint username_length check (char_length(username) >= 3) -); - -alter table profiles enable row level security; - -create policy "Public profiles are viewable by everyone." - on profiles for select - using ( true ); - -create policy "Users can insert their own profile." - on profiles for insert - with check ( auth.uid() = id ); - -create policy "Users can update own profile." - on profiles for update - using ( auth.uid() = id ); - --- Set up Realtime! -begin; - drop publication if exists supabase_realtime; - create publication supabase_realtime; -commit; -alter publication supabase_realtime add table profiles; - --- Set up Storage! -insert into storage.buckets (id, name) -values ('avatars', 'avatars'); - -create policy "Avatar images are publicly accessible." - on storage.objects for select - using ( bucket_id = 'avatars' ); - -create policy "Anyone can upload an avatar." - on storage.objects for insert - with check ( bucket_id = 'avatars' ); - -``` - - - - -#### Important Note about Prisma and Migrations - - - -Because this Quick Start does not use Prisma to manage the database schema, seed it, or run migrations, you **need** to take extra care when running some of the typical Redwood CLI commands. - - - -### Get the API Keys - -Now that you've created some database tables, you are ready to insert data using the auto-generated API. -We just need to get the URL as well as the `anon`, `service_role` and `JWT_SECRET` keys from the API settings. - -1. Go to the [API Settings](https://app.supabase.com/project/_/settings/api) page in the Dashboard. -2. Find your API `URL`, `anon`, and `service_role` keys on this page. - - + ## Building the App @@ -291,7 +137,7 @@ And finally, you will also need to save **just** the `web side` environment vari ```bash title=redwood.toml [web] - title = "Supabase Redwood Quickstart" + title = "Supabase Redwood Tutorial" port = 8910 apiProxyPath = "/.redwood/functions" includeEnvironmentVariables = ["SUPABASE_URL", "SUPABASE_KEY"] @@ -343,9 +189,7 @@ yarn rw dev ``` - -Note: You can also use the alias `rw` for `redwood`, as in `yarn rw` to run Redwood CLI commands - + `rw` is an alias for `redwood`, as in `yarn rw` to run Redwood CLI commands. You should see a "Welcome to RedwoodJS" page and a message about not having any pages yet. @@ -365,7 +209,7 @@ yarn rw generate page home / -Note: the slash `/` is important here as it creates a root level route. +The `/` is important here as it creates a root level route. @@ -601,14 +445,10 @@ const Account = () => { export default Account ``` - - -Note: You'll see the use of `useAuth()` several times in the quickstart. Redwood's `useAuth` hook provides convenient ways to access +You'll see the use of `useAuth()` several times. Redwood's `useAuth` hook provides convenient ways to access logIn, logOut, currentUser, and access the `supabase` authenticate client. We'll use it to get an instance of the supabase client to interact with your API. - - ### Update Home Page Now that we have all the components in place, let's update your `HomePage` page to use them: @@ -785,12 +625,10 @@ return ( -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) +## See also + - Learn more about [RedwoodJS](https://redwoodjs.com) - Visit the [RedwoodJS Discourse Community](https://community.redwoodjs.com) diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx index eaf47892298..c56047307f9 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-solidjs.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-solidjs', - title: 'Quickstart: SolidJS', + title: 'Build a User Management App with SolidJS', description: 'Learn how to use Supabase in your SolidJS App.', - sidebar_label: 'SolidJS', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/solid-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/solid-user-management). + @@ -419,13 +418,8 @@ return ( -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx index 5195fa8b135..9e362231fa3 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-svelte.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-svelte', - title: 'Quickstart: Svelte', + title: 'Build a User Management App with Svelte', description: 'Learn how to use Supabase in your Svelte App.', - sidebar_label: 'Svelte', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/svelte-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/svelte-user-management). + @@ -372,13 +371,8 @@ And then we can add the widget to the Account page: -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx index 614dac516e2..a99cce9b9d9 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-sveltekit.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-sveltekit', - title: 'Quickstart: SvelteKit', + title: 'Build a User Management App with SvelteKit', description: 'Learn how to use Supabase in your SvelteKit App.', - sidebar_label: 'SvelteKit', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/sveltekit-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/sveltekit-user-management). + @@ -438,13 +437,8 @@ And then we can add the widget to the Account page: -## Next steps - At this stage you have a fully functional application! -- Got a question? [Ask here](https://github.com/supabase/supabase/discussions). -- Sign in: [app.supabase.com](https://app.supabase.com) - export const Page = ({ children }) => export default Page diff --git a/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx b/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx index b40659546fe..5480df2d4aa 100644 --- a/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx +++ b/apps/docs/pages/guides/getting-started/tutorials/with-vue-3.mdx @@ -1,19 +1,18 @@ import Layout from '~/layouts/DefaultGuideLayout' export const meta = { - id: 'with-vue-3', - title: 'Quickstart: Vue 3', + title: 'Build a User Management App with Vue 3', description: 'Learn how to use Supabase in your Vue 3 App.', - sidebar_label: 'Vue 3', } ![Supabase User Management example](/docs/img/user-management-demo.png) -### GitHub - -Should you get stuck while working through the guide, refer to [this repo](https://github.com/supabase/supabase/tree/master/examples/user-management/vue3-user-management). + + If you get stuck while working through this guide, refer to the [full example on + GitHub](https://github.com/supabase/supabase/tree/master/examples/user-management/vue3-user-management). + @@ -68,30 +67,30 @@ Optionally, update [src/style.css](https://raw.githubusercontent.com/supabase/su Set up an `src/components/Auth.vue` component to manage logins and sign ups. We'll use Magic Links, so users can sign in with their email without using passwords. -```html title=/src/components/Auth.vue +```vue title=/src/components/Auth.vue