Skip to content

Commit ba39cfe

Browse files
committed
basic setup
1 parent 4103995 commit ba39cfe

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+6893
-4975
lines changed

supabase/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Supabase
2+
.branches
3+
.temp

supabase/config.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

supabase/config.toml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# A string used to distinguish different Supabase projects on the same host. Defaults to the working
2+
# directory name when running `supabase init`.
3+
project_id = "dbdev"
4+
5+
[api]
6+
# Port to use for the API URL.
7+
port = 54321
8+
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
9+
# endpoints. public and storage are always included.
10+
schemas = ["public", "storage", "graphql_public"]
11+
# Extra schemas to add to the search_path of every request. public is always included.
12+
extra_search_path = ["public", "extensions"]
13+
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
14+
# for accidental or malicious requests.
15+
max_rows = 1000
16+
17+
[db]
18+
# Port to use for the local database URL.
19+
port = 54322
20+
# The database major version to use. This has to be the same as your remote database's. Run `SHOW
21+
# server_version;` on the remote database to check.
22+
major_version = 15
23+
24+
[studio]
25+
# Port to use for Supabase Studio.
26+
port = 54323
27+
28+
# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
29+
# are monitored, and you can view the emails that would have been sent from the web interface.
30+
[inbucket]
31+
# Port to use for the email testing server web interface.
32+
port = 54324
33+
smtp_port = 54325
34+
pop3_port = 54326
35+
36+
[storage]
37+
# The maximum file size allowed (e.g. "5MB", "500KB").
38+
file_size_limit = "50MiB"
39+
40+
[auth]
41+
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
42+
# in emails.
43+
site_url = "http://localhost:3000"
44+
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
45+
additional_redirect_urls = ["https://localhost:3000"]
46+
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 seconds (one
47+
# week).
48+
jwt_expiry = 3600
49+
# Allow/disallow new user signups to your project.
50+
enable_signup = true
51+
52+
[auth.email]
53+
# Allow/disallow new user signups via email to your project.
54+
enable_signup = true
55+
# If enabled, a user will be required to confirm any email change on both the old, and new email
56+
# addresses. If disabled, only the new email is required to confirm.
57+
double_confirm_changes = true
58+
# If enabled, users need to confirm their email address before signing in.
59+
enable_confirmations = false
60+
61+
# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
62+
# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin`, `notion`, `twitch`,
63+
# `twitter`, `slack`, `spotify`, `workos`, `zoom`.
64+
[auth.external.apple]
65+
enabled = false
66+
client_id = ""
67+
secret = ""
68+
# Overrides the default auth redirectUrl.
69+
redirect_uri = ""
70+
# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
71+
# or any other third-party OIDC providers.
72+
url = ""

supabase/migrations/20220117141357_extensions.sql

Lines changed: 0 additions & 1 deletion
This file was deleted.

supabase/migrations/20220117142104_account_and_org_tables.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ create table app.handle_registry(
88
*/
99
handle app.valid_name primary key not null,
1010
is_organization boolean not null,
11-
created_at timestamp not null default (now() at time zone 'utc'),
11+
created_at timestamptz not null default now(),
1212
unique (handle, is_organization)
1313
);
1414

@@ -18,10 +18,10 @@ create table app.accounts(
1818
handle app.valid_name not null unique,
1919
is_organization boolean generated always as (false) stored,
2020
avatar_id uuid references storage.objects(id),
21-
display_name varchar(128),
22-
bio varchar(512),
21+
display_name text check (length(display_name) <= 128),
22+
bio text check (length(bio) <= 512),
2323
contact_email app.email_address,
24-
created_at timestamp not null default (now() at time zone 'utc'),
24+
created_at timestamptz not null default now(),
2525

2626
constraint fk_handle_registry
2727
foreign key (handle, is_organization)
@@ -61,11 +61,11 @@ create table app.organizations(
6161
handle app.valid_name not null unique,
6262
is_organization boolean generated always as (true) stored,
6363
avatar_id uuid references storage.objects(id),
64-
display_name varchar(128),
65-
bio varchar(512),
64+
display_name text check (length(display_name) <= 128),
65+
bio text check (length(bio) <= 512),
6666
contact_email app.email_address,
6767
-- enforced so organization always have at least 1 admin member
68-
created_at timestamp not null default (now() at time zone 'utc'),
68+
created_at timestamptz not null default now(),
6969

7070
constraint fk_handle_registry
7171
foreign key (handle, is_organization)
@@ -79,7 +79,7 @@ create table app.members(
7979
organization_id uuid not null references app.organizations(id),
8080
account_id uuid not null references app.accounts(id),
8181
role app.membership_role not null,
82-
created_at timestamp not null default (now() at time zone 'utc'),
82+
created_at timestamptz not null default now(),
8383
unique (organization_id, account_id)
8484
);
8585

supabase/migrations/20220117142137_package_tables.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ create table app.packages(
22
id uuid primary key default uuid_generate_v4(),
33
partial_name app.valid_name not null, -- ex: math
44
handle app.valid_name not null references app.handle_registry(handle),
5-
created_at timestamp not null default (now() at time zone 'utc'),
5+
created_at timestamptz not null default now(),
66
-- website?
77
-- description in markdown?
88
unique (handle, partial_name)
@@ -21,8 +21,8 @@ create table app.package_versions(
2121
yanked versions are ignored during dependency resolution
2222
unless the yanked version is the only version satisfying the version requirements
2323
*/
24-
yanked_at timestamp,
25-
created_at timestamp not null default (now() at time zone 'utc'),
24+
yanked_at timestamptz,
25+
created_at timestamptz not null default now(),
2626
unique(package_id, semver)
2727
);
2828
create index package_versions_semver_text on app.package_versions (app.semver_to_text(semver));
@@ -35,7 +35,7 @@ create table app.package_version_dependencies(
3535
depends_on_package_id uuid not null references app.packages(id),
3636
depends_on_operator app.version_operator not null,
3737
depends_on_version app.semver not null,
38-
created_at timestamp not null default (now() at time zone 'utc'),
38+
created_at timestamptz not null default now(),
3939
unique(package_version_id, depends_on_package_id, depends_on_operator)
4040
);
4141

supabase/migrations/20220117155719_v0_schema.sql

Lines changed: 0 additions & 8 deletions
This file was deleted.

supabase/migrations/20220117155720_v0_views.sql renamed to supabase/migrations/20220117155720_views.sql

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
--create view v0.accounts as
21
create view public.accounts as
32
select
43
id,
@@ -12,7 +11,6 @@ create view public.accounts as
1211
app.accounts;
1312

1413

15-
--create view v0.organizations as
1614
create view public.organizations as
1715
select
1816
org.id,
@@ -26,7 +24,6 @@ create view public.organizations as
2624
app.organizations org;
2725

2826

29-
--create view v0.members as
3027
create view public.members as
3128
select
3229
aio.organization_id,
@@ -37,8 +34,6 @@ create view public.members as
3734
app.members aio;
3835

3936

40-
41-
--create view v0.packages as
4237
create view public.packages as
4338
select
4439
pa.id,
@@ -55,7 +50,6 @@ create view public.packages as
5550
pa.created_at;
5651

5752

58-
--create view v0.package_versions as
5953
create view public.package_versions as
6054
select
6155
pv.id,

website/.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
NEXT_PUBLIC_SUPABASE_URL=""
2+
NEXT_PUBLIC_SUPABASE_ANON_KEY=""

0 commit comments

Comments
 (0)