diff --git a/README.md b/README.md index 0c4787f7228..f45db3d4a06 100644 --- a/README.md +++ b/README.md @@ -66,12 +66,12 @@ Our client library is modular. Each sub-library is a standalone implementation f - `realtime-{lang}`: Client library to work with [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Client library to work with [GoTrue](https://github.com/netlify/gotrue) -| Repo | Official | Community | -| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) -| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) -| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | -| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | +| Repo | Official | Community | +| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) | +| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) | +| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | +| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | diff --git a/SECURITY.md b/SECURITY.md index f382301feaa..63dc5033611 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,24 +2,22 @@ ## Supported Versions - | Version | Supported | | ------- | ------------------ | -| All | :white_check_mark: | +| All | :white_check_mark: | ## Reporting a Vulnerability Contact: security@supabase.io Canonical: https://supabase.io/.well-known/security.txt - At Supabase, we consider the security of our systems a top priority. But no matter how much effort we put into system security, there can still be vulnerabilities present. If you discover a vulnerability, we would like to know about it so we can take steps to address it as quickly as possible. We would like to ask you to help us better protect our clients and our systems. Please do the following: -- E-mail your findings to security@supabase.io. +- E-mail your findings to security@supabase.io. - Do not take advantage of the vulnerability or problem you have discovered, for example by downloading more data than necessary to demonstrate the vulnerability or deleting or modifying other people's data, - Do not reveal the problem to others until it has been resolved, - Do not use attacks on physical security, social engineering, distributed denial of service, spam or applications of third parties, and diff --git a/examples/expo-todo-list/app.json b/examples/expo-todo-list/app.json index 9e95ce8842a..7190ea70c37 100644 --- a/examples/expo-todo-list/app.json +++ b/examples/expo-todo-list/app.json @@ -13,9 +13,7 @@ "updates": { "fallbackToCacheTimeout": 0 }, - "assetBundlePatterns": [ - "**/*" - ], + "assetBundlePatterns": ["**/*"], "ios": { "supportsTablet": true }, diff --git a/examples/expo-todo-list/babel.config.js b/examples/expo-todo-list/babel.config.js index c4bdcb5009d..f27e6b0123c 100644 --- a/examples/expo-todo-list/babel.config.js +++ b/examples/expo-todo-list/babel.config.js @@ -1,7 +1,7 @@ -module.exports = function(api) { - api.cache(true); +module.exports = function (api) { + api.cache(true) return { presets: ['babel-preset-expo'], plugins: ['inline-dotenv'], } -}; +} diff --git a/examples/javascript-auth/README.md b/examples/javascript-auth/README.md index b5df09fa272..3289afecbf8 100644 --- a/examples/javascript-auth/README.md +++ b/examples/javascript-auth/README.md @@ -7,9 +7,8 @@ How to sign up and login using supabase and supabase-js using HTML and JavaScrip image ### running + `npm run dev` (requires npx to be installed) if you want to make changes without restarting the server run this in a different terminal window: `npm run watch` - - diff --git a/examples/nextjs-live-tracker-map/components/MapInput.js b/examples/nextjs-live-tracker-map/components/MapInput.js index ad2641e2dd9..1d9046adf0e 100644 --- a/examples/nextjs-live-tracker-map/components/MapInput.js +++ b/examples/nextjs-live-tracker-map/components/MapInput.js @@ -1,77 +1,63 @@ -import { useEffect, useState, useRef, useMemo, useCallback } from "react"; -import { MapContainer, TileLayer, Marker, Popup, Circle } from "react-leaflet"; -import { RoundToFixDecimals } from "lib/utils"; -import { supabase } from "lib/api"; -import TextLog from "components/TextLog"; +import { useEffect, useState, useRef, useMemo, useCallback } from 'react' +import { MapContainer, TileLayer, Marker, Popup, Circle } from 'react-leaflet' +import { RoundToFixDecimals } from 'lib/utils' +import { supabase } from 'lib/api' +import TextLog from 'components/TextLog' function DraggableMarker({ initialPos, addCircle }) { - const [position, setPosition] = useState(initialPos); - const markerRef = useRef(null); + const [position, setPosition] = useState(initialPos) + const markerRef = useRef(null) const eventHandlers = useMemo( () => ({ dragend() { - const marker = markerRef.current; - const pos = marker.getLatLng(); - if (addCircle) addCircle(pos); - if (marker) setPosition(pos); + const marker = markerRef.current + const pos = marker.getLatLng() + if (addCircle) addCircle(pos) + if (marker) setPosition(pos) }, }), [addCircle] - ); + ) return ( - + {`lat: ${position.lat}`}
{`long: ${position.lng}`}
- ); + ) } function MapInput({ clientRef, center, zoom }) { - const [log, setLog] = useState(undefined); - const [circles, setCircles] = useState([]); + const [log, setLog] = useState(undefined) + const [circles, setCircles] = useState([]) useEffect(() => { - let newLog = `Ref: ${clientRef}\nReady to send location...`; + let newLog = `Ref: ${clientRef}\nReady to send location...` newLog += circles.map((item) => { - return `\nsent lat=${RoundToFixDecimals( - item.lat - )} long=${RoundToFixDecimals(item.lng)}`; - }); - setLog(newLog); - }, [circles, clientRef]); + return `\nsent lat=${RoundToFixDecimals(item.lat)} long=${RoundToFixDecimals(item.lng)}` + }) + setLog(newLog) + }, [circles, clientRef]) const onAddCircle = useCallback( async (pos) => { - setCircles([...circles, pos]); + setCircles([...circles, pos]) // insert new location await supabase - .from("locations") - .insert([ - { latitude: pos.lat, longitude: pos.lng, user_id: clientRef }, - ]); + .from('locations') + .insert([{ latitude: pos.lat, longitude: pos.lng, user_id: clientRef }]) }, [setCircles, circles, supabase, clientRef] - ); + ) function renderCircles() { return circles.map((item, index) => ( - - )); + + )) } return ( @@ -96,6 +82,6 @@ function MapInput({ clientRef, center, zoom }) { } `} - ); + ) } -export default MapInput; +export default MapInput diff --git a/examples/nextjs-live-tracker-map/components/MapView.js b/examples/nextjs-live-tracker-map/components/MapView.js index 6e44f4994ff..0b332b16393 100644 --- a/examples/nextjs-live-tracker-map/components/MapView.js +++ b/examples/nextjs-live-tracker-map/components/MapView.js @@ -1,49 +1,43 @@ -import { useEffect, useReducer } from "react"; -import { MapContainer, TileLayer, Polyline } from "react-leaflet"; -import { RoundToFixDecimals } from "lib/utils"; -import { supabase } from "lib/api"; -import TextLog from "components/TextLog"; +import { useEffect, useReducer } from 'react' +import { MapContainer, TileLayer, Polyline } from 'react-leaflet' +import { RoundToFixDecimals } from 'lib/utils' +import { supabase } from 'lib/api' +import TextLog from 'components/TextLog' export default function MapView({ center, zoom }) { - const [state, dispatch] = useReducer(mapReducer, initialState); + const [state, dispatch] = useReducer(mapReducer, initialState) useEffect(() => { // Listen to INSERT event on locations table const subscription = supabase - .from("locations") - .on("INSERT", (payload) => { - console.log("New Position received!", payload); - dispatch({ payload: payload.new }); + .from('locations') + .on('INSERT', (payload) => { + console.log('New Position received!', payload) + dispatch({ payload: payload.new }) }) - .subscribe(); + .subscribe() return () => { - if (subscription) supabase.removeSubscription(subscription); - }; - }, []); + if (subscription) supabase.removeSubscription(subscription) + } + }, []) function drawPolylines() { let result = Object.keys(state.userPositions).map((key, idx) => { - const item = state.userPositions[key]; - if (!item) return; + const item = state.userPositions[key] + if (!item) return - const { color, data } = item; + const { color, data } = item const polyline = data.map((item) => { - if (!item) return; - const { lat, lng } = item; - return [lat, lng]; - }); + if (!item) return + const { lat, lng } = item + return [lat, lng] + }) - return ( - - ); - }); + return + }) - return result; + return result } return ( @@ -57,35 +51,35 @@ export default function MapView({ center, zoom }) { - ); + ) } function randomColor() { - var array = ["black", "magenta", "blue", "indigo", "green", "blueviolet"]; - return array[Math.floor(Math.random() * array.length)]; + var array = ['black', 'magenta', 'blue', 'indigo', 'green', 'blueviolet'] + return array[Math.floor(Math.random() * array.length)] } const initialState = { - log: "Start listerning...", + log: 'Start listerning...', userPositions: {}, -}; +} const mapReducer = (state, action) => { - const { id, user_id, latitude: lat, longitude: lng } = action.payload; - const position = { id, user_id, lat, lng }; + const { id, user_id, latitude: lat, longitude: lng } = action.payload + const position = { id, user_id, lat, lng } - let positions = state.userPositions[user_id]; - if (positions) positions.data = [...positions.data, position]; - else positions = { color: randomColor(), data: [position] }; - const userPositions = { ...state.userPositions, [user_id]: positions }; + let positions = state.userPositions[user_id] + if (positions) positions.data = [...positions.data, position] + else positions = { color: randomColor(), data: [position] } + const userPositions = { ...state.userPositions, [user_id]: positions } - let log = state.log; - log += `\nuser_id=${user_id}`; - log += ` lat=${RoundToFixDecimals(lat)}`; - log += ` long=${RoundToFixDecimals(lng)}`; + let log = state.log + log += `\nuser_id=${user_id}` + log += ` lat=${RoundToFixDecimals(lat)}` + log += ` long=${RoundToFixDecimals(lng)}` return { log, userPositions, - }; -}; + } +} diff --git a/examples/nextjs-live-tracker-map/components/PageLayout.js b/examples/nextjs-live-tracker-map/components/PageLayout.js index 66fec554c5e..3020edae584 100644 --- a/examples/nextjs-live-tracker-map/components/PageLayout.js +++ b/examples/nextjs-live-tracker-map/components/PageLayout.js @@ -1,4 +1,4 @@ -import Head from "next/head"; +import Head from 'next/head' export default function PageLayout({ title, children }) { return ( @@ -10,10 +10,9 @@ export default function PageLayout({ title, children }) { - ); + ) } diff --git a/examples/nextjs-live-tracker-map/components/SignIn.js b/examples/nextjs-live-tracker-map/components/SignIn.js index cb2b11f9394..ab97f36de3e 100644 --- a/examples/nextjs-live-tracker-map/components/SignIn.js +++ b/examples/nextjs-live-tracker-map/components/SignIn.js @@ -1,14 +1,14 @@ -import React, { useState } from "react"; -import { supabase } from "lib/api"; +import React, { useState } from 'react' +import { supabase } from 'lib/api' /** * Sign in with username and password * * @param {String} role DRIVER/MANAGER. default as DRIVER */ -export default function SignIn({ role = "DRIVER" }) { - const [formData, updateFormData] = useState({ role }); - const [action, setAction] = useState(null); +export default function SignIn({ role = 'DRIVER' }) { + const [formData, updateFormData] = useState({ role }) + const [action, setAction] = useState(null) function onChange(e) { updateFormData({ @@ -16,37 +16,37 @@ export default function SignIn({ role = "DRIVER" }) { // Trimming any whitespace [e.target.name]: e.target.value.trim(), - }); + }) } async function updateUserRole(user) { - if (!user || user.user_metadata?.role) return; + if (!user || user.user_metadata?.role) return // update user role await supabase.auth.update({ data: { role }, - }); + }) } async function onSubmit(event) { - event.preventDefault(); + event.preventDefault() try { - if (action === "SIGNUP") { - const { email, password, role } = formData; - const { error, user } = await supabase.auth.signUp({ email, password }); - if (error) throw error; + if (action === 'SIGNUP') { + const { email, password, role } = formData + const { error, user } = await supabase.auth.signUp({ email, password }) + if (error) throw error // update user role await supabase.auth.update({ data: { role }, - }); - } else if (action === "LOGIN") { - const { error } = await supabase.auth.signIn(formData); - if (error) throw error; + }) + } else if (action === 'LOGIN') { + const { error } = await supabase.auth.signIn(formData) + if (error) throw error } } catch (error) { - alert(error.message); + alert(error.message) } } @@ -60,10 +60,10 @@ export default function SignIn({ role = "DRIVER" }) { Password - - - ); + ) } diff --git a/examples/nextjs-live-tracker-map/components/TextLog.js b/examples/nextjs-live-tracker-map/components/TextLog.js index 0a819d5d7b0..855426a8878 100644 --- a/examples/nextjs-live-tracker-map/components/TextLog.js +++ b/examples/nextjs-live-tracker-map/components/TextLog.js @@ -4,7 +4,7 @@ export default function TextLog({ log }) { const textLog = useRef(null) useEffect(() => { - textLog.current.scrollTop = textLog.current.scrollHeight; + textLog.current.scrollTop = textLog.current.scrollHeight }, [log]) return ( @@ -18,4 +18,4 @@ export default function TextLog({ log }) { `} ) -} \ No newline at end of file +} diff --git a/examples/nextjs-live-tracker-map/jsconfig.json b/examples/nextjs-live-tracker-map/jsconfig.json index b639b0f8f3d..36aa1a4dc28 100644 --- a/examples/nextjs-live-tracker-map/jsconfig.json +++ b/examples/nextjs-live-tracker-map/jsconfig.json @@ -2,4 +2,4 @@ "compilerOptions": { "baseUrl": "." } -} \ No newline at end of file +} diff --git a/examples/nextjs-live-tracker-map/lib/api.js b/examples/nextjs-live-tracker-map/lib/api.js index 71962de582e..625bc201c9b 100644 --- a/examples/nextjs-live-tracker-map/lib/api.js +++ b/examples/nextjs-live-tracker-map/lib/api.js @@ -1,10 +1,4 @@ -import { createClient } from "@supabase/supabase-js"; -import { - NEXT_PUBLIC_SUPABASE_URL, - NEXT_PUBLIC_SUPABASE_KEY, -} from "./constants"; +import { createClient } from '@supabase/supabase-js' +import { NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_KEY } from './constants' -export const supabase = createClient( - NEXT_PUBLIC_SUPABASE_URL, - NEXT_PUBLIC_SUPABASE_KEY -); +export const supabase = createClient(NEXT_PUBLIC_SUPABASE_URL, NEXT_PUBLIC_SUPABASE_KEY) diff --git a/examples/nextjs-live-tracker-map/lib/constants.js b/examples/nextjs-live-tracker-map/lib/constants.js index 73c8b7e42c8..70272f785f2 100644 --- a/examples/nextjs-live-tracker-map/lib/constants.js +++ b/examples/nextjs-live-tracker-map/lib/constants.js @@ -1,8 +1,8 @@ -import { createContext } from "react"; +import { createContext } from 'react' -export const NEXT_PUBLIC_SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL; -export const NEXT_PUBLIC_SUPABASE_KEY = process.env.NEXT_PUBLIC_SUPABASE_KEY; +export const NEXT_PUBLIC_SUPABASE_URL = process.env.NEXT_PUBLIC_SUPABASE_URL +export const NEXT_PUBLIC_SUPABASE_KEY = process.env.NEXT_PUBLIC_SUPABASE_KEY -export const DEFAULT_AVATARS_BUCKET = "avatars"; +export const DEFAULT_AVATARS_BUCKET = 'avatars' -export const AppContext = createContext(); +export const AppContext = createContext() diff --git a/examples/nextjs-live-tracker-map/lib/utils.js b/examples/nextjs-live-tracker-map/lib/utils.js index afc820e45ae..fea7930a501 100644 --- a/examples/nextjs-live-tracker-map/lib/utils.js +++ b/examples/nextjs-live-tracker-map/lib/utils.js @@ -1,12 +1,12 @@ export function RoundToFixDecimals(value, numDecimals = 5) { function addZero(s, size) { while (s.length <= (size || 2)) { - s = s + "0"; + s = s + '0' } - return s; + return s } - const temp = addZero("1", numDecimals); - const tempNum = parseInt(temp, 10); - return Math.round((value + Number.EPSILON) * tempNum) / tempNum; + const temp = addZero('1', numDecimals) + const tempNum = parseInt(temp, 10) + return Math.round((value + Number.EPSILON) * tempNum) / tempNum } diff --git a/examples/nextjs-live-tracker-map/pages/_app.js b/examples/nextjs-live-tracker-map/pages/_app.js index 3a15b417d95..827c40f9d0f 100644 --- a/examples/nextjs-live-tracker-map/pages/_app.js +++ b/examples/nextjs-live-tracker-map/pages/_app.js @@ -1,25 +1,25 @@ -import "../styles/globals.css"; -import React, { useState, useEffect } from "react"; -import { supabase } from "lib/api"; -import { AppContext } from "lib/constants"; +import '../styles/globals.css' +import React, { useState, useEffect } from 'react' +import { supabase } from 'lib/api' +import { AppContext } from 'lib/constants' function MyApp({ Component, pageProps }) { - const [session, setSession] = useState(null); + const [session, setSession] = useState(null) useEffect(() => { - setSession(supabase.auth.session()); + setSession(supabase.auth.session()) supabase.auth.onAuthStateChange((_event, session) => { - setSession(session); - console.log("session state change", session); - }); - }, []); + setSession(session) + console.log('session state change', session) + }) + }, []) return ( - ); + ) } -export default MyApp; +export default MyApp diff --git a/examples/nextjs-live-tracker-map/pages/_document.js b/examples/nextjs-live-tracker-map/pages/_document.js index 6ccef0fc59b..fe910c5fcaf 100644 --- a/examples/nextjs-live-tracker-map/pages/_document.js +++ b/examples/nextjs-live-tracker-map/pages/_document.js @@ -1,4 +1,4 @@ -import Document, { Html, Head, Main, NextScript } from "next/document"; +import Document, { Html, Head, Main, NextScript } from 'next/document' class MyDocument extends Document { render() { @@ -23,8 +23,8 @@ class MyDocument extends Document { - ); + ) } } -export default MyDocument; +export default MyDocument diff --git a/examples/nextjs-live-tracker-map/pages/driver.js b/examples/nextjs-live-tracker-map/pages/driver.js index 6656244186f..853b428d7a5 100644 --- a/examples/nextjs-live-tracker-map/pages/driver.js +++ b/examples/nextjs-live-tracker-map/pages/driver.js @@ -1,12 +1,12 @@ -import { useContext, useEffect, useState } from "react"; -import { AppContext } from "lib/constants"; -import { supabase } from "lib/api"; -import dynamic from "next/dynamic"; -import styles from "styles/Map.module.css"; -import SignIn from "components/SignIn"; -import PageLayout from "components/PageLayout"; +import { useContext, useEffect, useState } from 'react' +import { AppContext } from 'lib/constants' +import { supabase } from 'lib/api' +import dynamic from 'next/dynamic' +import styles from 'styles/Map.module.css' +import SignIn from 'components/SignIn' +import PageLayout from 'components/PageLayout' -const MapInput = dynamic(() => import("components/MapInput"), { ssr: false }); +const MapInput = dynamic(() => import('components/MapInput'), { ssr: false }) function randomPosition() { var array = [ @@ -30,25 +30,25 @@ function randomPosition() { lat: 1.35454, lng: 103.69746, }, - ]; - return array[Math.floor(Math.random() * array.length)]; + ] + return array[Math.floor(Math.random() * array.length)] } -const center = randomPosition(); -const zoomLevel = 14; +const center = randomPosition() +const zoomLevel = 14 export default function Page() { - const { session } = useContext(AppContext); - const [userRole, setRole] = useState(null); - const [username, setUsername] = useState(null); + const { session } = useContext(AppContext) + const [userRole, setRole] = useState(null) + const [username, setUsername] = useState(null) useEffect(() => { - setRole(session?.user?.user_metadata?.role); - setUsername(session?.user?.user_metadata?.username); - }, [session]); + setRole(session?.user?.user_metadata?.role) + setUsername(session?.user?.user_metadata?.username) + }, [session]) async function onSignOut() { - const { error } = await supabase.auth.signOut(); - if (error) console.log("Error logging out:", error.message); + const { error } = await supabase.auth.signOut() + if (error) console.log('Error logging out:', error.message) } return ( @@ -63,17 +63,11 @@ export default function Page() { {!session && } {session && (
- {userRole?.toUpperCase() == "DRIVER" && ( - + {userRole?.toUpperCase() == 'DRIVER' && ( + )} - {userRole?.toUpperCase() == "MANAGER" && ( -

- Sorry, You need to sign in as driver -

+ {userRole?.toUpperCase() == 'MANAGER' && ( +

Sorry, You need to sign in as driver

)}
Signed in as {username} [{userRole}]
@@ -85,5 +79,5 @@ export default function Page() { )}
- ); + ) } diff --git a/examples/nextjs-live-tracker-map/pages/index.js b/examples/nextjs-live-tracker-map/pages/index.js index 630c040b2d1..31384eb9140 100644 --- a/examples/nextjs-live-tracker-map/pages/index.js +++ b/examples/nextjs-live-tracker-map/pages/index.js @@ -1,26 +1,23 @@ -import { useContext, useEffect } from "react"; -import { AppContext } from "lib/constants"; -import Link from "next/link"; -import styles from "styles/Home.module.css"; -import PageLayout from "components/PageLayout"; +import { useContext, useEffect } from 'react' +import { AppContext } from 'lib/constants' +import Link from 'next/link' +import styles from 'styles/Home.module.css' +import PageLayout from 'components/PageLayout' export default function Page() { - const { session } = useContext(AppContext); + const { session } = useContext(AppContext) useEffect(() => { - console.log("session: ", session); - }, []); + console.log('session: ', session) + }, []) return (

Live Tracker

-

- Get started by choosing your role as Driver or Manager. -

+

Get started by choosing your role as Driver or Manager.

- You can only login 1 role at a time. Please use incognito mode to test - multi users. + You can only login 1 role at a time. Please use incognito mode to test multi users.

@@ -38,5 +35,5 @@ export default function Page() {
- ); + ) } diff --git a/examples/nextjs-live-tracker-map/pages/manager.js b/examples/nextjs-live-tracker-map/pages/manager.js index 9a401983cb9..7c396208db2 100644 --- a/examples/nextjs-live-tracker-map/pages/manager.js +++ b/examples/nextjs-live-tracker-map/pages/manager.js @@ -1,31 +1,31 @@ -import { useContext, useEffect, useState } from "react"; -import { AppContext } from "lib/constants"; -import { supabase } from "lib/api"; -import styles from "styles/Map.module.css"; -import dynamic from "next/dynamic"; -import SignIn from "components/SignIn"; -import PageLayout from "components/PageLayout"; +import { useContext, useEffect, useState } from 'react' +import { AppContext } from 'lib/constants' +import { supabase } from 'lib/api' +import styles from 'styles/Map.module.css' +import dynamic from 'next/dynamic' +import SignIn from 'components/SignIn' +import PageLayout from 'components/PageLayout' -const MapView = dynamic(() => import("components/MapView"), { ssr: false }); +const MapView = dynamic(() => import('components/MapView'), { ssr: false }) const center = { lat: 1.3489728457596013, lng: 103.77043978311998, -}; -const zoomLevel = 12; +} +const zoomLevel = 12 export default function Page() { - const { session } = useContext(AppContext); - const [userRole, setRole] = useState(null); - const [username, setUsername] = useState(null); + const { session } = useContext(AppContext) + const [userRole, setRole] = useState(null) + const [username, setUsername] = useState(null) useEffect(() => { - setRole(session?.user?.user_metadata?.role); - setUsername(session?.user?.user_metadata?.username); - }, [session]); + setRole(session?.user?.user_metadata?.role) + setUsername(session?.user?.user_metadata?.username) + }, [session]) async function onSignOut() { - const { error } = await supabase.auth.signOut(); - if (error) console.log("Error logging out:", error.message); + const { error } = await supabase.auth.signOut() + if (error) console.log('Error logging out:', error.message) } return ( @@ -33,21 +33,16 @@ export default function Page() {

Manager View

- As manager, you can view all drivers' locations as long as the drivers - are ONLINE + As manager, you can view all drivers' locations as long as the drivers are ONLINE

{!session && } {session && (
- {userRole?.toUpperCase() == "MANAGER" && ( - - )} - {userRole?.toUpperCase() == "DRIVER" && ( -

- Sorry, you need to sign in as manager -

+ {userRole?.toUpperCase() == 'MANAGER' && } + {userRole?.toUpperCase() == 'DRIVER' && ( +

Sorry, you need to sign in as manager

)}
Signed in as {username} [{userRole}]
@@ -59,5 +54,5 @@ export default function Page() { )}
- ); + ) } diff --git a/examples/nextjs-live-tracker-map/styles/globals.css b/examples/nextjs-live-tracker-map/styles/globals.css index 9fa171aff3b..86a6cd1954f 100644 --- a/examples/nextjs-live-tracker-map/styles/globals.css +++ b/examples/nextjs-live-tracker-map/styles/globals.css @@ -2,8 +2,8 @@ html, body { padding: 0; margin: 0; - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, - Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, + Fira Sans, Droid Sans, Helvetica Neue, sans-serif; } * { diff --git a/examples/nextjs-slack-clone/pages/_app.js b/examples/nextjs-slack-clone/pages/_app.js index ecae6586e12..cfb660f5d51 100644 --- a/examples/nextjs-slack-clone/pages/_app.js +++ b/examples/nextjs-slack-clone/pages/_app.js @@ -4,33 +4,31 @@ import Router from 'next/router' import UserContext from 'lib/UserContext' import { supabase } from 'lib/Store' -export default function SupabaseSlackClone({Component, pageProps}){ +export default function SupabaseSlackClone({ Component, pageProps }) { const [userLoaded, setUserLoaded] = useState(false) const [user, setUser] = useState(null) - const [session, setSession] = useState(null); + const [session, setSession] = useState(null) useEffect(() => { - const session = supabase.auth.session(); - setSession(session); - setUser(session?.user ?? null); + const session = supabase.auth.session() + setSession(session) + setUser(session?.user ?? null) setUserLoaded(session ? true : false) if (user) { signIn(user.id, user.email) Router.push('/channels/[id]', '/channels/1') } - const { data: authListener } = supabase.auth.onAuthStateChange( - async (event, session) => { - setSession(session); - const currentUser = session?.user - setUser(currentUser ?? null); - setUserLoaded(!!currentUser) - if (currentUser) { - signIn(currentUser.id, currentUser.email) - Router.push('/channels/[id]', '/channels/1') - } + const { data: authListener } = supabase.auth.onAuthStateChange(async (event, session) => { + setSession(session) + const currentUser = session?.user + setUser(currentUser ?? null) + setUserLoaded(!!currentUser) + if (currentUser) { + signIn(currentUser.id, currentUser.email) + Router.push('/channels/[id]', '/channels/1') } - ) + }) return () => { authListener.unsubscribe() @@ -47,11 +45,11 @@ export default function SupabaseSlackClone({Component, pageProps}){ ? await supabase.from('users').update({ id, username }).match({ id }).single() : await supabase.from('users').insert([{ id, username }]).single() } - + const signOut = async () => { const result = await supabase.auth.signOut() Router.push('/') - } + } return ( diff --git a/examples/nextjs-slack-clone/pages/index.js b/examples/nextjs-slack-clone/pages/index.js index fad9d73c383..4aea8f8ddf7 100644 --- a/examples/nextjs-slack-clone/pages/index.js +++ b/examples/nextjs-slack-clone/pages/index.js @@ -9,17 +9,16 @@ const Home = () => { const handleLogin = async (type, username, password) => { try { - const { error, user } = + const { error, user } = type === 'LOGIN' - ? await supabase.auth.signIn({email: username, password}) - : await supabase.auth.signUp({email: username, password}) + ? await supabase.auth.signIn({ email: username, password }) + : await supabase.auth.signUp({ email: username, password }) // If the user doesn't exist here and an error hasn't been raised yet, // that must mean that a confirmation email has been sent. // NOTE: Confirming your email address is required by default. if (error) { alert('Error with auth: ' + error.message) - } - else if (!user) alert('Signup successful, confirmation mail should be sent soon!') + } else if (!user) alert('Signup successful, confirmation mail should be sent soon!') } catch (error) { console.log('error', error) alert(error.error_description || error) diff --git a/examples/nextjs-todo-list/styles/index.css b/examples/nextjs-todo-list/styles/index.css index babc44b9572..237a1456127 100644 --- a/examples/nextjs-todo-list/styles/index.css +++ b/examples/nextjs-todo-list/styles/index.css @@ -26,7 +26,9 @@ /* Your own custom utilities */ -html, body, #__next { +html, +body, +#__next { height: 100vh; min-height: 100vh; } @@ -35,4 +37,4 @@ h1 { font-size: 4rem; font-weight: bold; display: block; -} \ No newline at end of file +} diff --git a/examples/nextjs-ts-user-management/README.md b/examples/nextjs-ts-user-management/README.md index 1259820cfd1..dd9da153892 100644 --- a/examples/nextjs-ts-user-management/README.md +++ b/examples/nextjs-ts-user-management/README.md @@ -7,7 +7,7 @@ This demonstrates how to use: - User signups using Supabase [Auth](https://supabase.io/auth). - User avatar images using Supabase [Storage](https://supabase.io/storage). - Public profiles restricted with [Policies](https://supabase.io/docs/guides/auth#policies). -- Frontend using [Next.js]([nextjs.org/](https://nextjs.org/)). +- Frontend using [Next.js](<[nextjs.org/](https://nextjs.org/)>). ## Technologies used diff --git a/examples/nextjs-ts-user-management/components/Footer.tsx b/examples/nextjs-ts-user-management/components/Footer.tsx index 49c028dbb55..e36287f59bd 100644 --- a/examples/nextjs-ts-user-management/components/Footer.tsx +++ b/examples/nextjs-ts-user-management/components/Footer.tsx @@ -1,4 +1,4 @@ -export default function Footer({ }) { +export default function Footer({}) { return (
diff --git a/examples/nextjs-ts-user-management/components/ProfileCard.tsx b/examples/nextjs-ts-user-management/components/ProfileCard.tsx index f434dc0f5ed..669d623eb68 100644 --- a/examples/nextjs-ts-user-management/components/ProfileCard.tsx +++ b/examples/nextjs-ts-user-management/components/ProfileCard.tsx @@ -8,7 +8,9 @@ export default function ProfileCard({ profile }: { profile: Profile }) {

{profile.username}

- {profile.website} + + {profile.website} +

Last updated{' '} diff --git a/examples/nextjs-ts-user-management/components/ProfileList.tsx b/examples/nextjs-ts-user-management/components/ProfileList.tsx index f314bbf4717..955dbc6ee73 100644 --- a/examples/nextjs-ts-user-management/components/ProfileList.tsx +++ b/examples/nextjs-ts-user-management/components/ProfileList.tsx @@ -27,7 +27,7 @@ const handleDatabaseEvent = (state: State, action: Action) => { } } else if (action.type === 'set') { return { - profiles: action.payload + profiles: action.payload, } } return { profiles: [] } diff --git a/examples/nextjs-ts-user-management/pages/index.tsx b/examples/nextjs-ts-user-management/pages/index.tsx index 27061e30b0c..641b2a86e30 100644 --- a/examples/nextjs-ts-user-management/pages/index.tsx +++ b/examples/nextjs-ts-user-management/pages/index.tsx @@ -41,7 +41,7 @@ export default function Home() { } return ( -

+
{!session ? ( ) : ( @@ -50,7 +50,7 @@ export default function Home() {

Account

-
+

Public Profiles

diff --git a/examples/nextjs-ts-user-management/styles/globals.css b/examples/nextjs-ts-user-management/styles/globals.css index 66894133fa9..11e2610e15f 100644 --- a/examples/nextjs-ts-user-management/styles/globals.css +++ b/examples/nextjs-ts-user-management/styles/globals.css @@ -43,7 +43,7 @@ body, position: relative; width: 100%; } -.row [class^="col"] { +.row [class^='col'] { float: left; margin: 0.5rem 2%; min-height: 0.125rem; @@ -99,21 +99,23 @@ body, width: 96%; } .row::after { - content: ""; - display: table; - clear: both; + content: ''; + display: table; + clear: both; } .hidden-sm { display: none; } -@media only screen and (min-width: 33.75em) { /* 540px */ +@media only screen and (min-width: 33.75em) { + /* 540px */ .container { width: 80%; } } -@media only screen and (min-width: 45em) { /* 720px */ +@media only screen and (min-width: 45em) { + /* 720px */ .col-1 { width: 4.33%; } @@ -155,14 +157,14 @@ body, } } -@media only screen and (min-width: 60em) { /* 960px */ +@media only screen and (min-width: 60em) { + /* 960px */ .container { width: 75%; max-width: 60rem; } } - /* Forms */ label { @@ -286,7 +288,7 @@ button.primary, left: 0; right: 0; display: flex; - flex-flow: row; + flex-flow: row; border-top: var(--custom-border); background-color: var(--custom-bg-color); } @@ -300,23 +302,23 @@ button.primary, height: 20px; margin-left: 10px; } -.footer > div:first-child { +.footer > div:first-child { display: none; } -.footer > div:nth-child(2) { +.footer > div:nth-child(2) { justify-content: left; } -@media only screen and (min-width: 60em) { /* 960px */ - .footer > div:first-child { +@media only screen and (min-width: 60em) { + /* 960px */ + .footer > div:first-child { display: flex; } - .footer > div:nth-child(2) { + .footer > div:nth-child(2) { justify-content: center; } } - @keyframes spin { from { transform: rotate(0deg); @@ -345,7 +347,6 @@ button.primary, /* Auth */ - .auth-widget { display: flex; flex-direction: column; diff --git a/examples/nextjs-with-supabase-auth/pages/api/getUser.js b/examples/nextjs-with-supabase-auth/pages/api/getUser.js index 196937de3d8..697667deaf8 100644 --- a/examples/nextjs-with-supabase-auth/pages/api/getUser.js +++ b/examples/nextjs-with-supabase-auth/pages/api/getUser.js @@ -1,13 +1,13 @@ -import { supabase } from '../../utils/initSupabase'; +import { supabase } from '../../utils/initSupabase' // Example of how to verify and get user data server-side. const getUser = async (req, res) => { - const token = req.headers.token; + const token = req.headers.token - const { data: user, error } = await supabase.auth.api.getUser(token); + const { data: user, error } = await supabase.auth.api.getUser(token) - if (error) return res.status(401).json({ error: error.message }); - return res.status(200).json(user); -}; + if (error) return res.status(401).json({ error: error.message }) + return res.status(200).json(user) +} -export default getUser; +export default getUser diff --git a/examples/nuxtjs-user-management/README.md b/examples/nuxtjs-user-management/README.md index f4bdc9bbf65..232e6272351 100644 --- a/examples/nuxtjs-user-management/README.md +++ b/examples/nuxtjs-user-management/README.md @@ -1,7 +1,6 @@ # Supabase Nuxt.js User Management - -This is a WIP! +This is a WIP! ## Build Setup diff --git a/examples/nuxtjs-user-management/assets/global.css b/examples/nuxtjs-user-management/assets/global.css index e5af8869660..9a558221fe5 100644 --- a/examples/nuxtjs-user-management/assets/global.css +++ b/examples/nuxtjs-user-management/assets/global.css @@ -151,7 +151,7 @@ button.primary, left: 0; right: 0; display: flex; - flex-flow: row; + flex-flow: row; border-top: var(--custom-border); } .footer div { diff --git a/examples/react-todo-list-collaborative/README.md b/examples/react-todo-list-collaborative/README.md index 50329dd3c5d..1f4cf746073 100644 --- a/examples/react-todo-list-collaborative/README.md +++ b/examples/react-todo-list-collaborative/README.md @@ -13,7 +13,7 @@ production unless you're ok with all your tasks being publicly available ## Required env vars -Make a `.env` in this folder with the following, +Make a `.env` in this folder with the following, you can get these values from your project dashboard at [app.supabase.io](app.supabase.io): ```bash diff --git a/examples/react-todo-list-collaborative/src/index.css b/examples/react-todo-list-collaborative/src/index.css index 74ad9ea0148..1a960e88593 100644 --- a/examples/react-todo-list-collaborative/src/index.css +++ b/examples/react-todo-list-collaborative/src/index.css @@ -1,8 +1,7 @@ body { margin: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', + 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; background-color: rgb(250, 217, 246); @@ -30,7 +29,7 @@ h1 { display: block; } -@media screen and (max-width : 600px) { +@media screen and (max-width: 600px) { .build { width: 300px; } diff --git a/examples/react-todo-list-collaborative/src/index.js b/examples/react-todo-list-collaborative/src/index.js index 5203b7b007b..fe5fc33a138 100644 --- a/examples/react-todo-list-collaborative/src/index.js +++ b/examples/react-todo-list-collaborative/src/index.js @@ -43,7 +43,10 @@ const Home = (props) => { Tutorial {' '} - | Github + |{' '} + + Github + { - const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`; + const swUrl = `${process.env.PUBLIC_URL}/service-worker.js` if (isLocalhost) { // This is running on localhost. Let's check if a service worker still exists or not. - checkValidServiceWorker(swUrl, config); + checkValidServiceWorker(swUrl, config) // Add some additional logging to localhost, pointing developers to the // service worker/PWA documentation. @@ -44,24 +42,24 @@ export function register(config) { console.log( 'This web app is being served cache-first by a service ' + 'worker. To learn more, visit https://bit.ly/CRA-PWA' - ); - }); + ) + }) } else { // Is not localhost. Just register service worker - registerValidSW(swUrl, config); + registerValidSW(swUrl, config) } - }); + }) } } function registerValidSW(swUrl, config) { navigator.serviceWorker .register(swUrl) - .then(registration => { + .then((registration) => { registration.onupdatefound = () => { - const installingWorker = registration.installing; + const installingWorker = registration.installing if (installingWorker == null) { - return; + return } installingWorker.onstatechange = () => { if (installingWorker.state === 'installed') { @@ -72,30 +70,30 @@ function registerValidSW(swUrl, config) { console.log( 'New content is available and will be used when all ' + 'tabs for this page are closed. See https://bit.ly/CRA-PWA.' - ); + ) // Execute callback if (config && config.onUpdate) { - config.onUpdate(registration); + config.onUpdate(registration) } } else { // At this point, everything has been precached. // It's the perfect time to display a // "Content is cached for offline use." message. - console.log('Content is cached for offline use.'); + console.log('Content is cached for offline use.') // Execute callback if (config && config.onSuccess) { - config.onSuccess(registration); + config.onSuccess(registration) } } } - }; - }; + } + } + }) + .catch((error) => { + console.error('Error during service worker registration:', error) }) - .catch(error => { - console.error('Error during service worker registration:', error); - }); } function checkValidServiceWorker(swUrl, config) { @@ -103,39 +101,37 @@ function checkValidServiceWorker(swUrl, config) { fetch(swUrl, { headers: { 'Service-Worker': 'script' }, }) - .then(response => { + .then((response) => { // Ensure service worker exists, and that we really are getting a JS file. - const contentType = response.headers.get('content-type'); + const contentType = response.headers.get('content-type') if ( response.status === 404 || (contentType != null && contentType.indexOf('javascript') === -1) ) { // No service worker found. Probably a different app. Reload the page. - navigator.serviceWorker.ready.then(registration => { + navigator.serviceWorker.ready.then((registration) => { registration.unregister().then(() => { - window.location.reload(); - }); - }); + window.location.reload() + }) + }) } else { // Service worker found. Proceed as normal. - registerValidSW(swUrl, config); + registerValidSW(swUrl, config) } }) .catch(() => { - console.log( - 'No internet connection found. App is running in offline mode.' - ); - }); + console.log('No internet connection found. App is running in offline mode.') + }) } export function unregister() { if ('serviceWorker' in navigator) { navigator.serviceWorker.ready - .then(registration => { - registration.unregister(); + .then((registration) => { + registration.unregister() + }) + .catch((error) => { + console.error(error.message) }) - .catch(error => { - console.error(error.message); - }); } } diff --git a/examples/react-todo-list/README.md b/examples/react-todo-list/README.md index 7fd2d47ebf0..eceb0493a1f 100644 --- a/examples/react-todo-list/README.md +++ b/examples/react-todo-list/README.md @@ -1,12 +1,11 @@ # Todo example using Supabase -- Frontend: - - [create-react-app](https://reactjs.org/docs/create-a-new-react-app.html). React Framework for building single-page applications. - - [Tailwind](https://tailwindcss.com/) for styling and layout. - - [Supabase.js](https://supabase.io/docs/library/getting-started) for user management and realtime data syncing. -- Backend: - - [app.supabase.io/](https://app.supabase.io/): hosted Postgres database with restful API for usage with Supabase.js. - +- Frontend: + - [create-react-app](https://reactjs.org/docs/create-a-new-react-app.html). React Framework for building single-page applications. + - [Tailwind](https://tailwindcss.com/) for styling and layout. + - [Supabase.js](https://supabase.io/docs/library/getting-started) for user management and realtime data syncing. +- Backend: + - [app.supabase.io/](https://app.supabase.io/): hosted Postgres database with restful API for usage with Supabase.js. ## Demo @@ -24,7 +23,7 @@ Sign up to Supabase - [https://app.supabase.io](https://app.supabase.io) and cre ### 2. Run "Todo List" Quickstart -Once your database has started, run the "Todo List" quickstart. Inside of your project, enter the `SQL editor` tab and scroll down until you see `TODO LIST: Build a basic todo list with Row Level Security` +Once your database has started, run the "Todo List" quickstart. Inside of your project, enter the `SQL editor` tab and scroll down until you see `TODO LIST: Build a basic todo list with Row Level Security` ### 3. Get the URL and Key @@ -36,7 +35,6 @@ The `anon` key is your client-side API key. It allows "anonymous access" to your **_NOTE_**: The `service_role` key has full access to your data, bypassing any security policies. These keys have to be kept secret and are meant to be used in server environments and never on a client or browser. - You will be asked for a `REACT_APP_SUPABASE_URL` and `REACT_APP_SUPABASE_KEY`. Use the API URL and `anon` key from [step 3](#3.-get-the-url-and-key). ## Supabase details @@ -76,6 +74,6 @@ create policy "Individuals can delete their own todos." on todos for ## Authors -- [Supabase](https://supabase.io) +- [Supabase](https://supabase.io) Supabase is open source, we'd love for you to follow along and get involved at https://github.com/supabase/supabase diff --git a/examples/react-todo-list/craco.config.js b/examples/react-todo-list/craco.config.js index 3e346a1d6e8..354563a7aed 100644 --- a/examples/react-todo-list/craco.config.js +++ b/examples/react-todo-list/craco.config.js @@ -1,10 +1,7 @@ -module.exports = { - style: { - postcss: { - plugins: [ - require('tailwindcss'), - require('autoprefixer'), - ], - }, - }, -} \ No newline at end of file +module.exports = { + style: { + postcss: { + plugins: [require("tailwindcss"), require("autoprefixer")], + }, + }, +}; diff --git a/examples/react-todo-list/package.json b/examples/react-todo-list/package.json index 8598f27d2c6..6342e2f09ef 100644 --- a/examples/react-todo-list/package.json +++ b/examples/react-todo-list/package.json @@ -1,44 +1,44 @@ { - "name": "cra-todo-list-auth", - "version": "0.1.0", - "private": true, - "dependencies": { - "@craco/craco": "^6.0.0", - "@supabase/supabase-js": "^1.2.1", - "@tailwindcss/postcss7-compat": "^2.0.2", - "@testing-library/jest-dom": "^5.11.4", - "@testing-library/react": "^11.1.0", - "@testing-library/user-event": "^12.1.10", - "autoprefixer": "9", - "postcss": "8", - "react": "^17.0.1", - "react-dom": "^17.0.1", - "react-scripts": "4.0.1", - "tailwindcss": "npm:@tailwindcss/postcss7-compat", - "web-vitals": "^0.2.4" - }, - "scripts": { - "start": "craco start", - "build": "craco build", - "test": "craco test", - "eject": "react-scripts eject" - }, - "eslintConfig": { - "extends": [ - "react-app", - "react-app/jest" - ] - }, - "browserslist": { - "production": [ - ">0.2%", - "not dead", - "not op_mini all" - ], - "development": [ - "last 1 chrome version", - "last 1 firefox version", - "last 1 safari version" - ] - } + "name": "cra-todo-list-auth", + "version": "0.1.0", + "private": true, + "dependencies": { + "@craco/craco": "^6.0.0", + "@supabase/supabase-js": "^1.2.1", + "@tailwindcss/postcss7-compat": "^2.0.2", + "@testing-library/jest-dom": "^5.11.4", + "@testing-library/react": "^11.1.0", + "@testing-library/user-event": "^12.1.10", + "autoprefixer": "9", + "postcss": "8", + "react": "^17.0.1", + "react-dom": "^17.0.1", + "react-scripts": "4.0.1", + "tailwindcss": "npm:@tailwindcss/postcss7-compat", + "web-vitals": "^0.2.4" + }, + "scripts": { + "start": "craco start", + "build": "craco build", + "test": "craco test", + "eject": "react-scripts eject" + }, + "eslintConfig": { + "extends": [ + "react-app", + "react-app/jest" + ] + }, + "browserslist": { + "production": [ + ">0.2%", + "not dead", + "not op_mini all" + ], + "development": [ + "last 1 chrome version", + "last 1 firefox version", + "last 1 safari version" + ] + } } diff --git a/examples/react-todo-list/public/manifest.json b/examples/react-todo-list/public/manifest.json index 7c4738ea059..74a4e896d47 100644 --- a/examples/react-todo-list/public/manifest.json +++ b/examples/react-todo-list/public/manifest.json @@ -1,15 +1,15 @@ { - "short_name": "CRA Supabase TodoList Example", - "name": "Create React App Supabase TodoList Example", - "icons": [ - { - "src": "favicon.ico", - "sizes": "64x64 32x32 24x24 16x16", - "type": "image/x-icon" - } - ], - "start_url": ".", - "display": "standalone", - "theme_color": "#000000", - "background_color": "#ffffff" + "short_name": "CRA Supabase TodoList Example", + "name": "Create React App Supabase TodoList Example", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" } diff --git a/examples/react-todo-list/src/index.css b/examples/react-todo-list/src/index.css index 5f9522bf954..7ff1e1b4970 100644 --- a/examples/react-todo-list/src/index.css +++ b/examples/react-todo-list/src/index.css @@ -3,11 +3,11 @@ @tailwind utilities; body { - margin: 0; - padding: 0; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', - 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', - sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; -} \ No newline at end of file + margin: 0; + padding: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", + "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", + "Helvetica Neue", sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} diff --git a/examples/react-todo-list/src/index.js b/examples/react-todo-list/src/index.js index ef2edf8ea3f..c9659110dd0 100644 --- a/examples/react-todo-list/src/index.js +++ b/examples/react-todo-list/src/index.js @@ -1,14 +1,14 @@ -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import reportWebVitals from './reportWebVitals'; +import React from "react"; +import ReactDOM from "react-dom"; +import "./index.css"; +import App from "./App"; +import reportWebVitals from "./reportWebVitals"; ReactDOM.render( - - - , - document.getElementById('root') + + + , + document.getElementById("root") ); // If you want to start measuring performance in your app, pass a function diff --git a/examples/react-todo-list/src/lib/api.js b/examples/react-todo-list/src/lib/api.js index d871100811b..fc720649325 100644 --- a/examples/react-todo-list/src/lib/api.js +++ b/examples/react-todo-list/src/lib/api.js @@ -1,5 +1,7 @@ -import { createClient } from '@supabase/supabase-js'; -import { REACT_APP_SUPABASE_URL, REACT_APP_SUPABASE_KEY } from './constants'; - -export const supabase = createClient(REACT_APP_SUPABASE_URL, REACT_APP_SUPABASE_KEY); - +import { createClient } from "@supabase/supabase-js"; +import { REACT_APP_SUPABASE_URL, REACT_APP_SUPABASE_KEY } from "./constants"; + +export const supabase = createClient( + REACT_APP_SUPABASE_URL, + REACT_APP_SUPABASE_KEY +); diff --git a/examples/react-todo-list/src/lib/constants.js b/examples/react-todo-list/src/lib/constants.js index f6ad58573cd..e61e52ffb06 100644 --- a/examples/react-todo-list/src/lib/constants.js +++ b/examples/react-todo-list/src/lib/constants.js @@ -1,2 +1,2 @@ -export const REACT_APP_SUPABASE_URL=process.env.REACT_APP_SUPABASE_URL -export const REACT_APP_SUPABASE_KEY=process.env.REACT_APP_SUPABASE_KEY \ No newline at end of file +export const REACT_APP_SUPABASE_URL = process.env.REACT_APP_SUPABASE_URL; +export const REACT_APP_SUPABASE_KEY = process.env.REACT_APP_SUPABASE_KEY; diff --git a/examples/react-todo-list/src/reportWebVitals.js b/examples/react-todo-list/src/reportWebVitals.js index 5253d3ad9e6..6c7d1fe453e 100644 --- a/examples/react-todo-list/src/reportWebVitals.js +++ b/examples/react-todo-list/src/reportWebVitals.js @@ -1,13 +1,15 @@ -const reportWebVitals = onPerfEntry => { - if (onPerfEntry && onPerfEntry instanceof Function) { - import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { - getCLS(onPerfEntry); - getFID(onPerfEntry); - getFCP(onPerfEntry); - getLCP(onPerfEntry); - getTTFB(onPerfEntry); - }); - } +const reportWebVitals = (onPerfEntry) => { + if (onPerfEntry && onPerfEntry instanceof Function) { + import("web-vitals").then( + ({ getCLS, getFID, getFCP, getLCP, getTTFB }) => { + getCLS(onPerfEntry); + getFID(onPerfEntry); + getFCP(onPerfEntry); + getLCP(onPerfEntry); + getTTFB(onPerfEntry); + } + ); + } }; export default reportWebVitals; diff --git a/examples/react-todo-list/src/setupTests.js b/examples/react-todo-list/src/setupTests.js index 8f2609b7b3e..1dd407a63ef 100644 --- a/examples/react-todo-list/src/setupTests.js +++ b/examples/react-todo-list/src/setupTests.js @@ -2,4 +2,4 @@ // allows you to do things like: // expect(element).toHaveTextContent(/react/i) // learn more: https://github.com/testing-library/jest-dom -import '@testing-library/jest-dom'; +import "@testing-library/jest-dom"; diff --git a/examples/react-todo-list/tailwind.config.js b/examples/react-todo-list/tailwind.config.js index 7b39079d2d1..7596a379624 100644 --- a/examples/react-todo-list/tailwind.config.js +++ b/examples/react-todo-list/tailwind.config.js @@ -1,11 +1,11 @@ module.exports = { - purge: ['./src/**/*.{js,jsx,ts,tsx}', './public/index.html'], - darkMode: false, // or 'media' or 'class' - theme: { - extend: {}, - }, - variants: { - extend: {}, - }, - plugins: [], -} + purge: ["./src/**/*.{js,jsx,ts,tsx}", "./public/index.html"], + darkMode: false, // or 'media' or 'class' + theme: { + extend: {}, + }, + variants: { + extend: {}, + }, + plugins: [], +}; diff --git a/examples/sveltejs-todo-list/_login.js b/examples/sveltejs-todo-list/_login.js index 693b9aa320e..c10059ac099 100644 --- a/examples/sveltejs-todo-list/_login.js +++ b/examples/sveltejs-todo-list/_login.js @@ -9,7 +9,10 @@ const { const supabase = Supabase.createClient(SNOWPACK_PUBLIC_SUPABASE_URL, SNOWPACK_PUBLIC_SUPABASE_KEY) async function login() { try { - const res = await supabase.auth.signIn({email: SNOWPACK_PUBLIC_USER, password:SNOWPACK_PUBLIC_PASSWORD}) + const res = await supabase.auth.signIn({ + email: SNOWPACK_PUBLIC_USER, + password: SNOWPACK_PUBLIC_PASSWORD, + }) console.log({ res }) return res } catch (error) { diff --git a/examples/sveltejs-todo-list/_signup.js b/examples/sveltejs-todo-list/_signup.js index dda05f5fcd8..031ec0d09f1 100644 --- a/examples/sveltejs-todo-list/_signup.js +++ b/examples/sveltejs-todo-list/_signup.js @@ -9,6 +9,9 @@ const { // const [SNOWPACK_PUBLIC_SUPABASE_URL,SNOWPACK_PUBLIC_SUPABASE_KEY] = const supabase = Supabase.createClient(SNOWPACK_PUBLIC_SUPABASE_URL, SNOWPACK_PUBLIC_SUPABASE_KEY) ;(async () => { - let { data, user, error } = await supabase.auth.signUp({email: SNOWPACK_PUBLIC_USER, password:SNOWPACK_PUBLIC_PASSWORD}) + let { data, user, error } = await supabase.auth.signUp({ + email: SNOWPACK_PUBLIC_USER, + password: SNOWPACK_PUBLIC_PASSWORD, + }) console.log({ data, user, error }) })() diff --git a/examples/sveltejs-todo-list/rollup.config.js b/examples/sveltejs-todo-list/rollup.config.js index 8688fa9d869..16983880347 100644 --- a/examples/sveltejs-todo-list/rollup.config.js +++ b/examples/sveltejs-todo-list/rollup.config.js @@ -1,14 +1,14 @@ import run from '@rollup/plugin-run' import svelte from 'rollup-plugin-svelte' // import { skypackResolver } from '@vinicius73/rollup-plugin-skypack-resolver' -import resolve from '@rollup/plugin-node-resolve'; -import commonjs from '@rollup/plugin-commonjs'; +import resolve from '@rollup/plugin-node-resolve' +import commonjs from '@rollup/plugin-commonjs' -import json from '@rollup/plugin-json'; -import injectProcessEnv from 'rollup-plugin-inject-process-env'; +import json from '@rollup/plugin-json' +import injectProcessEnv from 'rollup-plugin-inject-process-env' // env can also be done by replacing strings -> '@rollup/plugin-replace' // import replace from '@rollup/plugin-replace' -import dotenv from "dotenv" +import dotenv from 'dotenv' dotenv.config() export default { @@ -19,8 +19,8 @@ export default { format: 'iife', // format: 'es', name: 'app', - file: 'public/build/bundle.js' -// file: 'bin/dist/prerender.js', + file: 'public/build/bundle.js', + // file: 'bin/dist/prerender.js', }, plugins: [ // skypackResolver({ @@ -28,12 +28,11 @@ export default { // cdnHost: "https://cdn.skypack.dev" // }), json(), - svelte({ - }), + svelte({}), resolve({ - browser: true, - dedupe: ['svelte'] // '@supabase/supabase-js','cypress-svelte-unit-test' - }), + browser: true, + dedupe: ['svelte'], // '@supabase/supabase-js','cypress-svelte-unit-test' + }), commonjs({ include: 'node_modules/**', }), @@ -46,8 +45,8 @@ export default { injectProcessEnv(process.env), run(), ], - onwarn (warning, warn) { - if (warning.code === "UNRESOLVED_IMPORT") return; - warn(warning); - } -} \ No newline at end of file + onwarn(warning, warn) { + if (warning.code === 'UNRESOLVED_IMPORT') return + warn(warning) + }, +} diff --git a/examples/sveltejs-todo-list/snowpack.config.json b/examples/sveltejs-todo-list/snowpack.config.json index d4b3739a24b..8d1d6de2d6c 100644 --- a/examples/sveltejs-todo-list/snowpack.config.json +++ b/examples/sveltejs-todo-list/snowpack.config.json @@ -1,12 +1,12 @@ { "extends": "@snowpack/app-scripts-svelte", - "install": ["@vinicius73/rollup-plugin-skypack-resolver","@supabase/supabase-js"], + "install": ["@vinicius73/rollup-plugin-skypack-resolver", "@supabase/supabase-js"], "scripts": { "mount:src": "mount src --to /_dist_", "mount:public": "mount public --to /" }, "plugins": [ "@snowpack/plugin-dotenv", - ["@snowpack/plugin-svelte", {"compilerOptions":{ "hydratable": true, "css": false }}] + ["@snowpack/plugin-svelte", { "compilerOptions": { "hydratable": true, "css": false } }] ] } diff --git a/examples/sveltejs-todo-list/src/App.test.js b/examples/sveltejs-todo-list/src/App.test.js index c04b7af8332..efa5443d5a0 100644 --- a/examples/sveltejs-todo-list/src/App.test.js +++ b/examples/sveltejs-todo-list/src/App.test.js @@ -1,8 +1,8 @@ -import { render } from "@testing-library/svelte"; -import App from "./App"; +import { render } from '@testing-library/svelte' +import App from './App' -test("renders learn svelte link", () => { - const { getByText } = render(App); - const linkElement = getByText(/learn svelte/i); - expect(linkElement).toBeInTheDocument(); -}); +test('renders learn svelte link', () => { + const { getByText } = render(App) + const linkElement = getByText(/learn svelte/i) + expect(linkElement).toBeInTheDocument() +}) diff --git a/examples/sveltejs-todo-list/src/items.js b/examples/sveltejs-todo-list/src/items.js index e6168e36b12..f9a0a7c3551 100644 --- a/examples/sveltejs-todo-list/src/items.js +++ b/examples/sveltejs-todo-list/src/items.js @@ -1,6 +1,6 @@ // BUG: https://github.com/pikapkg/snowpack/pull/444 // adding "namedExports": ["@supabase/supabase-js"], to snowPack config doesn't work -import {createClient} from '@supabase/supabase-js' +import { createClient } from '@supabase/supabase-js' // import { Socket } = '@supabase/realtime-js' // var socket = new Socket(process.env.REALTIME_URL) diff --git a/examples/sveltejs-todo-list/src/users.js b/examples/sveltejs-todo-list/src/users.js index e57d940cf98..5f19365f777 100644 --- a/examples/sveltejs-todo-list/src/users.js +++ b/examples/sveltejs-todo-list/src/users.js @@ -1,4 +1,4 @@ -import {createClient} from '@supabase/supabase-js' +import { createClient } from '@supabase/supabase-js' let importEnv = true try { diff --git a/examples/sveltejs-todo-list/tests/e2e/new-todo.spec.js b/examples/sveltejs-todo-list/tests/e2e/new-todo.spec.js index 4d39e1c30b9..640015c1dbf 100644 --- a/examples/sveltejs-todo-list/tests/e2e/new-todo.spec.js +++ b/examples/sveltejs-todo-list/tests/e2e/new-todo.spec.js @@ -1,12 +1,10 @@ describe('New todo', () => { it('it should create new todo', () => { - cy.visit('/'); - cy.contains('h1', 'todos'); + cy.visit('/') + cy.contains('h1', 'todos') - cy.get('.new-todo') - .type('Demo') - .type('{enter}'); + cy.get('.new-todo').type('Demo').type('{enter}') - cy.get('.main .todo-list .view').contains('Demo'); - }); -}); + cy.get('.main .todo-list .view').contains('Demo') + }) +}) diff --git a/examples/sveltejs-todo-list/tests/plugins/index.js b/examples/sveltejs-todo-list/tests/plugins/index.js index c5b5e6327d3..f05658edb3a 100644 --- a/examples/sveltejs-todo-list/tests/plugins/index.js +++ b/examples/sveltejs-todo-list/tests/plugins/index.js @@ -12,14 +12,11 @@ // This function is called when a project is opened or re-opened (e.g. due to // the project's config changing) - - /** * @type {Cypress.PluginConfig} */ module.exports = (on, config) => { - // @bahmutov/cy-rollup is already a dependency of cypress-svelte-unit-test - const filePreprocessor = require('@bahmutov/cy-rollup'); - on('file:preprocessor', filePreprocessor()); -}; + const filePreprocessor = require('@bahmutov/cy-rollup') + on('file:preprocessor', filePreprocessor()) +} diff --git a/examples/sveltejs-todo-list/tests/support/index.js b/examples/sveltejs-todo-list/tests/support/index.js index 37a498fb5bf..d68db96df26 100644 --- a/examples/sveltejs-todo-list/tests/support/index.js +++ b/examples/sveltejs-todo-list/tests/support/index.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands'; +import './commands' // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/examples/vue3-ts-todo-list/README.md b/examples/vue3-ts-todo-list/README.md index 701826c1296..9063315c389 100644 --- a/examples/vue3-ts-todo-list/README.md +++ b/examples/vue3-ts-todo-list/README.md @@ -85,23 +85,26 @@ create policy "Individuals can delete their own todos." on todos for Supabase is open source, we'd love for you to follow along and get involved at https://github.com/supabase/supabase +## Local development -## Local development ``` npm install ``` ### Compiles and hot-reloads for development + ``` npm run serve ``` ### Compiles and minifies for production + ``` npm run build ``` ### Lints and fixes files + ``` npm run lint ``` diff --git a/examples/vue3-ts-todo-list/src/assets/tailwind.css b/examples/vue3-ts-todo-list/src/assets/tailwind.css index 55c93d2b330..bddbb1295df 100644 --- a/examples/vue3-ts-todo-list/src/assets/tailwind.css +++ b/examples/vue3-ts-todo-list/src/assets/tailwind.css @@ -6,22 +6,24 @@ /* Write your own custom component styles here */ .btn-black { - @apply border border-black bg-black text-white font-bold py-2 px-4 rounded text-center; -}; + @apply border border-black bg-black text-white font-bold py-2 px-4 rounded text-center; +} .btn-black:hover { - @apply transition duration-150 bg-white text-black; + @apply transition duration-150 bg-white text-black; } .btn-black-outline { - @apply border border-black text-black py-2 px-4 rounded font-bold text-center; + @apply border border-black text-black py-2 px-4 rounded font-bold text-center; } .btn-black-outline:hover { - @apply transition duration-150 bg-black text-white; + @apply transition duration-150 bg-black text-white; } -html, body, #app { - height: 100vh; - min-height: 100vh; -} \ No newline at end of file +html, +body, +#app { + height: 100vh; + min-height: 100vh; +} diff --git a/examples/vue3-ts-todo-list/src/lib/helpers.ts b/examples/vue3-ts-todo-list/src/lib/helpers.ts index 0681ac1aee1..bc509fe214f 100644 --- a/examples/vue3-ts-todo-list/src/lib/helpers.ts +++ b/examples/vue3-ts-todo-list/src/lib/helpers.ts @@ -7,4 +7,4 @@ export function getParameterByName(name: string, url?: string) { if (!results) return null if (!results[2]) return '' return decodeURIComponent(results[2].replace(/\+/g, ' ')) -} \ No newline at end of file +} diff --git a/examples/vue3-ts-todo-list/src/vuetils/useTodo.ts b/examples/vue3-ts-todo-list/src/vuetils/useTodo.ts index 67f20acab7d..1acf0ed6db4 100644 --- a/examples/vue3-ts-todo-list/src/vuetils/useTodo.ts +++ b/examples/vue3-ts-todo-list/src/vuetils/useTodo.ts @@ -9,10 +9,7 @@ const allTodos = ref([]) */ async function fetchTodos() { try { - const { data: todos, error } = await supabase - .from('todos') - .select('*') - .order('id') + const { data: todos, error } = await supabase.from('todos').select('*').order('id') if (error) { console.log('error', error) @@ -36,10 +33,7 @@ async function fetchTodos() { */ async function addTodo(todo: Todo): Promise { try { - const { data, error } = await supabase - .from('todos') - .insert(todo) - .single() + const { data, error } = await supabase.from('todos').insert(todo).single() if (error) { alert(error.message) @@ -85,10 +79,7 @@ async function updateTaskCompletion(todo: Todo, isCompleted: boolean) { */ async function deleteTodo(todo: Todo) { try { - await supabase - .from('todos') - .delete() - .eq('id', todo.id) + await supabase.from('todos').delete().eq('id', todo.id) console.log('deleted todo', todo.id) } catch (error) { console.error('error', error) diff --git a/examples/vue3-ts-todo-list/tsconfig.json b/examples/vue3-ts-todo-list/tsconfig.json index e621cbc3654..92e1dbfa6a9 100644 --- a/examples/vue3-ts-todo-list/tsconfig.json +++ b/examples/vue3-ts-todo-list/tsconfig.json @@ -11,29 +11,12 @@ "allowSyntheticDefaultImports": true, "sourceMap": true, "baseUrl": ".", - "types": [ - "webpack-env" - ], + "types": ["webpack-env"], "paths": { - "@/*": [ - "src/*" - ] + "@/*": ["src/*"] }, - "lib": [ - "esnext", - "dom", - "dom.iterable", - "scripthost" - ] + "lib": ["esnext", "dom", "dom.iterable", "scripthost"] }, - "include": [ - "src/**/*.ts", - "src/**/*.tsx", - "src/**/*.vue", - "tests/**/*.ts", - "tests/**/*.tsx" - ], - "exclude": [ - "node_modules" - ] + "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "tests/**/*.ts", "tests/**/*.tsx"], + "exclude": ["node_modules"] } diff --git a/examples/with-cloudflare-workers/README.md b/examples/with-cloudflare-workers/README.md index 32581008485..1dbf3173959 100644 --- a/examples/with-cloudflare-workers/README.md +++ b/examples/with-cloudflare-workers/README.md @@ -2,11 +2,10 @@ Cloudflare Workers does not support `XMLHttpRequest` object and only support native `fetch`. This means this `supabase-js` client does not work on Cloudflare Workers. Supabase JS Client internally uses `cross-fetch` package to polyfill `fetch` which relies on `XMLHttpRequest`. -To resolve this, we can use `patch-package` to patch `cross-fetch` package as minimal as possible. +To resolve this, we can use `patch-package` to patch `cross-fetch` package as minimal as possible. This repo contains minimal Cloudflare Workers project with the patch automatically applied. - ### Credits -This example was [originally](https://github.com/nascode/cloudflare-workers-supabase-fix) created by [@nascode](https://github.com/nascode). \ No newline at end of file +This example was [originally](https://github.com/nascode/cloudflare-workers-supabase-fix) created by [@nascode](https://github.com/nascode). diff --git a/examples/with-cloudflare-workers/index.js b/examples/with-cloudflare-workers/index.js index c1ceaa94eeb..c8c626f1822 100644 --- a/examples/with-cloudflare-workers/index.js +++ b/examples/with-cloudflare-workers/index.js @@ -1,11 +1,11 @@ -import { createClient } from "@supabase/supabase-js"; +import { createClient } from '@supabase/supabase-js' // Fill you client credential here. -const db = createClient("YOUR_SUPABASE_URL", "YOUR_SUPABASE_KEY"); +const db = createClient('YOUR_SUPABASE_URL', 'YOUR_SUPABASE_KEY') -addEventListener("fetch", (event) => { - event.respondWith(handleRequest(event.request)); -}); +addEventListener('fetch', (event) => { + event.respondWith(handleRequest(event.request)) +}) async function handleRequest(request) { try { @@ -16,10 +16,10 @@ async function handleRequest(request) { // .select("name"); // console.log(JSON.stringify(data, null, 2)); } catch (error) { - console.log(error); + console.log(error) } - return new Response("Hello worker!", { - headers: { "content-type": "text/plain" }, - }); + return new Response('Hello worker!', { + headers: { 'content-type': 'text/plain' }, + }) } diff --git a/examples/with-stencil/.eslintrc.json b/examples/with-stencil/.eslintrc.json index bea7f5364f3..28cc480a5e0 100644 --- a/examples/with-stencil/.eslintrc.json +++ b/examples/with-stencil/.eslintrc.json @@ -2,9 +2,7 @@ "parserOptions": { "project": "./tsconfig.json" }, - "extends": [ - "plugin:@stencil/recommended" - ], + "extends": ["plugin:@stencil/recommended"], "rules": { "@stencil/async-methods": "error", "@stencil/ban-prefix": ["error", ["stencil", "stnl", "st"]], diff --git a/examples/with-stencil/README.md b/examples/with-stencil/README.md index c5c3079cba4..cab1681e000 100644 --- a/examples/with-stencil/README.md +++ b/examples/with-stencil/README.md @@ -1,6 +1,6 @@ # Stencil & Supabase Starter -This is a boilerplate for creating a WebApp using [Stencil](https://github.com/ionic-team/stencil) + [Supabase](https://supabase.io/) + [Stencil Store](https://stenciljs.com/docs/stencil-store). +This is a boilerplate for creating a WebApp using [Stencil](https://github.com/ionic-team/stencil) + [Supabase](https://supabase.io/) + [Stencil Store](https://stenciljs.com/docs/stencil-store). Login Page @@ -38,13 +38,14 @@ src -> config -> config.ts ```js const supabaseConfig = { supabaseUrl: '', - supabaseKey: '' + supabaseKey: '', }; ``` You can find more about _Supabase Client_ config [on the official documentation page](https://supabase.io/docs/reference/javascript/initializing). To start a project, run: + ```sh npm run start ``` @@ -72,7 +73,9 @@ npm run test.watch You can check the details of the [structure of our project through this file](./STRUCTURE.md) ## Contributing 👏 + - [Pull requests](https://github.com/ftonato/stencil-supabase/pulls) and 🌟 stars are always welcome. ## License + [MIT ©](LICENSE) diff --git a/examples/with-stencil/STRUCTURE.md b/examples/with-stencil/STRUCTURE.md index fd06b4edbb7..eaf3cb48da1 100644 --- a/examples/with-stencil/STRUCTURE.md +++ b/examples/with-stencil/STRUCTURE.md @@ -1,46 +1,63 @@ ## Project structure 🗄️ ### Service + This class will handle application authenticate features to supabase. ``` src -> services -> auth.service.ts -> Class SupabaseAuthService ``` + You can create more classes to group a functionality. ### Store + Application store + ``` src -> store -> app.store.ts ``` ### Interfaces + Interfaces used in the application + ``` src -> interface -> interface.ts ``` + ### Utility + Utility for parsing application messages and holding form configurations + ``` src -> util -> util.ts ``` + ### Configuration + Application level configurations + ``` src -> config -> config.ts ``` + ### Assets + Application level assets + ``` src -> assets ``` + ### Components + Application level components ``` src -> components -> 1. for showing alert messages -2. Dashboard +2. Dashboard 3. entry component of the application 5. for showing pages 6. -> having login/register components @@ -48,4 +65,4 @@ src -> components -> ### Styling 💀 -I have used `scss` for styling components. Ths boilerplate have a basic design i.e it focus more on configuring and using supabase in stencil web app along with stencil store. You can customize the looks as per your needs. \ No newline at end of file +I have used `scss` for styling components. Ths boilerplate have a basic design i.e it focus more on configuring and using supabase in stencil web app along with stencil store. You can customize the looks as per your needs. diff --git a/examples/with-stencil/src/components.d.ts b/examples/with-stencil/src/components.d.ts index 4bc51f4e55d..9f20134c1b9 100644 --- a/examples/with-stencil/src/components.d.ts +++ b/examples/with-stencil/src/components.d.ts @@ -4,148 +4,138 @@ * This is an autogenerated file created by the Stencil compiler. * It contains typing information for all components that exist in this project. */ -import { HTMLStencilElement, JSXBase } from "@stencil/core/internal"; -import { RouterHistory } from "@stencil/router"; +import { HTMLStencilElement, JSXBase } from '@stencil/core/internal'; +import { RouterHistory } from '@stencil/router'; export namespace Components { - interface AppAuthLogin { - /** - * history instance. - */ - "history": RouterHistory; - } - interface AppAuthRegister { - /** - * history instance. - */ - "history": RouterHistory; - } - interface AppFlashMessage { - /** - * alert closable. - */ - "closable": boolean; - /** - * Show/hide alert message - */ - "show": boolean; - /** - * Message type - */ - "type": string; - } - interface AppHome { - } - interface AppPageHome { - } - interface AppRoot { - /** - * history instance. - */ - "history": RouterHistory; - } + interface AppAuthLogin { + /** + * history instance. + */ + history: RouterHistory; + } + interface AppAuthRegister { + /** + * history instance. + */ + history: RouterHistory; + } + interface AppFlashMessage { + /** + * alert closable. + */ + closable: boolean; + /** + * Show/hide alert message + */ + show: boolean; + /** + * Message type + */ + type: string; + } + interface AppHome {} + interface AppPageHome {} + interface AppRoot { + /** + * history instance. + */ + history: RouterHistory; + } } declare global { - interface HTMLAppAuthLoginElement extends Components.AppAuthLogin, HTMLStencilElement { - } - var HTMLAppAuthLoginElement: { - prototype: HTMLAppAuthLoginElement; - new (): HTMLAppAuthLoginElement; - }; - interface HTMLAppAuthRegisterElement extends Components.AppAuthRegister, HTMLStencilElement { - } - var HTMLAppAuthRegisterElement: { - prototype: HTMLAppAuthRegisterElement; - new (): HTMLAppAuthRegisterElement; - }; - interface HTMLAppFlashMessageElement extends Components.AppFlashMessage, HTMLStencilElement { - } - var HTMLAppFlashMessageElement: { - prototype: HTMLAppFlashMessageElement; - new (): HTMLAppFlashMessageElement; - }; - interface HTMLAppHomeElement extends Components.AppHome, HTMLStencilElement { - } - var HTMLAppHomeElement: { - prototype: HTMLAppHomeElement; - new (): HTMLAppHomeElement; - }; - interface HTMLAppPageHomeElement extends Components.AppPageHome, HTMLStencilElement { - } - var HTMLAppPageHomeElement: { - prototype: HTMLAppPageHomeElement; - new (): HTMLAppPageHomeElement; - }; - interface HTMLAppRootElement extends Components.AppRoot, HTMLStencilElement { - } - var HTMLAppRootElement: { - prototype: HTMLAppRootElement; - new (): HTMLAppRootElement; - }; - interface HTMLElementTagNameMap { - "app-auth-login": HTMLAppAuthLoginElement; - "app-auth-register": HTMLAppAuthRegisterElement; - "app-flash-message": HTMLAppFlashMessageElement; - "app-home": HTMLAppHomeElement; - "app-page-home": HTMLAppPageHomeElement; - "app-root": HTMLAppRootElement; - } + interface HTMLAppAuthLoginElement extends Components.AppAuthLogin, HTMLStencilElement {} + var HTMLAppAuthLoginElement: { + prototype: HTMLAppAuthLoginElement; + new (): HTMLAppAuthLoginElement; + }; + interface HTMLAppAuthRegisterElement extends Components.AppAuthRegister, HTMLStencilElement {} + var HTMLAppAuthRegisterElement: { + prototype: HTMLAppAuthRegisterElement; + new (): HTMLAppAuthRegisterElement; + }; + interface HTMLAppFlashMessageElement extends Components.AppFlashMessage, HTMLStencilElement {} + var HTMLAppFlashMessageElement: { + prototype: HTMLAppFlashMessageElement; + new (): HTMLAppFlashMessageElement; + }; + interface HTMLAppHomeElement extends Components.AppHome, HTMLStencilElement {} + var HTMLAppHomeElement: { + prototype: HTMLAppHomeElement; + new (): HTMLAppHomeElement; + }; + interface HTMLAppPageHomeElement extends Components.AppPageHome, HTMLStencilElement {} + var HTMLAppPageHomeElement: { + prototype: HTMLAppPageHomeElement; + new (): HTMLAppPageHomeElement; + }; + interface HTMLAppRootElement extends Components.AppRoot, HTMLStencilElement {} + var HTMLAppRootElement: { + prototype: HTMLAppRootElement; + new (): HTMLAppRootElement; + }; + interface HTMLElementTagNameMap { + 'app-auth-login': HTMLAppAuthLoginElement; + 'app-auth-register': HTMLAppAuthRegisterElement; + 'app-flash-message': HTMLAppFlashMessageElement; + 'app-home': HTMLAppHomeElement; + 'app-page-home': HTMLAppPageHomeElement; + 'app-root': HTMLAppRootElement; + } } declare namespace LocalJSX { - interface AppAuthLogin { - /** - * history instance. - */ - "history"?: RouterHistory; - } - interface AppAuthRegister { - /** - * history instance. - */ - "history"?: RouterHistory; - } - interface AppFlashMessage { - /** - * alert closable. - */ - "closable"?: boolean; - /** - * Show/hide alert message - */ - "show"?: boolean; - /** - * Message type - */ - "type"?: string; - } - interface AppHome { - } - interface AppPageHome { - } - interface AppRoot { - /** - * history instance. - */ - "history"?: RouterHistory; - } - interface IntrinsicElements { - "app-auth-login": AppAuthLogin; - "app-auth-register": AppAuthRegister; - "app-flash-message": AppFlashMessage; - "app-home": AppHome; - "app-page-home": AppPageHome; - "app-root": AppRoot; - } + interface AppAuthLogin { + /** + * history instance. + */ + history?: RouterHistory; + } + interface AppAuthRegister { + /** + * history instance. + */ + history?: RouterHistory; + } + interface AppFlashMessage { + /** + * alert closable. + */ + closable?: boolean; + /** + * Show/hide alert message + */ + show?: boolean; + /** + * Message type + */ + type?: string; + } + interface AppHome {} + interface AppPageHome {} + interface AppRoot { + /** + * history instance. + */ + history?: RouterHistory; + } + interface IntrinsicElements { + 'app-auth-login': AppAuthLogin; + 'app-auth-register': AppAuthRegister; + 'app-flash-message': AppFlashMessage; + 'app-home': AppHome; + 'app-page-home': AppPageHome; + 'app-root': AppRoot; + } } export { LocalJSX as JSX }; -declare module "@stencil/core" { - export namespace JSX { - interface IntrinsicElements { - "app-auth-login": LocalJSX.AppAuthLogin & JSXBase.HTMLAttributes; - "app-auth-register": LocalJSX.AppAuthRegister & JSXBase.HTMLAttributes; - "app-flash-message": LocalJSX.AppFlashMessage & JSXBase.HTMLAttributes; - "app-home": LocalJSX.AppHome & JSXBase.HTMLAttributes; - "app-page-home": LocalJSX.AppPageHome & JSXBase.HTMLAttributes; - "app-root": LocalJSX.AppRoot & JSXBase.HTMLAttributes; - } +declare module '@stencil/core' { + export namespace JSX { + interface IntrinsicElements { + 'app-auth-login': LocalJSX.AppAuthLogin & JSXBase.HTMLAttributes; + 'app-auth-register': LocalJSX.AppAuthRegister & JSXBase.HTMLAttributes; + 'app-flash-message': LocalJSX.AppFlashMessage & JSXBase.HTMLAttributes; + 'app-home': LocalJSX.AppHome & JSXBase.HTMLAttributes; + 'app-page-home': LocalJSX.AppPageHome & JSXBase.HTMLAttributes; + 'app-root': LocalJSX.AppRoot & JSXBase.HTMLAttributes; } + } } diff --git a/examples/with-stencil/src/components/app-flash-message/app-flash-message.tsx b/examples/with-stencil/src/components/app-flash-message/app-flash-message.tsx index c35d4632cdb..79a7e7417c1 100644 --- a/examples/with-stencil/src/components/app-flash-message/app-flash-message.tsx +++ b/examples/with-stencil/src/components/app-flash-message/app-flash-message.tsx @@ -6,26 +6,24 @@ import { Component, h, Prop, Watch } from '@stencil/core'; - @Component({ tag: 'app-flash-message', - styleUrl: 'app-flash-message.scss' + styleUrl: 'app-flash-message.scss', }) export class AppFlashMessage { - /** - * Message type - */ + * Message type + */ @Prop() type: string = ''; /** * alert closable. - */ + */ @Prop() closable: boolean = true; /** - * Show/hide alert message - */ + * Show/hide alert message + */ @Prop({ mutable: true, reflect: true }) show = true; @Watch('show') @@ -38,10 +36,10 @@ export class AppFlashMessage { } /** - * Hide message - * - * @returns {(null | void)} - */ + * Hide message + * + * @returns {(null | void)} + */ async hideMessage() { if (!this.show) { return null; @@ -50,10 +48,10 @@ export class AppFlashMessage { } /** - * Show message - * - * @returns {(null | void)} - */ + * Show message + * + * @returns {(null | void)} + */ async showMessage() { if (this.show) { return null; @@ -69,22 +67,26 @@ export class AppFlashMessage { } /** - * Render component - * - * @returns {void} - */ + * Render component + * + * @returns {void} + */ render() { return ( ); diff --git a/examples/with-stencil/src/components/app-home/app-home.tsx b/examples/with-stencil/src/components/app-home/app-home.tsx index 30969bb98a5..4906db74827 100644 --- a/examples/with-stencil/src/components/app-home/app-home.tsx +++ b/examples/with-stencil/src/components/app-home/app-home.tsx @@ -11,48 +11,67 @@ import { appConfig } from '../../config/config'; @Component({ tag: 'app-home', styleUrl: 'app-home.scss', - }) export class AppHome { - /** - * Render component - * - * @returns {void} - */ + * Render component + * + * @returns {void} + */ render() { return ( -
+
diff --git a/examples/with-stencil/src/components/app-root/app-root.tsx b/examples/with-stencil/src/components/app-root/app-root.tsx index e6f873b12b9..297bc97a10b 100644 --- a/examples/with-stencil/src/components/app-root/app-root.tsx +++ b/examples/with-stencil/src/components/app-root/app-root.tsx @@ -7,8 +7,8 @@ import { Component, h, Prop } from '@stencil/core'; import { RouterHistory } from '@stencil/router'; -import { AppState } from "../../store/app.store"; -import { AuthService } from "../../services/auth.service"; +import { AppState } from '../../store/app.store'; +import { AuthService } from '../../services/auth.service'; import { appConfig } from '../../config/config'; /** @@ -24,83 +24,79 @@ const PrivateRoute = ({ component, ...props }: { [key: string]: any }) => { const Component = component; return ( - { + { if (AppState.isAuthenticated) { return ; } - return - } - } /> + return ; + }} + /> ); -} +}; @Component({ tag: 'app-root', styleUrl: 'app-root.scss', - }) export class AppRoot { /** - * AuthService instance. - * @name authService - * @type {Object} - */ + * AuthService instance. + * @name authService + * @type {Object} + */ private authService = AuthService; /** - * history instance. - */ + * history instance. + */ @Prop() history: RouterHistory; /** - * handle logout - * - * @returns {void} - */ + * handle logout + * + * @returns {void} + */ async logout() { await this.authService.logOut(); } /** - * Render component - * - * @returns {void} - */ + * Render component + * + * @returns {void} + */ render() { if (AppState.appInit === true) { - return (
Loading...
); + return
Loading...
; } if (AppState.appInitError != '') { - return ({AppState.appInitError}); + return {AppState.appInitError}; } - const titleSuffix = ` | ${appConfig.pageTitlePrefix}` + const titleSuffix = ` | ${appConfig.pageTitlePrefix}`; return (
- { - AppState.isAuthenticated && + {AppState.isAuthenticated && (
- { - AppState.user - && ( -
- - Welcome {' ' + AppState.user.email + ' '} - - this.logout()}> - Logout - -
- ) - } + {AppState.user && ( +
+ + Welcome {' ' + AppState.user.email + ' '} + + this.logout()}> + Logout + +
+ )}
- } + )}
- - + + diff --git a/examples/with-stencil/src/components/auth/login/app-auth-login.tsx b/examples/with-stencil/src/components/auth/login/app-auth-login.tsx index 0d222a4ff04..51f991cd184 100644 --- a/examples/with-stencil/src/components/auth/login/app-auth-login.tsx +++ b/examples/with-stencil/src/components/auth/login/app-auth-login.tsx @@ -6,8 +6,8 @@ import { Component, h, Prop, State } from '@stencil/core'; import { RouterHistory } from '@stencil/router'; -import { AppState } from "../../../store/app.store"; -import { AuthService } from "../../../services/auth.service"; +import { AppState } from '../../../store/app.store'; +import { AuthService } from '../../../services/auth.service'; import { httpCode, appConfig } from '../../../config/config'; import { getFormValidations } from '../../../util/util'; @@ -16,7 +16,6 @@ import { getFormValidations } from '../../../util/util'; styleUrl: '../shared/app-auth-shared.scss', }) export class AppLogin { - /** * AuthService instance. * @name authService @@ -25,15 +24,15 @@ export class AppLogin { private authService = AuthService; /** - * history instance. - */ + * history instance. + */ @Prop() history: RouterHistory; /** - * Register form inputs and validations - * @name formControls - * @type {Object} - */ + * Register form inputs and validations + * @name formControls + * @type {Object} + */ @State() formControls = getFormValidations('login'); /** @@ -44,45 +43,45 @@ export class AppLogin { @State() submitted = false; /** - * Form loading state - * @name formLoader - * @type {boolean} - */ + * Form loading state + * @name formLoader + * @type {boolean} + */ @State() formLoader = false; /** - * Form error state - * @name loginError - * @type {string} - */ - @State() loginError: string = ""; + * Form error state + * @name loginError + * @type {string} + */ + @State() loginError: string = ''; /** - * handle form values and do the validation work - * @param {string} controlName Control name for register form - * @param {any} value Control value for register form - * - * @returns {void} - */ + * handle form values and do the validation work + * @param {string} controlName Control name for register form + * @param {any} value Control value for register form + * + * @returns {void} + */ changeFormValue(controlName, value) { this.formControls = { ...this.formControls, [controlName]: { ...this.formControls[controlName], value: value, - isValid: this.formControls[controlName].validate(value) - } + isValid: this.formControls[controlName].validate(value), + }, }; } /** - * Handle login form - * Check user in supabase - * Redirect user to dashboard - * @param {event} e Form submit event - * - * @returns {void} - */ + * Handle login form + * Check user in supabase + * Redirect user to dashboard + * @param {event} e Form submit event + * + * @returns {void} + */ async handleLogin(e) { e.preventDefault(); this.submitted = true; @@ -110,13 +109,13 @@ export class AppLogin { } /** - * Render component - * - * @returns {void} - */ + * Render component + * + * @returns {void} + */ render() { if (AppState.isAuthenticated) { - return + return ; } return (
@@ -128,40 +127,40 @@ export class AppLogin { Don't have an account? Register
@@ -219,9 +216,7 @@ export class AppLogin { stroke-linejoin="round" > - +
diff --git a/examples/with-stencil/src/components/auth/register/app-auth-register.tsx b/examples/with-stencil/src/components/auth/register/app-auth-register.tsx index b1ea63568ad..c1346fada77 100644 --- a/examples/with-stencil/src/components/auth/register/app-auth-register.tsx +++ b/examples/with-stencil/src/components/auth/register/app-auth-register.tsx @@ -6,7 +6,7 @@ import { Component, State, h, Prop } from '@stencil/core'; import { RouterHistory } from '@stencil/router'; -import { AuthService } from "../../../services/auth.service"; +import { AuthService } from '../../../services/auth.service'; import { AppState } from '../../../store/app.store'; import { httpCode, appConfig } from '../../../config/config'; import { getFormValidations } from '../../../util/util'; @@ -16,66 +16,64 @@ import { getFormValidations } from '../../../util/util'; styleUrl: '../shared/app-auth-shared.scss', }) export class AppAuthRegister { - /** - * AuthService instance. - * @name authService - * @type {Object} - */ + * AuthService instance. + * @name authService + * @type {Object} + */ private authService = AuthService; /** - * history instance. - */ + * history instance. + */ @Prop() history: RouterHistory; /** - * Register form inputs and validations - */ + * Register form inputs and validations + */ @State() formControls = getFormValidations('register'); /** - * Form submission state - */ + * Form submission state + */ @State() submitted = false; /** - * Form loading state - */ + * Form loading state + */ @State() formLoader = false; /** - * Form error state - */ + * Form error state + */ @State() registerError: string = ''; - /** - * handle form values and do the validation work - * @param {string} controlName Control name for register form - * @param {any} value Control value for register form - * - * @returns {void} - */ + * handle form values and do the validation work + * @param {string} controlName Control name for register form + * @param {any} value Control value for register form + * + * @returns {void} + */ changeFormValue(controlName, value) { this.formControls = { ...this.formControls, [controlName]: { ...this.formControls[controlName], value: value, - isValid: this.formControls[controlName].validate(value) - } + isValid: this.formControls[controlName].validate(value), + }, }; } /** - * Handle register form - * Save user in supabase and update username - * Redirect user to dashboard - * @param {event} e Form submit event - * - * @returns {void} - */ + * Handle register form + * Save user in supabase and update username + * Redirect user to dashboard + * @param {event} e Form submit event + * + * @returns {void} + */ async handleRegister(e) { e.preventDefault(); this.submitted = true; @@ -89,7 +87,7 @@ export class AppAuthRegister { } } if (isFormValid) { - this.formLoader = true + this.formLoader = true; this.registerError = ''; const registerRes = await this.authService.register({ email: this.formControls.email.value, password: this.formControls.password.value }); if (registerRes.status == httpCode.success) { @@ -103,13 +101,13 @@ export class AppAuthRegister { } /** - * Render component - * - * @returns {void} - */ + * Render component + * + * @returns {void} + */ render() { if (AppState.isAuthenticated) { - return + return ; } return (
@@ -121,41 +119,40 @@ export class AppAuthRegister { Do you have an account? Login
-

Welcome to Stencil & Supabase starter App

-

- Insert your profile data to be able to navigate through the app -

+

+ Welcome to Stencil & Supabase starter App +

+

Insert your profile data to be able to navigate through the app

this.handleRegister(e)} novalidate> -
- this.changeFormValue("email", ev.target.value)} /> - - { - (!this.formControls.email.isValid && - this.submitted === true) && - Please enter your email - } + onInput={(ev: any) => this.changeFormValue('email', ev.target.value)} + /> + {!this.formControls.email.isValid && this.submitted === true && Please enter your email}
- this.changeFormValue("password", ev.target.value)} + onInput={(ev: any) => this.changeFormValue('password', ev.target.value)} /> - { - (!this.formControls.password.isValid && - this.submitted === true) && - Please enter your password - } - + {!this.formControls.password.isValid && this.submitted === true && Please enter your password}
- +
diff --git a/examples/with-stencil/src/components/page/home/app-page-home.tsx b/examples/with-stencil/src/components/page/home/app-page-home.tsx index 21451c4145c..f59227164a3 100644 --- a/examples/with-stencil/src/components/page/home/app-page-home.tsx +++ b/examples/with-stencil/src/components/page/home/app-page-home.tsx @@ -3,17 +3,15 @@ import { Component, h } from '@stencil/core'; @Component({ tag: 'app-page-home', styleUrl: 'app-page-home.scss', - }) export class AppPageHome { - render() { return (

Page not found ~ 404

The page you are requested is not found.

- +
Back to Home
diff --git a/examples/with-stencil/src/config/config.ts b/examples/with-stencil/src/config/config.ts index 67070f4df9f..5227b162c3b 100644 --- a/examples/with-stencil/src/config/config.ts +++ b/examples/with-stencil/src/config/config.ts @@ -1,13 +1,12 @@ - const supabaseConfig = { supabaseUrl: 'https://akakxshwrukpetyzjnyi.supabase.co', - supabaseKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMDk3ODA4OSwiZXhwIjoxOTI2NTU0MDg5fQ.xQTiGKgZ0p7Ch1paDP2KCExiVhFeqZicLm4s36XFUIk' + supabaseKey: 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlhdCI6MTYxMDk3ODA4OSwiZXhwIjoxOTI2NTU0MDg5fQ.xQTiGKgZ0p7Ch1paDP2KCExiVhFeqZicLm4s36XFUIk', }; const httpCode = { success: 200, notFound: 404, - serverError: 504 + serverError: 504, }; const appName: string = 'Stencil & Supabase'; @@ -19,13 +18,9 @@ const appConfig = { login: 'Login', register: 'Register', dashboard: 'Dashboard', - password: 'Update Password' + password: 'Update Password', }, - loadingBtnTxt: 'Loading...' + loadingBtnTxt: 'Loading...', }; -export { - supabaseConfig, - httpCode, - appConfig -} +export { supabaseConfig, httpCode, appConfig }; diff --git a/examples/with-stencil/src/interface/interface.ts b/examples/with-stencil/src/interface/interface.ts index 1b4082516fb..baddc71a194 100644 --- a/examples/with-stencil/src/interface/interface.ts +++ b/examples/with-stencil/src/interface/interface.ts @@ -1,29 +1,24 @@ interface ICM { - [key: string]: any + [key: string]: any; } interface IBaseRes { - status: number; - data: any, - message: string; - errors?: ICM + status: number; + data: any; + message: string; + errors?: ICM; } interface IUserBase { - email: string; - password: string; + email: string; + password: string; } interface IUserRegister extends IUserBase { - name?: string + name?: string; } interface IUserLogin extends IUserBase { - stayLoggedIn?: boolean + stayLoggedIn?: boolean; } interface IErrorRes { - code: string; - message: any -} -export { - IBaseRes, - IUserRegister, - IUserLogin, - IErrorRes + code: string; + message: any; } +export { IBaseRes, IUserRegister, IUserLogin, IErrorRes }; diff --git a/examples/with-stencil/src/manifest.json b/examples/with-stencil/src/manifest.json index 4607c5d5cb5..ae7b01fd257 100644 --- a/examples/with-stencil/src/manifest.json +++ b/examples/with-stencil/src/manifest.json @@ -3,11 +3,13 @@ "short_name": "Stencil Supabase", "start_url": "/", "display": "standalone", - "icons": [{ - "src": "assets/icon/icon.png", - "sizes": "512x512", - "type": "image/png" - }], + "icons": [ + { + "src": "assets/icon/icon.png", + "sizes": "512x512", + "type": "image/png" + } + ], "background_color": "#16161d", "theme_color": "#16161d" } diff --git a/examples/with-stencil/src/services/auth.service.ts b/examples/with-stencil/src/services/auth.service.ts index 79d37a32f97..bc323ece8aa 100644 --- a/examples/with-stencil/src/services/auth.service.ts +++ b/examples/with-stencil/src/services/auth.service.ts @@ -6,37 +6,36 @@ * */ -import SupabaseService from './supabase.service' -import { supabaseConfig, httpCode } from "../config/config"; -import { AppState, setStateProp } from "../store/app.store"; -import { IBaseRes, IUserRegister, IUserLogin } from "../interface/interface"; -import { appMsg } from "../util/util"; +import SupabaseService from './supabase.service'; +import { supabaseConfig, httpCode } from '../config/config'; +import { AppState, setStateProp } from '../store/app.store'; +import { IBaseRes, IUserRegister, IUserLogin } from '../interface/interface'; +import { appMsg } from '../util/util'; class SupabaseAuthService { supabase: any; /** - * @constructor - */ + * @constructor + */ constructor() { const connection = new SupabaseService(supabaseConfig.supabaseUrl, supabaseConfig.supabaseKey); this.supabase = connection.supabase; - this.init() + this.init(); } /** - * Initialize supabase instance - * If user is already login set user state - * @name init - * - * @returns {void} - */ + * Initialize supabase instance + * If user is already login set user state + * @name init + * + * @returns {void} + */ private init(): void { - setStateProp('appInit', true) + setStateProp('appInit', true); try { this.supabase.auth.onAuthStateChange((_event, session) => { - if (session) { AppState.user = session.user; AppState.isAuthenticated = true; @@ -44,10 +43,9 @@ class SupabaseAuthService { AppState.user = undefined; AppState.isAuthenticated = false; } - }) + }); AppState.appInit = false; - } catch (error) { const errorRes = this.buildErrorRes(httpCode.serverError, error); AppState.appInit = false; @@ -56,55 +54,55 @@ class SupabaseAuthService { } /** - * Build success response - * @name buildRes - * - * @param {number} status status code - * @param {any} data response data - * @param {string} message message to show - * @param {any} errors errors object if any - * - * @returns {IBaseRes} - */ + * Build success response + * @name buildRes + * + * @param {number} status status code + * @param {any} data response data + * @param {string} message message to show + * @param {any} errors errors object if any + * + * @returns {IBaseRes} + */ private buildRes(status: number, data?: any, message?: string, errors?: any): IBaseRes { return { status, data, errors, - message - } + message, + }; } /** - * Build error response - * @name buildErrorRes - * - * @param {number} status status code - * @param {any} errors errors object if any - * - * @returns {IBaseRes} - */ + * Build error response + * @name buildErrorRes + * + * @param {number} status status code + * @param {any} errors errors object if any + * + * @returns {IBaseRes} + */ private buildErrorRes(status: number, errors?: any): IBaseRes { return { status: status, data: null, errors: {}, - message: errors.error_description ? errors.error_description : errors - } + message: errors.error_description ? errors.error_description : errors, + }; } /** - * Handle supabase login - * @name login - * - * @param {IUserLogin} userData - * - * @returns {IBaseRes} Promise that represents object - */ - async login({email, password}: IUserLogin): Promise { - let _error = null + * Handle supabase login + * @name login + * + * @param {IUserLogin} userData + * + * @returns {IBaseRes} Promise that represents object + */ + async login({ email, password }: IUserLogin): Promise { + let _error = null; try { - const { error, data } = await this.supabase.auth.signIn({ email, password}); + const { error, data } = await this.supabase.auth.signIn({ email, password }); if (error) { _error = error.message; @@ -113,20 +111,20 @@ class SupabaseAuthService { return this.buildRes(httpCode.success, data); } catch (er) { - alert('x') + alert('x'); return this.buildErrorRes(httpCode.serverError, _error); } } /** - * Handle supabase registration - * @name register - * - * @param {IUserRegister} userData - * - * - */ -// @returns {IBaseRes} Promise that represents object + * Handle supabase registration + * @name register + * + * @param {IUserRegister} userData + * + * + */ + // @returns {IBaseRes} Promise that represents object async register(userData: IUserRegister) /* Promise */ { try { const { error, data } = await this.supabase.auth.signUp({ email: userData.email, password: userData.password }); @@ -141,11 +139,11 @@ class SupabaseAuthService { } /** - * Handle supabase logout - * @name logOut - * - * @returns {IBaseRes} Promise that represents object - */ + * Handle supabase logout + * @name logOut + * + * @returns {IBaseRes} Promise that represents object + */ async logOut(): Promise { try { if (AppState.isAuthenticated) { @@ -164,20 +162,20 @@ class SupabaseAuthService { } /** - * Handle supabase update user profile - * @name updateProfile - * - * @param {string} email - * - * @returns {IBaseRes} Promise that represents object - */ + * Handle supabase update user profile + * @name updateProfile + * + * @param {string} email + * + * @returns {IBaseRes} Promise that represents object + */ async updateProfile(email: string): Promise { try { AppState.user = { ...AppState.user, email, }; - AppState.isAuthenticated = true + AppState.isAuthenticated = true; return this.buildRes(httpCode.success, {}, appMsg('update-profile')); } catch (error) { diff --git a/examples/with-stencil/src/services/supabase.service.ts b/examples/with-stencil/src/services/supabase.service.ts index c984974ce67..9eb2e2c8515 100644 --- a/examples/with-stencil/src/services/supabase.service.ts +++ b/examples/with-stencil/src/services/supabase.service.ts @@ -1,6 +1,6 @@ -import { createClient } from '@supabase/supabase-js' +import { createClient } from '@supabase/supabase-js'; -let instance = null +let instance = null; /** * This class is a singleton service to handle Supabase connection. @@ -11,22 +11,21 @@ let instance = null * */ export default class SupabaseService { - supabase: any + supabase: any; constructor(supabaseUrl: string, supabaseKey: string) { - - if (!supabaseUrl) throw new Error(`${SupabaseService.getClassName()} => supabaseUrl is required.`) - if (!supabaseKey) throw new Error(`${SupabaseService.getClassName()} => supabaseKey is required.`) + if (!supabaseUrl) throw new Error(`${SupabaseService.getClassName()} => supabaseUrl is required.`); + if (!supabaseKey) throw new Error(`${SupabaseService.getClassName()} => supabaseKey is required.`); if (!instance) { - instance = this + instance = this; } - this.supabase = createClient(supabaseUrl, supabaseKey) + this.supabase = createClient(supabaseUrl, supabaseKey); - return instance + return instance; } static getClassName(): string { - return SupabaseService.name + return SupabaseService.name; } } diff --git a/examples/with-stencil/src/store/app.store.ts b/examples/with-stencil/src/store/app.store.ts index e5aecb453cd..5de3fa09a6b 100644 --- a/examples/with-stencil/src/store/app.store.ts +++ b/examples/with-stencil/src/store/app.store.ts @@ -6,20 +6,20 @@ const store = createStore({ appInitError: '', appInit: false, registerLoader: false, - loginLoader: false + loginLoader: false, }); -store.onChange('isAuthenticated', (value) => { - AppState.isAuthenticated = value; +store.onChange('isAuthenticated', value => { + AppState.isAuthenticated = value; }); -store.onChange('user', (value) => { - AppState.user = value; +store.onChange('user', value => { + AppState.user = value; }); -store.onChange('appInitError', (value) => { - AppState.appInitError = value; +store.onChange('appInitError', value => { + AppState.appInitError = value; }); -store.onChange('appInit', (value) => { - AppState.appInit = value; +store.onChange('appInit', value => { + AppState.appInit = value; }); export const AppState = store.state; diff --git a/examples/with-stencil/src/util/util.ts b/examples/with-stencil/src/util/util.ts index 1863efc6206..18d24126ac4 100644 --- a/examples/with-stencil/src/util/util.ts +++ b/examples/with-stencil/src/util/util.ts @@ -9,38 +9,35 @@ const appMsg = (key: string): string => { }; const checkEmpty = (value: any): boolean => { return value; -} +}; const getFormValidations = (key, values = {}) => { const validations = { login: { email: { value: values['email'] ? values['email'] : null, validate: checkEmpty, - isValid: values['email'] ? true : false + isValid: values['email'] ? true : false, }, password: { value: values['password'] ? values['password'] : null, validate: checkEmpty, - isValid: values['password'] ? true : false - } + isValid: values['password'] ? true : false, + }, }, register: { email: { value: values['email'] ? values['email'] : null, validate: checkEmpty, - isValid: values['email'] ? true : false + isValid: values['email'] ? true : false, }, password: { value: values['password'] ? values['password'] : null, validate: checkEmpty, - isValid: values['password'] ? true : false - } + isValid: values['password'] ? true : false, + }, }, }; - return validations[key] ? validations[key] : {} -} + return validations[key] ? validations[key] : {}; +}; -export { - appMsg, - getFormValidations -} +export { appMsg, getFormValidations }; diff --git a/examples/with-stencil/stencil.config.ts b/examples/with-stencil/stencil.config.ts index 192937dd1e2..89a8e0b9dd4 100644 --- a/examples/with-stencil/stencil.config.ts +++ b/examples/with-stencil/stencil.config.ts @@ -12,13 +12,7 @@ export const config: Config = { // Comment the following line to disable service workers in production serviceWorker: null, baseUrl: 'https://stencil-supabase.local/', - } + }, ], - plugins: [ - sass( - {injectGlobalPaths: [ - 'src/assets/scss/helpers/variables.scss' - ]} - ) - ] + plugins: [sass({ injectGlobalPaths: ['src/assets/scss/helpers/variables.scss'] })], }; diff --git a/examples/with-stencil/tsconfig.json b/examples/with-stencil/tsconfig.json index 34bb4447cfb..fc892c2fb44 100644 --- a/examples/with-stencil/tsconfig.json +++ b/examples/with-stencil/tsconfig.json @@ -4,10 +4,7 @@ "allowUnreachableCode": false, "declaration": false, "experimentalDecorators": true, - "lib": [ - "dom", - "es2015" - ], + "lib": ["dom", "es2015"], "moduleResolution": "node", "module": "esnext", "target": "es2017", @@ -16,10 +13,6 @@ "jsx": "react", "jsxFactory": "h" }, - "include": [ - "src" - ], - "exclude": [ - "node_modules" - ] + "include": ["src"], + "exclude": ["node_modules"] } diff --git a/i18n/README.da.md b/i18n/README.da.md index abfc9950cfb..d49510f286b 100644 --- a/i18n/README.da.md +++ b/i18n/README.da.md @@ -41,7 +41,7 @@ Vi er i øjeblikket i Offentlig beta. Hold øje med udgivelser på denne side fo ## Hvordan virker det -Supabase er en kombination af open source værktøjer. Vi bygger Firebase fuktioner med open source produkter der er egnede til anvendelse i virksomheder. Hvis der allerede eksisterer værktøjer med MIT, Apache 2 eller en tilsvarende open source license, så vil vi anvende og støtte dette værktøj. Hvis sådan et værktøj ikke findes, så bygger vi det og udgiver det som open source. Supabase er ikke en en til en mapning af Firebase. Vores mål er at give udviklere en Firebase-lignende udvikleroplevelse ved hjælp af open source værktøjer. +Supabase er en kombination af open source værktøjer. Vi bygger Firebase fuktioner med open source produkter der er egnede til anvendelse i virksomheder. Hvis der allerede eksisterer værktøjer med MIT, Apache 2 eller en tilsvarende open source license, så vil vi anvende og støtte dette værktøj. Hvis sådan et værktøj ikke findes, så bygger vi det og udgiver det som open source. Supabase er ikke en en til en mapning af Firebase. Vores mål er at give udviklere en Firebase-lignende udvikleroplevelse ved hjælp af open source værktøjer. **Nuværende arkitektur** @@ -66,17 +66,18 @@ Vores klientbibliotek er opbygget modulært. Hvert underbibliotek er en selvstæ - `realtime-{lang}`: Klientbibliotek til at arbejde med [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Klientbibliotek til at arbejde med [GoTrue](https://github.com/netlify/gotrue) -| Repo | Officielt | Fællesskab | -| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) -| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) -| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | -| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | +| Repo | Officielt | Fællesskab | +| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) | +| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) | +| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | +| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | ## Oversættelser + - [Liste med oversættelser](/i18n/languages.md) --- diff --git a/i18n/README.es.md b/i18n/README.es.md index 530bc6cc95a..f0f3ad87ce2 100644 --- a/i18n/README.es.md +++ b/i18n/README.es.md @@ -9,7 +9,7 @@ [Supabase](https://supabase.io) es una alternativa de código abierto a Firebase. Estamos construyendo las funcionalidades de Firebase usando herramientas de código abierto de nivel empresarial. - [x] Alojamiento de base de datos Postgres -- [x] Suscripciones en tiempo real +- [x] Suscripciones en tiempo real - [x] Autenticación y autorización - [x] API autogenerada - [x] Panel de control @@ -66,7 +66,7 @@ Nuestra librería de cliente es modular. Cada sub-librería es una implementaci - `realtime-{lang}`: Librería de cliente para trabajar con [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Librería de cliente para trabajar con [GoTrue](https://github.com/netlify/gotrue) -| Repo | Oficial | Comunidad | +| Repo | Oficial | Comunidad | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -75,6 +75,7 @@ Nuestra librería de cliente es modular. Cada sub-librería es una implementaci + ## Traducciones - [Lista de traducciones](/i18n/languages.md) diff --git a/i18n/README.fa.md b/i18n/README.fa.md index 557fee49313..5de9bd1d6d6 100644 --- a/i18n/README.fa.md +++ b/i18n/README.fa.md @@ -31,7 +31,7 @@ - [x] ‫آلفا: در حال تست Supabase با گروه محدود از کاربران هستیم. - [x] ‫آلفای عمومی: همه می‌تواند برای استفاده از طریق [app.supabase.io](https://app.supabase.io) ثبت‌نام کنند. اما سخت نگیرید، ممکن است مشکلات معدودی وجود داشته باشد. - [x] بتای عمومی: قابل اتکا برای اکثر استفاده‌های غیر-تجاری می‌باشد. -- [ ] عمومی: آماده برای استفاده تجاری. +- [ ] عمومی: آماده برای استفاده تجاری. در حال حاظر در مرحله بتای عمومی هستیم‫. "releases" این مخزن را دنبال کنید تا در جریان به‌روزسانی‌ها قرار بگیرید. @@ -41,8 +41,7 @@ ## چطور کار میکند - -‫Supabase ترکیبی از ابزارهای اپن‌سورس است. ما امکانات Firebase را با استفاده از محصولات اپن‌سورس و کلاس تجاری می‌سازیم. اگر ابزار و جامعه‌ی آن وجود داشته باشد، با استفاده از گواهینامه MIT, Apache 2 یا هر گواهینامه‌ی معادلی، ما از آن ابزار استفاده و پشتیبانی می‌کنیم. اگر ابزاری وجود نداشته باشد، ما خودمان آن را می‌سازیم و اپن‌سورس می‌کنیم. Supabase یک محصول دقیقا شبیه و معادل یک‌به‌یک Firebase نیست. ما سعی داریم با استفاده از ابزارهای اپن‌سورس تجربه شبیه به Firebase به توسعه‌دهندگان ارائه دهیم. +‫Supabase ترکیبی از ابزارهای اپن‌سورس است. ما امکانات Firebase را با استفاده از محصولات اپن‌سورس و کلاس تجاری می‌سازیم. اگر ابزار و جامعه‌ی آن وجود داشته باشد، با استفاده از گواهینامه MIT, Apache 2 یا هر گواهینامه‌ی معادلی، ما از آن ابزار استفاده و پشتیبانی می‌کنیم. اگر ابزاری وجود نداشته باشد، ما خودمان آن را می‌سازیم و اپن‌سورس می‌کنیم. Supabase یک محصول دقیقا شبیه و معادل یک‌به‌یک Firebase نیست. ما سعی داریم با استفاده از ابزارهای اپن‌سورس تجربه شبیه به Firebase به توسعه‌دهندگان ارائه دهیم. **معماری فعلی** @@ -59,25 +58,23 @@ - ‫[Kong](https://github.com/Kong/kong) یک gateway ابری-بومی می‌باشد. #### کتابخانه‌های کلاینت -کتابخانه‌ی کلاینت ما چند-تیکه است. هر زیر-کتابخانه یک پیاده‌سازی جداگانه برای یک سیستم خارجی واحد دارد. این یکی از روش‌های ما برای پشتیانی از ابزارهای موجود است. +کتابخانه‌ی کلاینت ما چند-تیکه است. هر زیر-کتابخانه یک پیاده‌سازی جداگانه برای یک سیستم خارجی واحد دارد. این یکی از روش‌های ما برای پشتیانی از ابزارهای موجود است. - **‫`supabase-{lang}`**: کتابخانه‌ها را ترکیب می‌کند و تکمیل‌تر خواهد بود. - ‫`postgrest-{lang}`: کتابخانه کلاینت برای کارکردن با [PostgREST](https://github.com/postgrest/postgrest) - ‫`realtime-{lang}`: کتابخانه کلاینت برای کارکردن با [Realtime](https://github.com/supabase/realtime) - ‫`gotrue-{lang}`: کتابخانه کلاینت برای کارکردن با [GoTrue](https://github.com/netlify/gotrue) -| مخزن | رسمی | جامعه | +| مخزن | رسمی | جامعه | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | | `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` | | `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` | - ## ترجمه‌ها - - [لیست ترجمه‌ها](/i18n/languages.md) --- diff --git a/i18n/README.fr.md b/i18n/README.fr.md index faef557261c..5fc17b27750 100644 --- a/i18n/README.fr.md +++ b/i18n/README.fr.md @@ -29,7 +29,7 @@ Pour une documentation complète, visitez [supabase.io/docs](https://supabase.io ## Statut - [x] Alpha : Nous testons Supabase avec un groupe fermé de clients. -- [X] Alpha publique : Tout le monde peut s'inscrire sur [app.supabase.io]((https://app.supabase.io)). Mais allez-y doucement, il y a quelques problèmes. +- [x] Alpha publique : Tout le monde peut s'inscrire sur [app.supabase.io](<(https://app.supabase.io)>). Mais allez-y doucement, il y a quelques problèmes. - [x] Bêta publique : Assez stable pour la plupart des cas d'utilisation hors entreprise - [ ] Public : Prêt pour la production @@ -66,7 +66,7 @@ Notre bibliothèque client est modulaire. Chaque sous-bibliothèque est une impl - `realtime-{lang}`: Bibliothèque client pour travailler avec [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Bibliothèque client pour travailler avec [GoTrue](https://github.com/netlify/gotrue) -| Repo | Officiel | Communauté | +| Repo | Officiel | Communauté | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -75,6 +75,7 @@ Notre bibliothèque client est modulaire. Chaque sous-bibliothèque est une impl + ## Traductions - [Liste des traductions](/i18n/languages.md) diff --git a/i18n/README.gr.md b/i18n/README.gr.md index a2dfbfd74b3..a3095e24a11 100644 --- a/i18n/README.gr.md +++ b/i18n/README.gr.md @@ -66,12 +66,12 @@ Our client library is modular. Each sub-library is a standalone implementation f - `realtime-{lang}`: Client library to work with [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Client library to work with [GoTrue](https://github.com/netlify/gotrue) -| Repo | Official | Community | -| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) -| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) -| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | -| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | +| Repo | Official | Community | +| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) | +| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) | +| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | +| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | @@ -84,4 +84,4 @@ Our client library is modular. Each sub-library is a standalone implementation f ## Χορηγοί -[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) \ No newline at end of file +[![New Sponsor](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) diff --git a/i18n/README.hi.md b/i18n/README.hi.md index 51395883429..d4a7c540637 100644 --- a/i18n/README.hi.md +++ b/i18n/README.hi.md @@ -18,7 +18,7 @@ ## प्रलेखन -पूर्ण प्रलेखन के लिए, [supabase.io/docs](https://supabase.io/docs) पर जाएँ +पूर्ण प्रलेखन के लिए, [supabase.io/docs](https://supabase.io/docs) पर जाएँ ## सामुदायिक तथा सहयोग @@ -66,7 +66,7 @@ - `realtime-{lang}`: ग्राहक पुस्तकालय के साथ काम करने के लिए [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: ग्राहक पुस्तकालय के साथ काम करने के लिए [GoTrue](https://github.com/netlify/gotrue) -| Repo | आधिकारिक | समुदाय | +| Repo | आधिकारिक | समुदाय | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -75,6 +75,7 @@ + ## अनुवाद - [अनुवाद की सूची](/i18n/languages.md) diff --git a/i18n/README.id.md b/i18n/README.id.md index d9cccf5ea09..013b172f126 100644 --- a/i18n/README.id.md +++ b/i18n/README.id.md @@ -41,7 +41,7 @@ Kami saat ini dalam Public Beta. Amati "releases" dari repositori ini untuk pemb ## Cara kerjanya -Supabase adalah kombinasi dari alat-alat sumber terbuka. Kami membangun fitur-fitur Firebase menggunakan produk-produk sumber terbuka tingkat perusahaan. Jika ada alat dan komunitas, dengan MIT, Apache 2, atau lisensi terbuka yang setara, kami akan menggunakan dan mendukung alat tersebut. Jika alat tersebut tidak ada, kami akan membuat dan membuka sumbernya sendiri. Supabase bukanlah salinan persis dari Firebase. Tujuan kami adalah memberi pengguna kemampuan untuk menggunakan produk yang mirip dengan Firebase, tetapi sepenuhnya bersumber terbuka. +Supabase adalah kombinasi dari alat-alat sumber terbuka. Kami membangun fitur-fitur Firebase menggunakan produk-produk sumber terbuka tingkat perusahaan. Jika ada alat dan komunitas, dengan MIT, Apache 2, atau lisensi terbuka yang setara, kami akan menggunakan dan mendukung alat tersebut. Jika alat tersebut tidak ada, kami akan membuat dan membuka sumbernya sendiri. Supabase bukanlah salinan persis dari Firebase. Tujuan kami adalah memberi pengguna kemampuan untuk menggunakan produk yang mirip dengan Firebase, tetapi sepenuhnya bersumber terbuka. **Arsitektur saat ini** @@ -66,12 +66,12 @@ Library klien kami bersifat modular. Setiap sub-library adalah sebuah implementa - `realtime-{lang}`: Library klien untuk bekerja dengan [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Library klien untuk bekerja dengan [GoTrue](https://github.com/netlify/gotrue) -| Repo | Resmi | Komunitas | -| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) -| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) -| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | -| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | +| Repo | Resmi | Komunitas | +| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) | +| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) | +| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | +| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | ## Terjemahan diff --git a/i18n/README.it.md b/i18n/README.it.md index 078a5ce2a02..3d333c41a6f 100644 --- a/i18n/README.it.md +++ b/i18n/README.it.md @@ -6,7 +6,7 @@ # Supabase -[Supabase](https://supabase.io) è una alternativa a Firebase con codice sorgente aperto. Stiamo sviluppando le funzionalità offerte da Firebase utilizzando strumenti con sorgente aperto a livello professionale. +[Supabase](https://supabase.io) è una alternativa a Firebase con codice sorgente aperto. Stiamo sviluppando le funzionalità offerte da Firebase utilizzando strumenti con sorgente aperto a livello professionale. - [x] Database Postgres ospitato - [x] Sottoscrizioni in tempo reale @@ -52,7 +52,7 @@ Supabase è una [piattaforma ospitata](https://app.supabase.io). Ci si può iscr - [PostgreSQL](https://www.postgresql.org/) è un sistema di database relazionali ad oggetti, con oltre 30 anni di sviluppo all'attivo che gli hanno permesso di ottenere una ottima reputazione in termini di affidabilità, robustezza delle funzionalità e prestazioni. - [Realtime](https://github.com/supabase/realtime) è un server Elixir che consente di ascoltare eventi PostreSQL quali inserimento, aggiornamenti e rimozioni utilizzando i websocket. Supabase rimane in ascolto della funzionalità incorporata di replicazione di Postgres, convertendo il flusso di byte replicato in JSON, dopodichè diffondendo il JSON attraverso i websocket. - [PostgREST](http://postgrest.org/) è un web server che trasforma il database PostreSQL direttamente in API di tipo RESTful. -- [Storage](https://github.com/supabase/storage-api) fornisce un'interfaccia RESTful per gestire i File archiviati in S3, utilizzando Postgres per la gestione dei permessi. +- [Storage](https://github.com/supabase/storage-api) fornisce un'interfaccia RESTful per gestire i File archiviati in S3, utilizzando Postgres per la gestione dei permessi. - [postgres-meta](https://github.com/supabase/postgres-meta) è una API RESTful per gestire Postgres, permettendo di recuperare tabelle, aggiungere ruoli, lanciare interrogazioni ecc. - [GoTrue](https://github.com/netlify/gotrue) è una API basata su SWT per la gestione delle utenze e per generare token SWT. - [Kong](https://github.com/Kong/kong) è una porta per le API nativa del cloud. @@ -66,14 +66,13 @@ La nostra libreria utente è modulare. Ogni sotto-libreria è una implementazion - `realtime-{lang}`: Libreria utente per lavorare con [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Libreria utente per lavorare con [GoTrue](https://github.com/netlify/gotrue) -| Repository | Ufficiale | Comunità | +| Repository | Ufficiale | Comunità | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | | `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` | | `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` | - - [Lista delle Traduzioni](/i18n/languages.md) --- diff --git a/i18n/README.jp.md b/i18n/README.jp.md index 3036aaa1e98..646dd50b9af 100644 --- a/i18n/README.jp.md +++ b/i18n/README.jp.md @@ -6,12 +6,12 @@ # Supabase -[Supabase](https://supabase.io)は、オープンソースのFirebase代替製品です。エンタープライズグレードのオープンソースツールを使って、Firebaseの機能を構築しています。 +[Supabase](https://supabase.io)は、オープンソースの Firebase 代替製品です。エンタープライズグレードのオープンソースツールを使って、Firebase の機能を構築しています。 -- [x] ホスティングされたPostgresデータベース +- [x] ホスティングされた Postgres データベース - [x] リアルタイムサブスクリプション - [x] 認証・認可 -- [x] APIを自動生成 +- [x] API を自動生成 - [x] ダッシュボード - [x] ストレージ - [ ] 関数 (近日公開) @@ -23,51 +23,51 @@ ## コミュニティとサポート - [コミュニティフォーラム](https://github.com/supabase/supabase/discussions) どんな時に使うか:構築の手助け、データベースのベストプラクティスに関する議論など -- [GitHub Issue](https://github.com/supabase/supabase/issues) どんな時に使うか: Supabaseで起こったバグやエラーについて -- [Emailサポート](https://supabase.io/docs/support#business-support) どんな時に使うか: ユーザー自身のデータベースやインフラに何か問題が発生した場合 +- [GitHub Issue](https://github.com/supabase/supabase/issues) どんな時に使うか: Supabase で起こったバグやエラーについて +- [Email サポート](https://supabase.io/docs/support#business-support) どんな時に使うか: ユーザー自身のデータベースやインフラに何か問題が発生した場合 ## ステータス -- [x] Alpha: 限られたユーザーでSupabaseをテストしています。 +- [x] Alpha: 限られたユーザーで Supabase をテストしています。 - [x] Public Alpha: 誰でも[app.supabase.io](https://app.supabase.io)から登録ができます。ただし、バグなどがある可能性がありますので、ご容赦ください。 - [x] Public Beta: 企業以外のほとんどのユースケースに耐えうる十分な安定性を確保。 - [ ] Public: 実用的な用途に対応 -現在、Public Betaを実施しています。このリポジトリの"release"にてメジャーアップデートに関する情報を発信しています。 +現在、Public Beta を実施しています。このリポジトリの"release"にてメジャーアップデートに関する情報を発信しています。 Watch this repo --- -## Supabaseの仕組み +## Supabase の仕組み -Supabaseは、オープンソースのツールを組み合わせてできています。私たちはFirebaseの機能を、エンタープライズグレードのオープンソース製品を使って構築しています。ツールやコミュニティが存在し、MIT、Apache 2、または同等のオープンライセンスであれば、私たちはそのツールを使用し、サポートします。ツールが存在しない場合は、自分たちで構築してオープンソース化します。SupabaseはFirebaseを1対1でマッピングしたものではありません。Supabaseの目的は、オープンソースのツールを使って、Firebaseのような開発体験を提供することです。 +Supabase は、オープンソースのツールを組み合わせてできています。私たちは Firebase の機能を、エンタープライズグレードのオープンソース製品を使って構築しています。ツールやコミュニティが存在し、MIT、Apache 2、または同等のオープンライセンスであれば、私たちはそのツールを使用し、サポートします。ツールが存在しない場合は、自分たちで構築してオープンソース化します。Supabase は Firebase を 1 対 1 でマッピングしたものではありません。Supabase の目的は、オープンソースのツールを使って、Firebase のような開発体験を提供することです。 **現在のアーキテクチャ** -Supabaseは[ホスティングされたプラットフォーム](https://app.supabase.io)です。登録するだけで、何もインストールせずに使い始めることができます。 +Supabase は[ホスティングされたプラットフォーム](https://app.supabase.io)です。登録するだけで、何もインストールせずに使い始めることができます。 更に現在ローカルでの開発環境を整えており、これはプラットフォームの安定性と並んで今最優先で進めているプロジェクトになります。 ![アーキテクチャー](https://supabase.io/assets/images/supabase-architecture-9050a7317e9ec7efb7807f5194122e48.png) -- [PostgreSQL](https://www.postgresql.org/)は、30年以上にわたって開発・改善されてきたオブジェクトリレーショナルデータベースシステムで、信頼性、機能の堅牢性、パフォーマンスの面で高い評価を得ています。 -- [Realtime](https://github.com/supabase/realtime)は、PostgreSQLのinsert、update、deleteの情報をWebSocketで受信できるElixirサーバです。SupabaseはPostgresに組み込まれたレプリケーション機能をリッスンし、レプリケーションのバイトストリームをJSONに変換し、そのJSONをWebSocketでブロードキャストします。 -- [PostgREST](http://postgrest.org/)は、PostgreSQLデータベースをRESTful APIに直接変換するウェブサーバです。 -- [Storage](https://github.com/supabase/storage-api)は、S3に保存されたファイルを管理するためのRESTfulなインターフェイスで、パーミッションの管理にはPostgresを使用しています。 -- [postgres-meta](https://github.com/supabase/postgres-meta) は、Postgresを管理するためのRESTful APIで、テーブルの取得、ロールの追加、クエリの実行などを行うことができます。 -- [GoTrue](https://github.com/netlify/gotrue) は、ユーザー管理とSWTトークン発行のためのSWTベースのAPIです。 -- [Kong](https://github.com/Kong/kong) は、クラウドネイティブなAPIゲートウェイです。 +- [PostgreSQL](https://www.postgresql.org/)は、30 年以上にわたって開発・改善されてきたオブジェクトリレーショナルデータベースシステムで、信頼性、機能の堅牢性、パフォーマンスの面で高い評価を得ています。 +- [Realtime](https://github.com/supabase/realtime)は、PostgreSQL の insert、update、delete の情報を WebSocket で受信できる Elixir サーバです。Supabase は Postgres に組み込まれたレプリケーション機能をリッスンし、レプリケーションのバイトストリームを JSON に変換し、その JSON を WebSocket でブロードキャストします。 +- [PostgREST](http://postgrest.org/)は、PostgreSQL データベースを RESTful API に直接変換するウェブサーバです。 +- [Storage](https://github.com/supabase/storage-api)は、S3 に保存されたファイルを管理するための RESTful なインターフェイスで、パーミッションの管理には Postgres を使用しています。 +- [postgres-meta](https://github.com/supabase/postgres-meta) は、Postgres を管理するための RESTful API で、テーブルの取得、ロールの追加、クエリの実行などを行うことができます。 +- [GoTrue](https://github.com/netlify/gotrue) は、ユーザー管理と SWT トークン発行のための SWT ベースの API です。 +- [Kong](https://github.com/Kong/kong) は、クラウドネイティブな API ゲートウェイです。 #### クライアント・ライブラリ -Supabaseクライアントライブラリはモジュール化されています。それぞれのサブライブラリが、一つの外部システムのための独立した実装となっています。こうすることで、既存のツールをサポートしています。 +Supabase クライアントライブラリはモジュール化されています。それぞれのサブライブラリが、一つの外部システムのための独立した実装となっています。こうすることで、既存のツールをサポートしています。 - **`supabase-{lang}`**: 下記全てのライブラリを内包したクライアントライブラリ - `postgrest-{lang}`: [PostgREST](https://github.com/postgrest/postgrest)用のクライアントライブラリ - `realtime-{lang}`: [Realtime](https://github.com/supabase/realtime)用のクライアントライブラリ - `gotrue-{lang}`: [GoTrue](https://github.com/netlify/gotrue)用のクライアントライブラリ -| レポジトリ | 公式 | コミュニティ | +| レポジトリ | 公式 | コミュニティ | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -76,6 +76,7 @@ Supabaseクライアントライブラリはモジュール化されています + ## 翻訳 - [翻訳](/i18n/languages.md) diff --git a/i18n/README.ko.md b/i18n/README.ko.md index 78a696b40e6..40fd65aad89 100644 --- a/i18n/README.ko.md +++ b/i18n/README.ko.md @@ -67,7 +67,7 @@ Supabase 클라이언트 라이브러리는 모듈식 입니다. 각 하위 라 - `realtime-{lang}`: [Realtime](https://github.com/supabase/realtime)용 클라이언트 라이브러리 - `gotrue-{lang}`: [GoTrue](https://github.com/netlify/gotrue)용 클라이언트 라이브러리 -| 저장소 | 공식 | 커뮤니티 | +| 저장소 | 공식 | 커뮤니티 | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -76,6 +76,7 @@ Supabase 클라이언트 라이브러리는 모듈식 입니다. 각 하위 라 + ## 번역 - [번역](/i18n/languages.md) diff --git a/i18n/README.pt-br.md b/i18n/README.pt-br.md index 6116eeaf48a..1592b6df8c7 100644 --- a/i18n/README.pt-br.md +++ b/i18n/README.pt-br.md @@ -66,15 +66,16 @@ Nossa biblioteca de cliente é modular. Cada sub-biblioteca é uma implementaç - `realtime-{lang}`: Biblioteca de cliente para trabalhar com [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Biblioteca de cliente para trabalhar com [GoTrue](https://github.com/netlify/gotrue) -| Repo | Oficial | Comunidade | -| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) -| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) -| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | -| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | +| Repo | Oficial | Comunidade | +| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) | +| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) | +| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | +| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | + ## Traduções - [Traduções](/i18n/languages.md) diff --git a/i18n/README.pt.md b/i18n/README.pt.md index 077f7b11d74..6aa92b5ebb3 100644 --- a/i18n/README.pt.md +++ b/i18n/README.pt.md @@ -8,7 +8,6 @@ [Supabase](https://supabase.io) é uma alternativa de código aberto ao Firebase. Estamos reproduzindo as funcionalidades do Firebase usando ferramentas de código aberto de nível empresarial. - - [x] Base de dados Postgres hospedada - [x] Subscrições em tempo real - [x] Autenticação e autorização @@ -27,7 +26,6 @@ Para ver a documentação completa, visite [supabase.io/docs](https://supabase.i - [Problemas do GitHub](https://github.com/supabase/supabase/issues). Indicado para: bugs e erros que tu encontrares ao usar o Supabase. - [Suporte por e-mail](https://supabase.io/docs/support#business-support). Indicado para: problemas com a tua base de dados ou infraestrutura. - ## Status - [x] Alpha: estamos a testar o Supabase com um grupo fechado de clientes @@ -64,9 +62,9 @@ Supabase é uma [plataforma hospedada](https://app.supabase.io). Podes-te inscre Nossa biblioteca cliente é modular. Cada sub-biblioteca é uma implementação independente para um único sistema externo. Esta é uma das maneiras pelas quais oferecemos suporte às ferramentas existentes. - **`supabase-{lang}`**: Combina bibliotecas e adiciona funcionalidades. - - `postgrest-{lang}`: Biblioteca cliente para trabalhar com [PostgREST](https://github.com/postgrest/postgrest) - - `realtime-{lang}`: Biblioteca cliente para trabalhar com [Realtime](https://github.com/supabase/realtime) - - `gotrue-{lang}`: Biblioteca cliente para trabalhar com [GoTrue](https://github.com/netlify/gotrue) + - `postgrest-{lang}`: Biblioteca cliente para trabalhar com [PostgREST](https://github.com/postgrest/postgrest) + - `realtime-{lang}`: Biblioteca cliente para trabalhar com [Realtime](https://github.com/supabase/realtime) + - `gotrue-{lang}`: Biblioteca cliente para trabalhar com [GoTrue](https://github.com/netlify/gotrue) | Repositório | Oficial | Comunidade | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -77,6 +75,7 @@ Nossa biblioteca cliente é modular. Cada sub-biblioteca é uma implementação + ## Traduções - [Traduções](/i18n/languages.md) diff --git a/i18n/README.ru.md b/i18n/README.ru.md index 6497cbf4d63..6500309fc8a 100644 --- a/i18n/README.ru.md +++ b/i18n/README.ru.md @@ -75,6 +75,7 @@ Supabase – это [облачная платформа](https://app.supabase.i + ## Переводы - [Переводы](/i18n/languages.md) diff --git a/i18n/README.sv.md b/i18n/README.sv.md index a68bdb85ee9..57dded16d76 100644 --- a/i18n/README.sv.md +++ b/i18n/README.sv.md @@ -49,8 +49,6 @@ Supabase är en [hostad plattform](https://app.supabase.io). Du kan registrera d ![Arkitektur](https://supabase.io/assets/images/supabase-architecture-9050a7317e9ec7efb7807f5194122e48.png) - - - [PostgreSQL](https://www.postgresql.org/) är en objektrelationsdatabas med över 30 års aktiv utveckling , vilket har gett den ett gott rykte som pålitlig, robust och högpresterande. - [Realtime](https://github.com/supabase/realtime) är en Elexir-server som låter dig lyssna på skapande, uppdateringar och borttagningar i PostgreSQL med hjälp av websockets. Supabase lyssnar på PostgreSQL´s inbyggda replikeringsfunktionalitet, konverterar replikerings-byte-strömmen till JSON och sänder sedan JSON via websockets. - [PostgREST](http://postgrest.org/) är en webbserver som omvandlar din PostgreSQL-databas direkt till ett REST-API. @@ -68,21 +66,22 @@ Vårt klientbibliotek är modulärt. Varje underbibliotek är en fristående imp - `realtime-{lang}`: Klientbibliotek för att arbeta med [Realtime](https://github.com/supabase/realtime) - `gotrue-{lang}`: Klientbibliotek för att arbeta med [GoTrue](https://github.com/netlify/gotrue) -| Repo | Officiellt | Community | -| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) -| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) -| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | -| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | +| Repo | Officiellt | Community | +| --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` \| [`Ruby`](https://github.com/supabase/supabase-rb) | +| `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) \| [`Ruby`](https://github.com/supabase/postgrest-rb) | +| `realtime-{lang}` | [`JS`](https://github.com/supabase/realtime-js) | [`C#`](https://github.com/supabase/realtime-csharp) \| [`Dart`](https://github.com/supabase/realtime-dart) \| [`Python`](https://github.com/supabase/realtime-py) \| `Rust` \| `Ruby` | +| `gotrue-{lang}` | [`JS`](https://github.com/supabase/gotrue-js) | [`C#`](https://github.com/supabase/gotrue-csharp) \| [`Dart`](https://github.com/supabase/gotrue-dart) \| [`Python`](https://github.com/supabase/gotrue-py) \| `Rust` \| `Ruby` | ## Översättningar + - [Lista med översättningar](/i18n/languages.md) --- ## Sponsorer -[![Nya sponsorer](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) \ No newline at end of file +[![Nya sponsorer](https://user-images.githubusercontent.com/10214025/90518111-e74bbb00-e198-11ea-8f88-c9e3c1aa4b5b.png)](https://github.com/sponsors/supabase) diff --git a/i18n/README.tr.md b/i18n/README.tr.md index 1ab46b973be..70c6f5befd9 100644 --- a/i18n/README.tr.md +++ b/i18n/README.tr.md @@ -25,7 +25,7 @@ Tam dokümantasyon için, ziyaret et [supabase.io/docs](https://supabase.io/docs - [Topluluk Forumu](https://github.com/supabase/supabase/discussions). Şunun için en iyisi: yapı ile ilgili yardım, veritabanı için en iyi pratikleri tartışmak. - [GitHub Issues](https://github.com/supabase/supabase/issues). Şunun için en iyisi: Supabase kullanırken karşılaştığınız problem ve hatalar. - [Email Desteği](https://supabase.io/docs/support#business-support). Şunun için en iyisi: -veritabanınız veya altyapınızla ilgili sorunlar. + veritabanınız veya altyapınızla ilgili sorunlar. ## Durum @@ -50,13 +50,13 @@ Supabase [barındırılan bir platformdur](https://app.supabase.io). Hiçbir şe ![Architecture](https://supabase.io/assets/images/supabase-architecture-9050a7317e9ec7efb7807f5194122e48.png) -- [PostgreSQL](https://www.postgresql.org/) güvenilirlik, özellik sağlamlığı ve performans açısından güçlü bir üne kavuşan 30 yılı aşkın aktif geliştirmeye sahip bir nesne ilişkisel veritabanı sistemidir. +- [PostgreSQL](https://www.postgresql.org/) güvenilirlik, özellik sağlamlığı ve performans açısından güçlü bir üne kavuşan 30 yılı aşkın aktif geliştirmeye sahip bir nesne ilişkisel veritabanı sistemidir. - [Realtime](https://github.com/supabase/realtime) Web soketleri kullanarak PostgreSQL eklerini, güncellemelerini ve silmelerini dinlemenizi sağlayan bir Elixir sunucusudur. Supabase, Postgres'in yerleşik çoğaltma işlevini dinler, çoğaltma bayt akışını JSON'a dönüştürür ve ardından JSON'yi web yuvaları üzerinden yayınlar. -- [PostgREST](http://postgrest.org/) PostgreSQL veritabanınızı doğrudan bir RESTful API'ye dönüştüren bir web sunucusudur. +- [PostgREST](http://postgrest.org/) PostgreSQL veritabanınızı doğrudan bir RESTful API'ye dönüştüren bir web sunucusudur. - [Storage](https://github.com/supabase/storage-api) , izinleri yönetmek için Postgres kullanarak S3'te depolanan Dosyaları yönetmek için RESTful bir arayüz sağlar. - [postgres-meta](https://github.com/supabase/postgres-meta) Postgres'inizi yönetmeye yarayan RESTful bir API'dir ve tabloları getirmenize, roller eklemenize ve sorgu çalıştırmanıza vb. izin verir. -- [GoTrue](https://github.com/netlify/gotrue) kullanıcıları yönetmek ve SWT belirteçleri vermek için SWT tabanlı bir API'dir. -- [Kong](https://github.com/Kong/kong) bulutta yerel bir API ağ geçididir. +- [GoTrue](https://github.com/netlify/gotrue) kullanıcıları yönetmek ve SWT belirteçleri vermek için SWT tabanlı bir API'dir. +- [Kong](https://github.com/Kong/kong) bulutta yerel bir API ağ geçididir. #### İstemci kitaplıkları @@ -67,7 +67,7 @@ Müşteri kitaplığımız modülerdir. Her bir alt kütüphane, tek bir harici - `realtime-{lang}`: [Realtime](https://github.com/supabase/realtime) ile çalışmak için istemci kitaplığı - `gotrue-{lang}`: [GoTrue](https://github.com/netlify/gotrue) ile çalışmak için istemci kitaplığı -| Depo | Resmi | Topluluk | +| Depo | Resmi | Topluluk | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -76,6 +76,7 @@ Müşteri kitaplığımız modülerdir. Her bir alt kütüphane, tek bir harici + ## Çeviriler - [Çeviriler](/i18n/languages.md) diff --git a/i18n/README.uk.md b/i18n/README.uk.md index a5ad12ba89c..1f2a5da68f9 100644 --- a/i18n/README.uk.md +++ b/i18n/README.uk.md @@ -62,9 +62,9 @@ Supabase – це [хмарна платформа](https://app.supabase.io). В Наша клієнтська бібліотека модульна. Кожна підбібліотека є окремою реалізацією для однієї зовнішньої системи. Це один зі способів, за допомогою якого ми підтримуємо наявні інструменти. - **`supabase-{lang}`**: Об'єднує бібліотеки та збільшує функціонал. - - `postgrest-{lang}`: Клієнтська бібліотека для роботи з [PostgREST](https://github.com/postgrest/postgrest) - - `realtime-{lang}`: Клієнтська бібліотека для роботи з [Realtime](https://github.com/supabase/realtime) - - `gotrue-{lang}`: Клієнтська бібліотека для роботи з [GoTrue](https://github.com/netlify/gotrue) + - `postgrest-{lang}`: Клієнтська бібліотека для роботи з [PostgREST](https://github.com/postgrest/postgrest) + - `realtime-{lang}`: Клієнтська бібліотека для роботи з [Realtime](https://github.com/supabase/realtime) + - `gotrue-{lang}`: Клієнтська бібліотека для роботи з [GoTrue](https://github.com/netlify/gotrue) | Repo | Офіційні | Спільноти | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | @@ -75,6 +75,7 @@ Supabase – це [хмарна платформа](https://app.supabase.io). В + ## Переклади - [Переклади](/i18n/languages.md) diff --git a/i18n/README.zh-cn.md b/i18n/README.zh-cn.md index 06ce987b394..c49a4b022bc 100644 --- a/i18n/README.zh-cn.md +++ b/i18n/README.zh-cn.md @@ -66,7 +66,7 @@ Supabase 是一个[托管平台](https://app.supabase.io)。你可以注册并 - `realtime-{lang}`:与 [Realtime](https://github.com/supabase/realtime) 交互的客户端库 - `gotrue-{lang}`:与 [GoTrue](https://github.com/netlify/gotrue) 交互的客户端库 -| 代码存储库 | 官方 | 社区 | +| 代码存储库 | 官方 | 社区 | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | diff --git a/i18n/README.zh-tw.md b/i18n/README.zh-tw.md index 78f531082dc..53205443bee 100644 --- a/i18n/README.zh-tw.md +++ b/i18n/README.zh-tw.md @@ -62,11 +62,11 @@ Supabase 是[託管平台](https://app.supabase.io)。只要註冊,不必安 客戶端 Library 是模組化的。每個子 Library 都是單一外部系統的獨立實作。這是支援既有工具的方法之一。 - **`supabase-{lang}`**: Combines libraries and adds enrichments. - - `postgrest-{lang}`: 銜接 [PostgREST](https://github.com/postgrest/postgrest) 的客戶端 Library - - `realtime-{lang}`: 銜接 [Realtime](https://github.com/supabase/realtime) 的客戶端 Library - - `gotrue-{lang}`: 銜接 [GoTrue](https://github.com/netlify/gotrue) 的客戶端 Library + - `postgrest-{lang}`: 銜接 [PostgREST](https://github.com/postgrest/postgrest) 的客戶端 Library + - `realtime-{lang}`: 銜接 [Realtime](https://github.com/supabase/realtime) 的客戶端 Library + - `gotrue-{lang}`: 銜接 [GoTrue](https://github.com/netlify/gotrue) 的客戶端 Library -| Repo | 官方 | 社群 | +| Repo | 官方 | 社群 | | --------------------- | ------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **`supabase-{lang}`** | [`JS`](https://github.com/supabase/supabase-js) | [`C#`](https://github.com/supabase/supabase-csharp) \| [`Dart`](https://github.com/supabase/supabase-dart) \| [`Python`](https://github.com/supabase/supabase-py) \| `Rust` | | `postgrest-{lang}` | [`JS`](https://github.com/supabase/postgrest-js) | [`C#`](https://github.com/supabase/postgrest-csharp) \| [`Dart`](https://github.com/supabase/postgrest-dart) \| [`Python`](https://github.com/supabase/postgrest-py) \| [`Rust`](https://github.com/supabase/postgrest-rs) | @@ -75,6 +75,7 @@ Supabase 是[託管平台](https://app.supabase.io)。只要註冊,不必安 + ## 翻譯 - [翻譯](/i18n/languages.md) diff --git a/vercel.json b/vercel.json index ba927d7a0f4..2b8141dbdc3 100644 --- a/vercel.json +++ b/vercel.json @@ -39,7 +39,10 @@ { "source": "/database", "destination": "https://www-internal.supabase.io/new/database" }, { "source": "/auth", "destination": "https://www-internal.supabase.io/new/auth" }, { "source": "/storage", "destination": "https://www-internal.supabase.io/new/storage" }, - { "source": "/brand-assets", "destination": "https://www-internal.supabase.io/new/brand-assets" }, + { + "source": "/brand-assets", + "destination": "https://www-internal.supabase.io/new/brand-assets" + }, { "source": "/:match*", "destination": "https://docs-rose.vercel.app/:match*" } ], "redirects": [ diff --git a/web/ReferenceGenerator.ts b/web/ReferenceGenerator.ts index d52bdd38270..e6c68721d60 100644 --- a/web/ReferenceGenerator.ts +++ b/web/ReferenceGenerator.ts @@ -225,7 +225,7 @@ function extractParamTypeAsString(paramDefinition) { function extractTsDocNode(nodeToFind: string, definition: any) { const nodePath = nodeToFind.split('.') let i = 0 - let previousNode = definition + let previousNode = definition let currentNode = definition while (i < nodePath.length) { previousNode = currentNode diff --git a/web/blog/2020-06-15-supabase-steve-chavez.md b/web/blog/2020-06-15-supabase-steve-chavez.md index 5884778d7c3..6f362d6116f 100644 --- a/web/blog/2020-06-15-supabase-steve-chavez.md +++ b/web/blog/2020-06-15-supabase-steve-chavez.md @@ -1,21 +1,20 @@ --- title: Steve Chavez has joined Supabase -description: Steve joins Supabase to help build Auth. +description: Steve joins Supabase to help build Auth. author: Paul Copplestone author_title: Supabase author_url: https://github.com/kiwicopple author_image_url: https://avatars2.githubusercontent.com/u/10214025?s=400&u=c6775be2ae667e2acae3ccd347fed62bb3f5b3e7&v=4 authorURL: https://github.com/kiwicopple -tags: - - supabase - - hiring +tags: + - supabase + - hiring --- -This month we welcome [Steve Chavez](https://github.com/steve-chavez) to the team. Steve is a maintainer of PostgREST, one of the core tools which makes Supabase possible. +This month we welcome [Steve Chavez](https://github.com/steve-chavez) to the team. Steve is a maintainer of PostgREST, one of the core tools which makes Supabase possible. -Steve and I have been in contact since he [added one of my old blog posts](https://github.com/PostgREST/postgrest-docs/commit/3dde972d31519d3afc319015bce1dc0f73adeb8e#commitcomment-35312841) to the PostgREST docs. He has a rich history in open source and we're excited to have him in our team. +Steve and I have been in contact since he [added one of my old blog posts](https://github.com/PostgREST/postgrest-docs/commit/3dde972d31519d3afc319015bce1dc0f73adeb8e#commitcomment-35312841) to the PostgREST docs. He has a rich history in open source and we're excited to have him in our team. Steve is helping us build one of our most demanded features - our Auth system. We will support him to build some exciting features which he has planned for PostgREST, including enhanced PostGIS support. - diff --git a/web/blog/2020-07-01-supabase-alpha-june-2020.md b/web/blog/2020-07-01-supabase-alpha-june-2020.md index 468e6ba9870..0e6458f767a 100644 --- a/web/blog/2020-07-01-supabase-alpha-june-2020.md +++ b/web/blog/2020-07-01-supabase-alpha-june-2020.md @@ -54,7 +54,7 @@ We have a number of small improvements: ### Hiring -- This month we [welcome Steve Chavez to the team](/blog/2020/06/15/supabase-steve-chavez). Steve is a maintainer of PostgREST, one of the core tools which makes Supabase possible. +- This month we [welcome Steve Chavez to the team](/blog/2020/06/15/supabase-steve-chavez). Steve is a maintainer of PostgREST, one of the core tools which makes Supabase possible. - We're hiring a part-time designer or UX expert. See more [here](https://news.ycombinator.com/item?id=23708351). ### Get started @@ -63,7 +63,3 @@ We have a number of small improvements: - Make sure to [star us on GitHub](https://github.com/supabase/supabase) - Follow us [on Twitter](https://twitter.com/supabase_io) - Become a [sponsor](https://github.com/sponsors/supabase) - - - - \ No newline at end of file diff --git a/web/blog/2020-07-09-postgresql-templates.md b/web/blog/2020-07-09-postgresql-templates.md index 942acd481ab..de0d34cd62c 100644 --- a/web/blog/2020-07-09-postgresql-templates.md +++ b/web/blog/2020-07-09-postgresql-templates.md @@ -6,15 +6,16 @@ author_title: Supabase author_url: https://github.com/dragarcia author_image_url: https://avatars0.githubusercontent.com/u/26374889?s=400&u=f5e35e9b47a50fa2b4d8c4bb96babd921071bcf1&v=4 authorURL: https://github.com/dragarcia -tags: - - postgres +tags: + - postgres --- -Whenever you create a new database in Postgres, you are actually [basing it off an already present database](https://www.postgresql.org/docs/current/manage-ag-templatedbs.html) in your cluster. +Whenever you create a new database in Postgres, you are actually [basing it off an already present database](https://www.postgresql.org/docs/current/manage-ag-templatedbs.html) in your cluster. This database, `template1`, and another, called `template0`, are standard system databases that exist in every newly created database cluster. Don't believe me? Why not quickly [spin up a database](/docs/postgres/server/about) and see it for yourself with this query: + ```sql SELECT * FROM pg_database; ``` @@ -22,21 +23,25 @@ SELECT * FROM pg_database; In this post, we'll explore these template databases and see how we can make full use of their potential. We'll even look into creating a template database of our own. ## template1 + By default, running: + ```sql CREATE DATABASE new_db_name; ``` + simply copies everything from the database `template1`. We can modify this template database in any way: add a table, insert some data, create new extensions, or install procedural languages. Any of these actions would be propagated to subsequently created databases. This, however, is **not** advisable. Removing any one of these modifications would need you to manually uninstall or drop these changes from `template1`. You do have the option to drop and recreate the entire `template1` database altogether. This unfortunately comes at the risk of committing a mistake along the way, effectively breaking `CREATE DATABASE`. It would be better to leave `template1` alone and create a template database of your own. - ## Custom Template Databases To set an existing database as a template database: + ```sql ALTER DATABASE template_db_name WITH is_template TRUE; ``` + Doing this allows any user or role with the `CREATEDB` privilege to utilize it as a template. If not, only superusers or owners of the database would be allowed to do so. To create a new database with this template: @@ -56,18 +61,20 @@ CREATE DATABASE new_db_name TEMPLATE template_db_name; - To properly create a database from a custom template database, there should be no other connections present. `CREATE DATABASE` immediately fails if any connections exist at the start of the query. - As such, if you are looking to replicate a database while maintaining your connections (eg. a production database), it would be more ideal to use the Postgres utility [pg_dump](https://www.postgresql.org/docs/12/app-pgdump.html). - ## template0 `template0` contains the same data as `template1`. We could think of this template database as a fallback if anything irreversible happens to `template1`. As such, this template database should never be modified in any way as soon as the database cluster has been initialized. To create a database with `template0` as the template database: + ```sql CREATE DATABASE new_db_name TEMPLATE template0; ``` ### Applications + - If anything goes wrong with `template1`, It can be dropped and recreated with `template0` as the template database. - We can also create a clean database that does not contain any modifications present in `template1`. This would be useful when restoring from pg_dump. Any conflicts brought about by modifications not present in the dump are eliminated. - `template0` can be used to specify new encodings. As pointed out in this [article](https://hashrocket.com/blog/posts/exploring-the-default-postgres-template-databases#:~:text=we%20can't%20edit%20the%20locale%20or%20encoding%20of%20a%20database%20copied%20from%20template1), creating a new database with `template1` and new encodings would result in an error. + ```sql -- Will succeed CREATE DATABASE new_db_name TEMPLATE template0 ENCODING 'SQL_ASCII'; @@ -76,9 +83,6 @@ CREATE DATABASE new_db_name TEMPLATE template0 ENCODING 'SQL_ASCII'; CREATE DATABASE new_db_name ENCODING 'SQL_ASCII'; ``` - ## Conclusion To quickly sum things up, we found out that new databases are, by default, created from a template database called `template1`. `template1` can be modified in any way we please and the changes would be present in any database created afterward. We can also create custom template databases and base new databases from them instead. If things go awry, `template0` is always there to help. - - diff --git a/web/blog/2020-07-17-postgresql-physical-logical-backups.md b/web/blog/2020-07-17-postgresql-physical-logical-backups.md index 14efe420ecc..ae0a3f75556 100644 --- a/web/blog/2020-07-17-postgresql-physical-logical-backups.md +++ b/web/blog/2020-07-17-postgresql-physical-logical-backups.md @@ -6,11 +6,11 @@ author_title: Supabase author_url: https://github.com/dragarcia author_image_url: https://avatars0.githubusercontent.com/u/26374889?s=400&u=f5e35e9b47a50fa2b4d8c4bb96babd921071bcf1&v=4 authorURL: https://github.com/dragarcia -tags: - - postgres +tags: + - postgres --- -PostgreSQL backups can be categorized into two types: *logical* and *physical*. This post briefly covers each type and discusses the situations where you would use either one. +PostgreSQL backups can be categorized into two types: _logical_ and _physical_. This post briefly covers each type and discusses the situations where you would use either one. We'll cover some of the many tools you can use for Postgres backups in future posts. @@ -64,13 +64,12 @@ As your database grows to the size of a few gigabytes, backing it up through phy Postgres also generates [Write Ahead Log](https://www.postgresql.org/docs/current/wal-intro.html) (WAL) files, which can be used together with a backed-up file system to [recover a database up to any chosen point in time](https://www.postgresql.org/docs/current/continuous-archiving.html). When disaster strikes, this is one of the best options for recreating your database up to the point right before the unfortunate happens. This greatly minimizes [Recovery Point Objective (RPO)](https://www.ibm.com/services/business-continuity/rpo) along the way. Even better, tools such as [WAL-G](https://github.com/wal-g/wal-g) are readily available to simplify the steps involved in setting this up. - ## Conclusion All in all, logical and physical backups are generated differently from one another. Neither has an advantage over the other. Depending on your needs, each brings unique uses to the table: -| Logical | Physical | -|:--------|:---------| -| Simpler way of getting started with backups. | Better way of handling backups for larger database clusters. | -| Using it to migrate between different major versions of Postgres. | Using it for Point in Time Recovery. | -| Having the option to back up a single database. | | +| Logical | Physical | +| :---------------------------------------------------------------- | :----------------------------------------------------------- | +| Simpler way of getting started with backups. | Better way of handling backups for larger database clusters. | +| Using it to migrate between different major versions of Postgres. | Using it for Point in Time Recovery. | +| Having the option to back up a single database. | | diff --git a/web/blog/2020-08-02-continuous-postgresql-backup-walg.md b/web/blog/2020-08-02-continuous-postgresql-backup-walg.md index 71327e2377f..80fe278d27e 100644 --- a/web/blog/2020-08-02-continuous-postgresql-backup-walg.md +++ b/web/blog/2020-08-02-continuous-postgresql-backup-walg.md @@ -6,8 +6,8 @@ author_title: Supabase author_url: https://github.com/dragarcia author_image_url: https://avatars0.githubusercontent.com/u/26374889?s=400&u=f5e35e9b47a50fa2b4d8c4bb96babd921071bcf1&v=4 authorURL: https://github.com/dragarcia -tags: - - postgres +tags: + - postgres --- Have you ever wanted to restore your database's state to a particular moment in time? This post explains how, using WAL-G. @@ -33,7 +33,8 @@ A quick installation guide can be found [here](https://www.postgresql.org/downlo #### envdir [envdir](http://manpages.ubuntu.com/manpages/bionic/man8/envdir.8.html) allows us to run other programs with a modified environment based on the files in the provided directory. This can be installed through the [daemontools](https://cr.yp.to/daemontools.html) package: -```shell + +```shell $ sudo apt-get install -y daemontools ``` @@ -48,6 +49,7 @@ $ mv wal-g /usr/local/bin/ ### AWS credentials and resources When storing backups, WAL-G has numerous [cloud storage provider options](https://github.com/wal-g/wal-g#configuration) for us to choose from. For this tutorial, we will be using AWS. Have the following prepared: + - AWS Access & Secret keys. - An S3 bucket. @@ -56,6 +58,7 @@ When storing backups, WAL-G has numerous [cloud storage provider options](https: ### 1. Configure environment variables The directory `/etc/wal-g.d/env` is created and contains files that stores environment variables. It would later be used in WAL-G commands via envdir. + ```shell $ umask u=rwx,g=rx,o= $ mkdir -p /etc/wal-g.d/env @@ -68,7 +71,8 @@ $ chown -R root:postgres /etc/wal-g.d ### 2. Enable WAL archiving -Here, we enable [WAL archiving](https://www.postgresql.org/docs/12/continuous-archiving.html) and instruct Postgres to store the archives in the specified S3 bucket via WAL-G. +Here, we enable [WAL archiving](https://www.postgresql.org/docs/12/continuous-archiving.html) and instruct Postgres to store the archives in the specified S3 bucket via WAL-G. + ```shell $ echo "archive_mode = yes" >> /etc/postgresql/12/main/postgresql.conf $ echo "archive_command = 'envdir /etc/wal-g.d/env /usr/local/bin/wal-g wal-push %p'" >> /etc/postgresql/12/main/postgresql.conf @@ -78,6 +82,7 @@ $ echo "archive_timeout = 60" >> /etc/postgresql/12/main/postgresql.conf ### 3. Restart the database The database is restarted to let the changes in the configuration to take effect. + ```shell $ sudo /etc/init.d/postgresql restart ``` @@ -97,9 +102,11 @@ From then on, subsequent physical backups would be found in the directory `baseb ### 5. [Optional] Schedule regular physical backups A CRON job can then be set to schedule physical backups to be performed everyday: + ```shell $ echo "0 0 * * * postgres /usr/bin/envdir /etc/wal-g.d/env /usr/local/bin/wal-g backup-push /var/lib/postgresql/12/main" > /etc/cron.d/pg_backup ``` + Here, the instance has been instructed to back up the database at the start of each day at midnight. By physically backing up your instance regularly, overall recovery time could be faster. Restoring from a physical backup from yesterday would lead to fewer WAL archive files to be replayed as compared to restoring from one from a month ago. --- @@ -111,6 +118,7 @@ Something goes wrong with the database or instance. We will now use what availab ### 1. Configure environment variables The configuration should be the **same** as the original instance. For recovery and restoration, we would not need the variable `PGPASSWORD`. + ```shell $ umask u=rwx,g=rx,o= $ mkdir -p /etc/wal-g.d/env @@ -137,13 +145,15 @@ $ sudo -su postgres #### Set restore_command Through [restore_command](https://www.postgresql.org/docs/12/continuous-archiving.html#:~:text=must%20specify%20is%20the%20restore_command,%20which%20tells%20PostgreSQL%20how%20to%20retrieve%20archived%20WAL%20file%20segments), we instruct Postgres to pull all WAL archives from our S3 bucket to use during recovery. + ```shell $ echo "restore_command = '/usr/bin/envdir /etc/wal-g.d/env /usr/local/bin/wal-g wal-fetch \"%f\" \"%p\" >> /tmp/wal.log 2>&1'" >> /etc/postgresql/12/main/postgresql.conf ``` #### [Optional] Achieve Point in Time Recovery (PITR) -If we want to restore the database only up to a certain point in time (eg. right before the disaster), we can do so by setting both [recovery_target_time](https://www.postgresql.org/docs/12/runtime-config-wal.html#:~:text=recovery_target_time%20(timestamp)) and [recovery_target_action](https://www.postgresql.org/docs/12/runtime-config-wal.html#:~:text=recovery_target_action%20(enum)). Do note that the timezone would need to match that of the original instance. This is usually at the UTC (+00) timezone. +If we want to restore the database only up to a certain point in time (eg. right before the disaster), we can do so by setting both [recovery_target_time]() and [recovery_target_action](). Do note that the timezone would need to match that of the original instance. This is usually at the UTC (+00) timezone. + ```shell $ echo "recovery_target_time = '2020-07-27 01:23:00.000000+00'" >> /etc/postgresql/12/main/postgresql.conf $ echo "recovery_target_action = 'promote'" >> /etc/postgresql/12/main/postgresql.conf @@ -152,6 +162,7 @@ $ echo "recovery_target_action = 'promote'" >> /etc/postgresql/12/main/postgresq ### 5. Restore from physical backup The current data directory is deleted and is replaced with the latest version of the physical backup from the S3 bucket. + ```shell $ rm -rf /var/lib/postgresql/12/main $ envdir /etc/wal-g.d/env /usr/local/bin/wal-g backup-fetch /var/lib/postgresql/12/main LATEST @@ -159,7 +170,8 @@ $ envdir /etc/wal-g.d/env /usr/local/bin/wal-g backup-fetch /var/lib/postgresql/ ### 6. Create a `recovery.signal` file -This file [instructs](https://www.postgresql.org/docs/12/continuous-archiving.html#:~:text=Set%20recovery%20configuration%20settings%20in%20postgresql.conf%20(see%20Section%2019.5.4)%20and%20create%20a%20file%20recovery.signal%20in%20the%20cluster%20data%20directory) Postgres that the database should undergo recovery mode upon start. +This file [instructs]() Postgres that the database should undergo recovery mode upon start. + ```shell $ touch /var/lib/postgresql/12/main/recovery.signal ``` diff --git a/web/blog/2020-08-02-supabase-alpha-july-2020.md b/web/blog/2020-08-02-supabase-alpha-july-2020.md index 5351f05587f..688e71d0370 100644 --- a/web/blog/2020-08-02-supabase-alpha-july-2020.md +++ b/web/blog/2020-08-02-supabase-alpha-july-2020.md @@ -10,7 +10,7 @@ tags: - release-notes --- -After 5 months of building, we're releasing one of our most anticipated features: Supabase Auth. +After 5 months of building, we're releasing one of our most anticipated features: Supabase Auth. @@ -32,13 +32,12 @@ We've made some massive improvements to our Table Editor that we're excited to s #### Relationship drill down -Last month we made it easy to drill into your table relationships. This month, we make it possible to drill multiple levels deep. +Last month we made it easy to drill into your table relationships. This month, we make it possible to drill multiple levels deep. - #### Add, delete, and download rows We're making it easier to manipulate your data. Next month, you'll be able to add and remove columns directly from the Table view. @@ -71,4 +70,4 @@ We have a number of small improvements: - Start using Supabase today: [app.supabase.io](https://app.supabase.io) - Make sure to [star us on GitHub](https://github.com/supabase/supabase) - Follow us [on Twitter](https://twitter.com/supabase_io) -- Become a [sponsor](https://github.com/sponsors/supabase) \ No newline at end of file +- Become a [sponsor](https://github.com/sponsors/supabase) diff --git a/web/blog/2020-09-03-supabase-alpha-august-2020.md b/web/blog/2020-09-03-supabase-alpha-august-2020.md index ebf3578b231..2aeaa0b7255 100644 --- a/web/blog/2020-09-03-supabase-alpha-august-2020.md +++ b/web/blog/2020-09-03-supabase-alpha-august-2020.md @@ -20,8 +20,7 @@ Watch a full demo: - -### Easily create tables +### Easily create tables Set up tables and columns directly from the table view. @@ -37,10 +36,9 @@ You can now invite team members to your organisation. - ### Auth: Email Confirmations -You can now enable Email Confirmations for new users. This can be toggled on or off and the template for this email can be edited via the dashboard. +You can now enable Email Confirmations for new users. This can be toggled on or off and the template for this email can be edited via the dashboard.
- ); + ) } function ShowcaseSection({ showcase }) { return (
{/* Display showcase */} - {showcase.map((v, i) => - (
+ {showcase.map((v, i) => ( +
-
)) - } +
+ ))}
) } function ShowcaseCard({ projectOrCompany, isOpenSource, publicRepo }) { - const spacedFooter = projectOrCompany.web_site && publicRepo && isOpenSource ? "ShowcaseCard-Footer-Spaced" : null; + const spacedFooter = + projectOrCompany.web_site && publicRepo && isOpenSource ? 'ShowcaseCard-Footer-Spaced' : null const button = (label, href) => ( - {label} + + {label} + ) return ( @@ -66,8 +66,8 @@ function ShowcaseCard({ projectOrCompany, isOpenSource, publicRepo }) {
-

{projectOrCompany.name}

- {isOpenSource ? "#OpenSource" : null} +

{projectOrCompany.name}

+ {isOpenSource ? '#OpenSource' : null}

{projectOrCompany.description}

@@ -77,5 +77,5 @@ function ShowcaseCard({ projectOrCompany, isOpenSource, publicRepo }) { {publicRepo && isOpenSource ? button('View repo', publicRepo) : null}
- ); + ) } diff --git a/web/src/pages/styles.module.css b/web/src/pages/styles.module.css index 35dd40169f1..da5317c7e9e 100755 --- a/web/src/pages/styles.module.css +++ b/web/src/pages/styles.module.css @@ -22,7 +22,7 @@ min-height: 80vh; } .hero .code-with-header { - box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.3); + box-shadow: 0 0 5px 5px rgba(0, 0, 0, 0.3); /* box-shadow: var(--ifm-global-shadow-md); */ } diff --git a/web/src/theme/BlogListPage/index.tsx b/web/src/theme/BlogListPage/index.tsx index c725a954be5..5d863c8f227 100644 --- a/web/src/theme/BlogListPage/index.tsx +++ b/web/src/theme/BlogListPage/index.tsx @@ -5,13 +5,13 @@ * LICENSE file in the root directory of this source tree. */ -import React from 'react'; +import React from 'react' -import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; -import Layout from '@theme/Layout'; -import BlogPostItem from '@theme/BlogPostItem'; -import BlogListPaginator from '@theme/BlogListPaginator'; -import type {Props} from '@theme/BlogListPage'; +import useDocusaurusContext from '@docusaurus/useDocusaurusContext' +import Layout from '@theme/Layout' +import BlogPostItem from '@theme/BlogPostItem' +import BlogListPaginator from '@theme/BlogListPaginator' +import type { Props } from '@theme/BlogListPage' import Link from '@docusaurus/Link' import styles from './styles.module.css' import clsx from 'clsx' @@ -32,14 +32,14 @@ const MONTHS = [ ] function BlogListPage(props: Props): JSX.Element { - const {metadata, items} = props; + const { metadata, items } = props const { - siteConfig: {title: siteTitle}, - } = useDocusaurusContext(); - const isBlogOnlyMode = metadata.permalink === '/'; - const title = isBlogOnlyMode ? siteTitle : 'Blog'; - const {blogDescription} = metadata; - + siteConfig: { title: siteTitle }, + } = useDocusaurusContext() + const isBlogOnlyMode = metadata.permalink === '/' + const title = isBlogOnlyMode ? siteTitle : 'Blog' + const { blogDescription } = metadata + return (
@@ -99,7 +99,7 @@ function BlogListPage(props: Props): JSX.Element { ) })}
-
+
@@ -109,4 +109,4 @@ function BlogListPage(props: Props): JSX.Element { ) } -export default BlogListPage; +export default BlogListPage diff --git a/web/src/theme/BlogListPage/styles.module.css b/web/src/theme/BlogListPage/styles.module.css index 1fda9cc6c6a..d92813a2e50 100644 --- a/web/src/theme/BlogListPage/styles.module.css +++ b/web/src/theme/BlogListPage/styles.module.css @@ -25,4 +25,4 @@ } .PostPreview:hover svg { fill: var(--custom-primary); -} \ No newline at end of file +} diff --git a/web/static/css/metro.css b/web/static/css/metro.css index 13c0a785b97..ec164b2f9b2 100644 --- a/web/static/css/metro.css +++ b/web/static/css/metro.css @@ -1,33 +1,32 @@ - /* Body Font (Metro) */ @font-face { - font-family: "Metro"; - src: url("/fonts/metro/metro-sans-book.woff2") format("woff2"), - url("/fonts/metro/metro-sans-book.woff") format("woff"); + font-family: 'Metro'; + src: url('/fonts/metro/metro-sans-book.woff2') format('woff2'), + url('/fonts/metro/metro-sans-book.woff') format('woff'); font-weight: 300; font-style: normal; } @font-face { - font-family: "Metro"; - src: url("/fonts/metro/metro-sans-regular.woff2") format("woff2"), - url("/fonts/metro/metro-sans-regular.woff") format("woff"); + font-family: 'Metro'; + src: url('/fonts/metro/metro-sans-regular.woff2') format('woff2'), + url('/fonts/metro/metro-sans-regular.woff') format('woff'); font-weight: 400; font-style: normal; } @font-face { - font-family: "Metro"; - src: url("/fonts/metro/metro-sans-semi-bold.woff2") format("woff2"), - url("/fonts/metro/metro-sans-semi-bold.woff") format("woff"); + font-family: 'Metro'; + src: url('/fonts/metro/metro-sans-semi-bold.woff2') format('woff2'), + url('/fonts/metro/metro-sans-semi-bold.woff') format('woff'); font-weight: 600; font-style: normal; } @font-face { - font-family: "Metro"; - src: url("/fonts/metro/metro-sans-bold.woff2") format("woff2"), - url("/fonts/metro/metro-sans-bold.woff") format("woff"); + font-family: 'Metro'; + src: url('/fonts/metro/metro-sans-bold.woff2') format('woff2'), + url('/fonts/metro/metro-sans-bold.woff') format('woff'); font-weight: 700; font-style: normal; -} \ No newline at end of file +} diff --git a/web/static/css/tt-norms.css b/web/static/css/tt-norms.css index 0ac28b729d5..63f3caf8b4d 100644 --- a/web/static/css/tt-norms.css +++ b/web/static/css/tt-norms.css @@ -1,4 +1,3 @@ - @font-face { font-family: 'TT Norms Pro'; font-style: normal; diff --git a/web/traction.js b/web/traction.js index 403775b8609..90ad74f8d38 100644 --- a/web/traction.js +++ b/web/traction.js @@ -81,11 +81,14 @@ const main = async () => { }) } - fs.writeFile('./src/data/stars/stargazers.json', JSON.stringify(data, null, 2), 'utf8', function ( - err - ) { - if (err) throw err - console.log('stargazers.json saved.') - }) + fs.writeFile( + './src/data/stars/stargazers.json', + JSON.stringify(data, null, 2), + 'utf8', + function (err) { + if (err) throw err + console.log('stargazers.json saved.') + } + ) } main() diff --git a/www/@types/environment.d.ts b/www/@types/environment.d.ts index 968e8d10979..1a22007f9fc 100644 --- a/www/@types/environment.d.ts +++ b/www/@types/environment.d.ts @@ -1,11 +1,11 @@ declare global { namespace NodeJS { interface ProcessEnv { - GA_PROPERTY_ID: string; + GA_PROPERTY_ID: string } } } // If this file has no import/export statements (i.e. is a script) // convert it into a module by adding an empty export statement. -export {} \ No newline at end of file +export {} diff --git a/www/@types/typings.d.ts b/www/@types/typings.d.ts index f3f59664185..6568666452a 100644 --- a/www/@types/typings.d.ts +++ b/www/@types/typings.d.ts @@ -1,4 +1,4 @@ -declare module "*.json" { - const value: any; - export default value; +declare module '*.json' { + const value: any + export default value } diff --git a/www/README.md b/www/README.md index c07215926f7..9982e414499 100644 --- a/www/README.md +++ b/www/README.md @@ -1,3 +1,3 @@ # Supabase -Website. \ No newline at end of file +Website. diff --git a/www/components/BuiltWithSupabase/index.tsx b/www/components/BuiltWithSupabase/index.tsx index 9eeb98b8883..10303532874 100644 --- a/www/components/BuiltWithSupabase/index.tsx +++ b/www/components/BuiltWithSupabase/index.tsx @@ -16,7 +16,9 @@ const BuiltExamples = () => {
What can you build with supabase? -

There are many example apps and starter projects to get going

+

+ There are many example apps and starter projects to get going +

{ {Examples.slice(0, 6).map((example, i) => { return (
2 && `sm:hidden lg:block`}`} key={i} + className={`col-span-12 lg:col-span-6 xl:col-span-4 ${i > 2 && `sm:hidden lg:block`}`} + key={i} >
diff --git a/www/components/MadeForDevelopers/index.tsx b/www/components/MadeForDevelopers/index.tsx index 6c84fccb4dd..f4682f4c72f 100644 --- a/www/components/MadeForDevelopers/index.tsx +++ b/www/components/MadeForDevelopers/index.tsx @@ -13,7 +13,7 @@ const MadeForDevelopers = () => { We introspect your database to provide APIs instantly. Stop building repetitive CRUD diff --git a/www/components/Nav/index.tsx b/www/components/Nav/index.tsx index df12bbb19ca..f6d1bade603 100644 --- a/www/components/Nav/index.tsx +++ b/www/components/Nav/index.tsx @@ -10,7 +10,7 @@ import SolutionsData from 'data/Solutions.json' import Solutions from '~/components/Nav/Product' import Developers from '~/components/Nav/Developers' -import Annoucement from '~/components/Nav/Annoucement' +import Annoucement from '~/components/Nav/Annoucement' type Props = { darkMode: boolean diff --git a/www/components/PricingTableRow.tsx b/www/components/PricingTableRow.tsx index 4be68ec33ae..9cb992f62e2 100644 --- a/www/components/PricingTableRow.tsx +++ b/www/components/PricingTableRow.tsx @@ -52,10 +52,10 @@ export const PricingTableRowDesktop = (props: any) => { scope="colgroup" > - {props.icon && ( - - )} - {category.title} + {props.icon && } + + {category.title} + @@ -111,10 +111,10 @@ export const PricingTableRowMobile = (props: any) => { diff --git a/www/components/Sections/APISection.tsx b/www/components/Sections/APISection.tsx index 2eed4996822..716ca0bef53 100644 --- a/www/components/Sections/APISection.tsx +++ b/www/components/Sections/APISection.tsx @@ -65,7 +65,7 @@ function APISection(props: Props) { ( )} ) : null} - {props.h1} + + {props.h1} + {props.subheader && ( {props.subheader.map((subheader, i) => { - return

{subheader}

+ return ( +

+ {subheader} +

+ ) })}
)} diff --git a/www/data/Authors.json b/www/data/Authors.json index e4be649b227..d745a6275cf 100644 --- a/www/data/Authors.json +++ b/www/data/Authors.json @@ -1,19 +1,19 @@ { "paul_copplestone": { - "name" : "Paul Copplestone", - "job_title" : "CEO and Co-Founder", + "name": "Paul Copplestone", + "job_title": "CEO and Co-Founder", "username": "kiwicopple", "avatar_url": "https://avatars0.githubusercontent.com/u/10214025?v=4" }, - "anthony_wilson" : { - "name" : "Anthony Wilson", - "job_title" : "CTO and Co-Founder", + "anthony_wilson": { + "name": "Anthony Wilson", + "job_title": "CTO and Co-Founder", "username": "awalias", "avatar_url": "https://avatars3.githubusercontent.com/u/458736?v=4" }, "rory": { - "name" : "Rory Wilding", - "job_title" : "Head of Growth", + "name": "Rory Wilding", + "job_title": "Head of Growth", "username": "roryw10", "avatar_url": "https://avatars0.githubusercontent.com/u/10214025?v=4" } diff --git a/www/data/BetaPage.js b/www/data/BetaPage.js index 9c5eaf57ada..22a7c93f6a4 100644 --- a/www/data/BetaPage.js +++ b/www/data/BetaPage.js @@ -19,7 +19,7 @@ export const AlphaNumbers = [ ), value: 3102, unit: null, - name: 'Hosted Databases' + name: 'Hosted Databases', }, { icon: ( @@ -39,7 +39,7 @@ export const AlphaNumbers = [ ), value: 5460, unit: null, - name: 'Github Stars' + name: 'Github Stars', }, { icon: ( @@ -60,7 +60,7 @@ export const AlphaNumbers = [ ), value: 505, unit: null, - name: 'Github issues resolved' + name: 'Github issues resolved', }, { icon: ( @@ -83,7 +83,7 @@ export const AlphaNumbers = [ ), value: 379, unit: null, - name: 'Forks of our repositories' + name: 'Forks of our repositories', }, { icon: ( @@ -106,7 +106,7 @@ export const AlphaNumbers = [ ), value: 88, unit: null, - name: 'Active Github contributors' + name: 'Active Github contributors', }, { icon: ( @@ -127,39 +127,41 @@ export const AlphaNumbers = [ ), value: 238, unit: 'K', - name: 'Lines of code' + name: 'Lines of code', }, ] export const IntroductionSegments = [ { - description: "To deliver a production-ready platform, we've put extra effort into three areas of Supabase.", + description: + "To deliver a production-ready platform, we've put extra effort into three areas of Supabase.", chapters: [ { no: 1, name: 'Performance', key: 'performance' }, { no: 2, name: 'Security', key: 'security' }, - { no: 3, name: 'Reliability', key: 'reliability' } - ] + { no: 3, name: 'Reliability', key: 'reliability' }, + ], }, { - description: "We received an incredible number of feature requests from our Alpha Users, and we're using these conversations build a simple, predictable Beta Pricing model.", + description: + "We received an incredible number of feature requests from our Alpha Users, and we're using these conversations build a simple, predictable Beta Pricing model.", chapters: [ { no: 4, name: 'New Features & Integrations', key: 'features' }, - { no: 5, name: 'Beta Pricing', key: 'pricing' } - ] + { no: 5, name: 'Beta Pricing', key: 'pricing' }, + ], }, { - description: "Open Source is, and will always be, at the core of everything that we do. Find out how we've been working with the community to support existing OSS projects and Communities.", - chapters: [ - { no: 6, name: 'Open Source', key: 'openSource' } - ] + description: + "Open Source is, and will always be, at the core of everything that we do. Find out how we've been working with the community to support existing OSS projects and Communities.", + chapters: [{ no: 6, name: 'Open Source', key: 'openSource' }], }, { - description: "And finally, we're partnering with the best in the business to help us achieve our goal of becoming the default backend for every company. We'll be announcing the details soon, and we're excited to share what we have in store for 2021:", + description: + "And finally, we're partnering with the best in the business to help us achieve our goal of becoming the default backend for every company. We'll be announcing the details soon, and we're excited to share what we have in store for 2021:", chapters: [ { no: 7, name: 'Funding Partners', key: 'fundingPartners' }, { no: 8, name: 'Scaling Our Team', key: 'scaling' }, - { no: 9, name: 'What\'s Next', key: 'next' } - ] + { no: 9, name: "What's Next", key: 'next' }, + ], }, ] @@ -171,7 +173,7 @@ export const PerformanceComparisonData = [ stats: [ { name: 'Supabase', value: 1167 }, { name: 'Firestore', value: 366 }, - ] + ], }, { key: 'write', @@ -179,6 +181,6 @@ export const PerformanceComparisonData = [ stats: [ { name: 'Supabase', value: 870 }, { name: 'Firestore', value: 280 }, - ] - } + ], + }, ] diff --git a/www/data/CodeEditorTheme.js b/www/data/CodeEditorTheme.js index d49ec0d1da1..3ac408c9cf6 100644 --- a/www/data/CodeEditorTheme.js +++ b/www/data/CodeEditorTheme.js @@ -1,116 +1,116 @@ const monokaiCustomTheme = { - "hljs": { - "display": "block", - "overflowX": "auto", - "padding": "0.5em", - "background": "#272822", - "color": "#ddd" + hljs: { + display: 'block', + overflowX: 'auto', + padding: '0.5em', + background: '#272822', + color: '#ddd', }, - "hljs-tag": { - "color": "#569cd6" + 'hljs-tag': { + color: '#569cd6', }, - "hljs-keyword": { - "color": "#569cd6", - "fontWeight": "bold" + 'hljs-keyword': { + color: '#569cd6', + fontWeight: 'bold', }, - "hljs-selector-tag": { - "color": "#569cd6", - "fontWeight": "bold" + 'hljs-selector-tag': { + color: '#569cd6', + fontWeight: 'bold', }, - "hljs-literal": { - "color": "#569cd6", - "fontWeight": "bold" + 'hljs-literal': { + color: '#569cd6', + fontWeight: 'bold', }, - "hljs-strong": { - "color": "#569cd6" + 'hljs-strong': { + color: '#569cd6', }, - "hljs-name": { - "color": "#569cd6" + 'hljs-name': { + color: '#569cd6', }, - "hljs-code": { - "color": "#66d9ef" + 'hljs-code': { + color: '#66d9ef', }, - "hljs-class .hljs-title": { - "color": "white" + 'hljs-class .hljs-title': { + color: 'white', }, - "hljs-attribute": { - "color": "#bf79db" + 'hljs-attribute': { + color: '#bf79db', }, - "hljs-symbol": { - "color": "#bf79db" + 'hljs-symbol': { + color: '#bf79db', }, - "hljs-regexp": { - "color": "#bf79db" + 'hljs-regexp': { + color: '#bf79db', }, - "hljs-link": { - "color": "#bf79db" + 'hljs-link': { + color: '#bf79db', }, - "hljs-string": { - "color": "#3ECF8E" + 'hljs-string': { + color: '#3ECF8E', }, - "hljs-bullet": { - "color": "#3ECF8E" + 'hljs-bullet': { + color: '#3ECF8E', }, - "hljs-subst": { - "color": "#3ECF8E" + 'hljs-subst': { + color: '#3ECF8E', }, - "hljs-title": { - "color": "#3ECF8E", - "fontWeight": "bold" + 'hljs-title': { + color: '#3ECF8E', + fontWeight: 'bold', }, - "hljs-section": { - "color": "#3ECF8E", - "fontWeight": "bold" + 'hljs-section': { + color: '#3ECF8E', + fontWeight: 'bold', }, - "hljs-emphasis": { - "color": "#3ECF8E" + 'hljs-emphasis': { + color: '#3ECF8E', }, - "hljs-type": { - "color": "#3ECF8E", - "fontWeight": "bold" + 'hljs-type': { + color: '#3ECF8E', + fontWeight: 'bold', }, - "hljs-built_in": { - "color": "#3ECF8E" + 'hljs-built_in': { + color: '#3ECF8E', }, - "hljs-builtin-name": { - "color": "#3ECF8E" + 'hljs-builtin-name': { + color: '#3ECF8E', }, - "hljs-selector-attr": { - "color": "#3ECF8E" + 'hljs-selector-attr': { + color: '#3ECF8E', }, - "hljs-selector-pseudo": { - "color": "#3ECF8E" + 'hljs-selector-pseudo': { + color: '#3ECF8E', }, - "hljs-addition": { - "color": "#3ECF8E" + 'hljs-addition': { + color: '#3ECF8E', }, - "hljs-variable": { - "color": "#3ECF8E" + 'hljs-variable': { + color: '#3ECF8E', }, - "hljs-template-tag": { - "color": "#3ECF8E" + 'hljs-template-tag': { + color: '#3ECF8E', }, - "hljs-template-variable": { - "color": "#3ECF8E" + 'hljs-template-variable': { + color: '#3ECF8E', }, - "hljs-comment": { - "color": "#75715e" + 'hljs-comment': { + color: '#75715e', }, - "hljs-quote": { - "color": "#75715e" + 'hljs-quote': { + color: '#75715e', }, - "hljs-deletion": { - "color": "#75715e" + 'hljs-deletion': { + color: '#75715e', }, - "hljs-meta": { - "color": "#75715e" + 'hljs-meta': { + color: '#75715e', }, - "hljs-doctag": { - "fontWeight": "bold" + 'hljs-doctag': { + fontWeight: 'bold', }, - "hljs-selector-id": { - "fontWeight": "bold" - } -}; + 'hljs-selector-id': { + fontWeight: 'bold', + }, +} -export default monokaiCustomTheme \ No newline at end of file +export default monokaiCustomTheme diff --git a/www/data/products/database/api-examples.js b/www/data/products/database/api-examples.js index c31ac0695aa..b2e20f7d889 100644 --- a/www/data/products/database/api-examples.js +++ b/www/data/products/database/api-examples.js @@ -1,4 +1,3 @@ - /* * description */ diff --git a/www/pages/blog/tags/[tag].tsx b/www/pages/blog/tags/[tag].tsx index 3d0cf3bc6b9..a059ee4d4b8 100644 --- a/www/pages/blog/tags/[tag].tsx +++ b/www/pages/blog/tags/[tag].tsx @@ -19,7 +19,7 @@ export async function getStaticProps({ params }: any) { export async function getStaticPaths() { const categories = getAllCategories() return { - paths: categories.map(((category: any) => ({ params: { tag: category } }))), + paths: categories.map((category: any) => ({ params: { tag: category } })), fallback: false, } } @@ -37,7 +37,9 @@ function TagBlogsPage(props: Props) {
- {blogs.map((blog: PostTypes, idx: number) => )} + {blogs.map((blog: PostTypes, idx: number) => ( + + ))}
diff --git a/www/pages/pricing/index.tsx b/www/pages/pricing/index.tsx index 7b0727da5af..850b0e39264 100644 --- a/www/pages/pricing/index.tsx +++ b/www/pages/pricing/index.tsx @@ -87,9 +87,21 @@ export default function IndexPage() { - - - + + + @@ -112,9 +124,21 @@ export default function IndexPage() { - - - + + + @@ -139,9 +163,21 @@ export default function IndexPage() { - - - + + + @@ -256,7 +292,7 @@ export default function IndexPage() {
- - - + + + @@ -348,7 +393,7 @@ export default function IndexPage() { - + ) } diff --git a/www/tailwind.config.js b/www/tailwind.config.js index d71e91afd2a..1ae5f274858 100644 --- a/www/tailwind.config.js +++ b/www/tailwind.config.js @@ -1,7 +1,7 @@ module.exports = { purge: ['./components/**/*.tsx', './pages/**/*.tsx'], darkMode: 'class', // 'media' or 'class' - mode: "jit", + mode: 'jit', theme: { extend: { screens: { diff --git a/www/webpack.config.js b/www/webpack.config.js index 3ae6b5231cb..a25fedf2d23 100644 --- a/www/webpack.config.js +++ b/www/webpack.config.js @@ -1,5 +1,3 @@ - - module.exports = { module: { rules: [ @@ -13,4 +11,4 @@ module.exports = { }, ], }, -}; \ No newline at end of file +}
- {category.icon ? ( - - ) : null} - {category.title} + {category.icon ? : null} + + {category.title} +

- + $25 /project /month plus usage costs @@ -277,9 +313,18 @@ export default function IndexPage() {