Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

chore: archive nextjs-live-tracker-map example

phamhieueded69d60ec7
diff --git a/examples/nextjs-live-tracker-map/README.md b/examples/nextjs-live-tracker-map/README.md
index f923328ed78..4ea79e91113 100644
--- a/examples/nextjs-live-tracker-map/README.md
+++ b/examples/nextjs-live-tracker-map/README.md
@@ -1,79 +1 @@
-# Live Tracker Map [WIP]
-Build with supabase auth, realtime and leafletjs. [[Demo App]](https://realtime-map-v2.vercel.app/)
-
-<p align="center">
-<kbd>
-<img src="https://media.giphy.com/media/iDU80ngpsSddc0ObGI/giphy.gif" alt="Demo"/>
-</kbd>
-</p>
-
-## How to use
-#### Clone this folder
-```bash
-git clone https://github.com/supabase/supabase
-cd supabase/examples/live-tracker-map
-```
-
-#### Install dependencies
-```bash
-npm install
-```
-
-#### Start the app
-```bash
-# Open a terminal and run:
-npm run dev
-```
-Visit http://localhost:3000 and start testing!
-
-## Test with your own Supabase Project
-#### Database schema
-Go to [app.supabase.io](https://app.supabase.io/), create a new organisation and project if you haven't had one.
-Run this sql query to create required tables.
-```sql
--- USERS
-CREATE TYPE public.user_role AS ENUM ('DRIVER', 'MANAGER');
-CREATE TABLE public.users (
- id uuid NOT NULL PRIMARY KEY, -- UUID from auth.users
- username text,
- role user_role DEFAULT 'DRIVER'::public.user_role
-);
-COMMENT ON table public.users IS 'Profile data for each user.';
-COMMENT ON column public.users.id IS 'References the internal Supabase Auth user.';
-ALTER TABLE public.users REPLICA IDENTITY FULL; -- Send "previous data" on change
-ALTER TABLE public.users ENABLE ROW LEVEL SECURITY;
-CREATE POLICY "Allow logged-in read access" on public.users FOR SELECT USING ( auth.role() = 'authenticated' );
-CREATE POLICY "Allow individual insert access" on public.users FOR INSERT WITH CHECK ( auth.uid() = id );
-CREATE POLICY "Allow individual update access" on public.users FOR UPDATE USING ( auth.uid() = id );
-
--- LOCATIONS
-CREATE TABLE public.locations (
- id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
- latitude numeric NOT NULL,
- longitude numeric NOT NULL,
- user_id uuid REFERENCES public.users NOT NULL
-);
-ALTER TABLE public.locations REPLICA IDENTITY FULL; -- Send "previous data" on change
-ALTER TABLE public.locations ENABLE ROW LEVEL SECURITY;
-COMMENT ON table public.locations IS 'Individual locations sent by each user.';
-CREATE POLICY "Allow logged-in read access" on public.locations USING ( auth.role() = 'authenticated' );
-CREATE POLICY "Allow individual insert access" on public.locations FOR INSERT WITH CHECK ( auth.uid() = user_id );
-```
-
-#### Setup env vars
-Next, copy the `.env.local.example` file in this directory to `.env.local` (which will be ignored by Git):
-
-```bash
-cp .env.local.example .env.local
-```
-
-Then set each variable on `.env.local`:
-
-- `NEXT_PUBLIC_SUPABASE_ENDPOINT` should be the **API URL**
-- `NEXT_PUBLIC_SUPABASE_APIKEY` should be the **anon** key
-
-You can get these values from your project dashboard at [app.supabase.io](https://app.supabase.io/).
-
-The **anon** key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. This enables row level security for your data.
-
-> **_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.
\ No newline at end of file
+# Live Tracker Map [COMING SOON]
diff --git a/examples/nextjs-live-tracker-map/archive/README.md b/examples/nextjs-live-tracker-map/archive/README.md
new file mode 100644
index 00000000000..e0764de6d3f
--- /dev/null
+++ b/examples/nextjs-live-tracker-map/archive/README.md
@@ -0,0 +1,91 @@
+# Live Tracker Map [WIP]
+
+Build with supabase auth, realtime and leafletjs. [[Demo App]](https://realtime-map-v2.vercel.app/)
+
+**This `archive` project doesn't use official supabase-js and gotrue-js libs.**
+
+<p align="center">
+<kbd>
+<img src="https://media.giphy.com/media/iDU80ngpsSddc0ObGI/giphy.gif" alt="Demo"/>
+</kbd>
+</p>
+
+## How to use
+
+#### Clone this folder
+
+```bash
+git clone https://github.com/supabase/supabase
+cd supabase/examples/live-tracker-map
+```
+
+#### Install dependencies
+
+```bash
+npm install
+```
+
+#### Start the app
+
+```bash
+# Open a terminal and run:
+npm run dev
+```
+
+Visit http://localhost:3000 and start testing!
+
+## Test with your own Supabase Project
+
+#### Database schema
+
+Go to [app.supabase.io](https://app.supabase.io/), create a new organisation and project if you haven't had one.
+Run this sql query to create required tables.
+
+```sql
+-- USERS
+CREATE TYPE public.user_role AS ENUM ('DRIVER', 'MANAGER');
+CREATE TABLE public.users (
+ id uuid NOT NULL PRIMARY KEY, -- UUID from auth.users
+ username text,
+ role user_role DEFAULT 'DRIVER'::public.user_role
+);
+COMMENT ON table public.users IS 'Profile data for each user.';
+COMMENT ON column public.users.id IS 'References the internal Supabase Auth user.';
+ALTER TABLE public.users REPLICA IDENTITY FULL; -- Send "previous data" on change
+ALTER TABLE public.users ENABLE ROW LEVEL SECURITY;
+CREATE POLICY "Allow logged-in read access" on public.users FOR SELECT USING ( auth.role() = 'authenticated' );
+CREATE POLICY "Allow individual insert access" on public.users FOR INSERT WITH CHECK ( auth.uid() = id );
+CREATE POLICY "Allow individual update access" on public.users FOR UPDATE USING ( auth.uid() = id );
+
+-- LOCATIONS
+CREATE TABLE public.locations (
+ id bigint GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
+ latitude numeric NOT NULL,
+ longitude numeric NOT NULL,
+ user_id uuid REFERENCES public.users NOT NULL
+);
+ALTER TABLE public.locations REPLICA IDENTITY FULL; -- Send "previous data" on change
+ALTER TABLE public.locations ENABLE ROW LEVEL SECURITY;
+COMMENT ON table public.locations IS 'Individual locations sent by each user.';
+CREATE POLICY "Allow logged-in read access" on public.locations USING ( auth.role() = 'authenticated' );
+CREATE POLICY "Allow individual insert access" on public.locations FOR INSERT WITH CHECK ( auth.uid() = user_id );
+```
+
+#### Setup env vars
+
+Next, copy the `.env.local.example` file in this directory to `.env.local` (which will be ignored by Git):
+
+```bash
+cp .env.local.example .env.local
+```
+
+Then set each variable on `.env.local`:
+
+- `NEXT_PUBLIC_SUPABASE_ENDPOINT` should be the **API URL**
+- `NEXT_PUBLIC_SUPABASE_APIKEY` should be the **anon** key
+
+You can get these values from your project dashboard at [app.supabase.io](https://app.supabase.io/).
+
+The **anon** key is your client-side API key. It allows "anonymous access" to your database, until the user has logged in. Once they have logged in, the keys will switch to the user's own login token. This enables row level security for your data.
+
+> **_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.
diff --git a/examples/nextjs-live-tracker-map/components/MapInput.js b/examples/nextjs-live-tracker-map/archive/components/MapInput.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/components/MapInput.js
rename to examples/nextjs-live-tracker-map/archive/components/MapInput.js
diff --git a/examples/nextjs-live-tracker-map/components/MapView.js b/examples/nextjs-live-tracker-map/archive/components/MapView.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/components/MapView.js
rename to examples/nextjs-live-tracker-map/archive/components/MapView.js
diff --git a/examples/nextjs-live-tracker-map/components/SignIn.js b/examples/nextjs-live-tracker-map/archive/components/SignIn.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/components/SignIn.js
rename to examples/nextjs-live-tracker-map/archive/components/SignIn.js
diff --git a/examples/nextjs-live-tracker-map/components/TextLog.js b/examples/nextjs-live-tracker-map/archive/components/TextLog.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/components/TextLog.js
rename to examples/nextjs-live-tracker-map/archive/components/TextLog.js
diff --git a/examples/nextjs-live-tracker-map/jsconfig.json b/examples/nextjs-live-tracker-map/archive/jsconfig.json
similarity index 100%
rename from examples/nextjs-live-tracker-map/jsconfig.json
rename to examples/nextjs-live-tracker-map/archive/jsconfig.json
diff --git a/examples/nextjs-live-tracker-map/lib/Store.js b/examples/nextjs-live-tracker-map/archive/lib/Store.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/Store.js
rename to examples/nextjs-live-tracker-map/archive/lib/Store.js
diff --git a/examples/nextjs-live-tracker-map/lib/UserContext.js b/examples/nextjs-live-tracker-map/archive/lib/UserContext.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/UserContext.js
rename to examples/nextjs-live-tracker-map/archive/lib/UserContext.js
diff --git a/examples/nextjs-live-tracker-map/lib/gotrue/admin.js b/examples/nextjs-live-tracker-map/archive/lib/gotrue/admin.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/gotrue/admin.js
rename to examples/nextjs-live-tracker-map/archive/lib/gotrue/admin.js
diff --git a/examples/nextjs-live-tracker-map/lib/gotrue/index.js b/examples/nextjs-live-tracker-map/archive/lib/gotrue/index.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/gotrue/index.js
rename to examples/nextjs-live-tracker-map/archive/lib/gotrue/index.js
diff --git a/examples/nextjs-live-tracker-map/lib/gotrue/user.js b/examples/nextjs-live-tracker-map/archive/lib/gotrue/user.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/gotrue/user.js
rename to examples/nextjs-live-tracker-map/archive/lib/gotrue/user.js
diff --git a/examples/nextjs-live-tracker-map/lib/supabase/Auth.js b/examples/nextjs-live-tracker-map/archive/lib/supabase/Auth.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/supabase/Auth.js
rename to examples/nextjs-live-tracker-map/archive/lib/supabase/Auth.js
diff --git a/examples/nextjs-live-tracker-map/lib/supabase/Realtime.js b/examples/nextjs-live-tracker-map/archive/lib/supabase/Realtime.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/supabase/Realtime.js
rename to examples/nextjs-live-tracker-map/archive/lib/supabase/Realtime.js
diff --git a/examples/nextjs-live-tracker-map/lib/supabase/index.js b/examples/nextjs-live-tracker-map/archive/lib/supabase/index.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/supabase/index.js
rename to examples/nextjs-live-tracker-map/archive/lib/supabase/index.js
diff --git a/examples/nextjs-live-tracker-map/lib/supabase/utils/ChangeMapper.js b/examples/nextjs-live-tracker-map/archive/lib/supabase/utils/ChangeMapper.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/supabase/utils/ChangeMapper.js
rename to examples/nextjs-live-tracker-map/archive/lib/supabase/utils/ChangeMapper.js
diff --git a/examples/nextjs-live-tracker-map/lib/supabase/utils/Helpers.js b/examples/nextjs-live-tracker-map/archive/lib/supabase/utils/Helpers.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/supabase/utils/Helpers.js
rename to examples/nextjs-live-tracker-map/archive/lib/supabase/utils/Helpers.js
diff --git a/examples/nextjs-live-tracker-map/lib/utils.js b/examples/nextjs-live-tracker-map/archive/lib/utils.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/lib/utils.js
rename to examples/nextjs-live-tracker-map/archive/lib/utils.js
diff --git a/examples/nextjs-live-tracker-map/package-lock.json b/examples/nextjs-live-tracker-map/archive/package-lock.json
similarity index 100%
rename from examples/nextjs-live-tracker-map/package-lock.json
rename to examples/nextjs-live-tracker-map/archive/package-lock.json
diff --git a/examples/nextjs-live-tracker-map/package.json b/examples/nextjs-live-tracker-map/archive/package.json
similarity index 100%
rename from examples/nextjs-live-tracker-map/package.json
rename to examples/nextjs-live-tracker-map/archive/package.json
diff --git a/examples/nextjs-live-tracker-map/pages/_app.js b/examples/nextjs-live-tracker-map/archive/pages/_app.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/pages/_app.js
rename to examples/nextjs-live-tracker-map/archive/pages/_app.js
diff --git a/examples/nextjs-live-tracker-map/pages/api/auth/login.js b/examples/nextjs-live-tracker-map/archive/pages/api/auth/login.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/pages/api/auth/login.js
rename to examples/nextjs-live-tracker-map/archive/pages/api/auth/login.js
diff --git a/examples/nextjs-live-tracker-map/pages/api/auth/signup.js b/examples/nextjs-live-tracker-map/archive/pages/api/auth/signup.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/pages/api/auth/signup.js
rename to examples/nextjs-live-tracker-map/archive/pages/api/auth/signup.js
diff --git a/examples/nextjs-live-tracker-map/pages/driver.js b/examples/nextjs-live-tracker-map/archive/pages/driver.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/pages/driver.js
rename to examples/nextjs-live-tracker-map/archive/pages/driver.js
diff --git a/examples/nextjs-live-tracker-map/pages/index.js b/examples/nextjs-live-tracker-map/archive/pages/index.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/pages/index.js
rename to examples/nextjs-live-tracker-map/archive/pages/index.js
diff --git a/examples/nextjs-live-tracker-map/pages/manager.js b/examples/nextjs-live-tracker-map/archive/pages/manager.js
similarity index 100%
rename from examples/nextjs-live-tracker-map/pages/manager.js
rename to examples/nextjs-live-tracker-map/archive/pages/manager.js
diff --git a/examples/nextjs-live-tracker-map/public/favicon.ico b/examples/nextjs-live-tracker-map/archive/public/favicon.ico
similarity index 100%
rename from examples/nextjs-live-tracker-map/public/favicon.ico
rename to examples/nextjs-live-tracker-map/archive/public/favicon.ico
diff --git a/examples/nextjs-live-tracker-map/public/favicon.png b/examples/nextjs-live-tracker-map/archive/public/favicon.png
similarity index 100%
rename from examples/nextjs-live-tracker-map/public/favicon.png
rename to examples/nextjs-live-tracker-map/archive/public/favicon.png
diff --git a/examples/nextjs-live-tracker-map/public/spinner.gif b/examples/nextjs-live-tracker-map/archive/public/spinner.gif
similarity index 100%
rename from examples/nextjs-live-tracker-map/public/spinner.gif
rename to examples/nextjs-live-tracker-map/archive/public/spinner.gif
diff --git a/examples/nextjs-live-tracker-map/public/supabase.svg b/examples/nextjs-live-tracker-map/archive/public/supabase.svg
similarity index 100%
rename from examples/nextjs-live-tracker-map/public/supabase.svg
rename to examples/nextjs-live-tracker-map/archive/public/supabase.svg
diff --git a/examples/nextjs-live-tracker-map/styles/Home.module.css b/examples/nextjs-live-tracker-map/archive/styles/Home.module.css
similarity index 100%
rename from examples/nextjs-live-tracker-map/styles/Home.module.css
rename to examples/nextjs-live-tracker-map/archive/styles/Home.module.css
diff --git a/examples/nextjs-live-tracker-map/styles/Map.module.css b/examples/nextjs-live-tracker-map/archive/styles/Map.module.css
similarity index 100%
rename from examples/nextjs-live-tracker-map/styles/Map.module.css
rename to examples/nextjs-live-tracker-map/archive/styles/Map.module.css
diff --git a/examples/nextjs-live-tracker-map/styles/globals.css b/examples/nextjs-live-tracker-map/archive/styles/globals.css
similarity index 100%
rename from examples/nextjs-live-tracker-map/styles/globals.css
rename to examples/nextjs-live-tracker-map/archive/styles/globals.css