Skip to content

Commit af28118

Browse files
committed
feat: initialize local Supabase for Postgres development
Set up local Supabase CLI with custom ports (543xx → 543x2) to avoid conflicts with existing Supabase instance. Local Postgres available at postgresql://postgres:postgres@127.0.0.1:54332/postgres
1 parent 44b4e22 commit af28118

2 files changed

Lines changed: 390 additions & 0 deletions

File tree

supabase/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Supabase
2+
.branches
3+
.temp
4+
5+
# dotenvx
6+
.env.keys
7+
.env.local
8+
.env.*.local

supabase/config.toml

Lines changed: 382 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,382 @@
1+
# For detailed configuration reference documentation, visit:
2+
# https://supabase.com/docs/guides/local-development/cli/config
3+
# A string used to distinguish different Supabase projects on the same host. Defaults to the
4+
# working directory name when running `supabase init`.
5+
project_id = "codebenders-datathon"
6+
7+
[api]
8+
enabled = true
9+
# Port to use for the API URL.
10+
port = 54331
11+
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
12+
# endpoints. `public` and `graphql_public` schemas are included by default.
13+
schemas = ["public", "graphql_public"]
14+
# Extra schemas to add to the search_path of every request.
15+
extra_search_path = ["public", "extensions"]
16+
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
17+
# for accidental or malicious requests.
18+
max_rows = 1000
19+
20+
[api.tls]
21+
# Enable HTTPS endpoints locally using a self-signed certificate.
22+
enabled = false
23+
# Paths to self-signed certificate pair.
24+
# cert_path = "../certs/my-cert.pem"
25+
# key_path = "../certs/my-key.pem"
26+
27+
[db]
28+
# Port to use for the local database URL.
29+
port = 54332
30+
# Port used by db diff command to initialize the shadow database.
31+
shadow_port = 54330
32+
# The database major version to use. This has to be the same as your remote database's. Run `SHOW
33+
# server_version;` on the remote database to check.
34+
major_version = 17
35+
36+
[db.pooler]
37+
enabled = false
38+
# Port to use for the local connection pooler.
39+
port = 54339
40+
# Specifies when a server connection can be reused by other clients.
41+
# Configure one of the supported pooler modes: `transaction`, `session`.
42+
pool_mode = "transaction"
43+
# How many server connections to allow per user/database pair.
44+
default_pool_size = 20
45+
# Maximum number of client connections allowed.
46+
max_client_conn = 100
47+
48+
# [db.vault]
49+
# secret_key = "env(SECRET_VALUE)"
50+
51+
[db.migrations]
52+
# If disabled, migrations will be skipped during a db push or reset.
53+
enabled = true
54+
# Specifies an ordered list of schema files that describe your database.
55+
# Supports glob patterns relative to supabase directory: "./schemas/*.sql"
56+
schema_paths = []
57+
58+
[db.seed]
59+
# If enabled, seeds the database after migrations during a db reset.
60+
enabled = true
61+
# Specifies an ordered list of seed files to load during db reset.
62+
# Supports glob patterns relative to supabase directory: "./seeds/*.sql"
63+
sql_paths = ["./seed.sql"]
64+
65+
[db.network_restrictions]
66+
# Enable management of network restrictions.
67+
enabled = false
68+
# List of IPv4 CIDR blocks allowed to connect to the database.
69+
# Defaults to allow all IPv4 connections. Set empty array to block all IPs.
70+
allowed_cidrs = ["0.0.0.0/0"]
71+
# List of IPv6 CIDR blocks allowed to connect to the database.
72+
# Defaults to allow all IPv6 connections. Set empty array to block all IPs.
73+
allowed_cidrs_v6 = ["::/0"]
74+
75+
[realtime]
76+
enabled = true
77+
# Bind realtime via either IPv4 or IPv6. (default: IPv4)
78+
# ip_version = "IPv6"
79+
# The maximum length in bytes of HTTP request headers. (default: 4096)
80+
# max_header_length = 4096
81+
82+
[studio]
83+
enabled = true
84+
# Port to use for Supabase Studio.
85+
port = 54333
86+
# External URL of the API server that frontend connects to.
87+
api_url = "http://127.0.0.1"
88+
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
89+
openai_api_key = "env(OPENAI_API_KEY)"
90+
91+
# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
92+
# are monitored, and you can view the emails that would have been sent from the web interface.
93+
[inbucket]
94+
enabled = true
95+
# Port to use for the email testing server web interface.
96+
port = 54334
97+
# Uncomment to expose additional ports for testing user applications that send emails.
98+
# smtp_port = 54335
99+
# pop3_port = 54336
100+
# admin_email = "admin@email.com"
101+
# sender_name = "Admin"
102+
103+
[storage]
104+
enabled = true
105+
# The maximum file size allowed (e.g. "5MB", "500KB").
106+
file_size_limit = "50MiB"
107+
108+
# Uncomment to configure local storage buckets
109+
# [storage.buckets.images]
110+
# public = false
111+
# file_size_limit = "50MiB"
112+
# allowed_mime_types = ["image/png", "image/jpeg"]
113+
# objects_path = "./images"
114+
115+
# Allow connections via S3 compatible clients
116+
[storage.s3_protocol]
117+
enabled = true
118+
119+
# Image transformation API is available to Supabase Pro plan.
120+
# [storage.image_transformation]
121+
# enabled = true
122+
123+
# Store analytical data in S3 for running ETL jobs over Iceberg Catalog
124+
# This feature is only available on the hosted platform.
125+
[storage.analytics]
126+
enabled = false
127+
max_namespaces = 5
128+
max_tables = 10
129+
max_catalogs = 2
130+
131+
# Analytics Buckets is available to Supabase Pro plan.
132+
# [storage.analytics.buckets.my-warehouse]
133+
134+
# Store vector embeddings in S3 for large and durable datasets
135+
# This feature is only available on the hosted platform.
136+
[storage.vector]
137+
enabled = false
138+
max_buckets = 10
139+
max_indexes = 5
140+
141+
# Vector Buckets is available to Supabase Pro plan.
142+
# [storage.vector.buckets.documents-openai]
143+
144+
[auth]
145+
enabled = true
146+
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
147+
# in emails.
148+
site_url = "http://127.0.0.1:3000"
149+
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
150+
additional_redirect_urls = ["https://127.0.0.1:3000"]
151+
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week).
152+
jwt_expiry = 3600
153+
# JWT issuer URL. If not set, defaults to the local API URL (http://127.0.0.1:<port>/auth/v1).
154+
# jwt_issuer = ""
155+
# Path to JWT signing key. DO NOT commit your signing keys file to git.
156+
# signing_keys_path = "./signing_keys.json"
157+
# If disabled, the refresh token will never expire.
158+
enable_refresh_token_rotation = true
159+
# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds.
160+
# Requires enable_refresh_token_rotation = true.
161+
refresh_token_reuse_interval = 10
162+
# Allow/disallow new user signups to your project.
163+
enable_signup = true
164+
# Allow/disallow anonymous sign-ins to your project.
165+
enable_anonymous_sign_ins = false
166+
# Allow/disallow testing manual linking of accounts
167+
enable_manual_linking = false
168+
# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more.
169+
minimum_password_length = 6
170+
# Passwords that do not meet the following requirements will be rejected as weak. Supported values
171+
# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols`
172+
password_requirements = ""
173+
174+
[auth.rate_limit]
175+
# Number of emails that can be sent per hour. Requires auth.email.smtp to be enabled.
176+
email_sent = 2
177+
# Number of SMS messages that can be sent per hour. Requires auth.sms to be enabled.
178+
sms_sent = 30
179+
# Number of anonymous sign-ins that can be made per hour per IP address. Requires enable_anonymous_sign_ins = true.
180+
anonymous_users = 30
181+
# Number of sessions that can be refreshed in a 5 minute interval per IP address.
182+
token_refresh = 150
183+
# Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address (excludes anonymous users).
184+
sign_in_sign_ups = 30
185+
# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address.
186+
token_verifications = 30
187+
# Number of Web3 logins that can be made in a 5 minute interval per IP address.
188+
web3 = 30
189+
190+
# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`.
191+
# [auth.captcha]
192+
# enabled = true
193+
# provider = "hcaptcha"
194+
# secret = ""
195+
196+
[auth.email]
197+
# Allow/disallow new user signups via email to your project.
198+
enable_signup = true
199+
# If enabled, a user will be required to confirm any email change on both the old, and new email
200+
# addresses. If disabled, only the new email is required to confirm.
201+
double_confirm_changes = true
202+
# If enabled, users need to confirm their email address before signing in.
203+
enable_confirmations = false
204+
# If enabled, users will need to reauthenticate or have logged in recently to change their password.
205+
secure_password_change = false
206+
# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email.
207+
max_frequency = "1s"
208+
# Number of characters used in the email OTP.
209+
otp_length = 6
210+
# Number of seconds before the email OTP expires (defaults to 1 hour).
211+
otp_expiry = 3600
212+
213+
# Use a production-ready SMTP server
214+
# [auth.email.smtp]
215+
# enabled = true
216+
# host = "smtp.sendgrid.net"
217+
# port = 587
218+
# user = "apikey"
219+
# pass = "env(SENDGRID_API_KEY)"
220+
# admin_email = "admin@email.com"
221+
# sender_name = "Admin"
222+
223+
# Uncomment to customize email template
224+
# [auth.email.template.invite]
225+
# subject = "You have been invited"
226+
# content_path = "./supabase/templates/invite.html"
227+
228+
# Uncomment to customize notification email template
229+
# [auth.email.notification.password_changed]
230+
# enabled = true
231+
# subject = "Your password has been changed"
232+
# content_path = "./templates/password_changed_notification.html"
233+
234+
[auth.sms]
235+
# Allow/disallow new user signups via SMS to your project.
236+
enable_signup = false
237+
# If enabled, users need to confirm their phone number before signing in.
238+
enable_confirmations = false
239+
# Template for sending OTP to users
240+
template = "Your code is {{ .Code }}"
241+
# Controls the minimum amount of time that must pass before sending another sms otp.
242+
max_frequency = "5s"
243+
244+
# Use pre-defined map of phone number to OTP for testing.
245+
# [auth.sms.test_otp]
246+
# 4152127777 = "123456"
247+
248+
# Configure logged in session timeouts.
249+
# [auth.sessions]
250+
# Force log out after the specified duration.
251+
# timebox = "24h"
252+
# Force log out if the user has been inactive longer than the specified duration.
253+
# inactivity_timeout = "8h"
254+
255+
# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object.
256+
# [auth.hook.before_user_created]
257+
# enabled = true
258+
# uri = "pg-functions://postgres/auth/before-user-created-hook"
259+
260+
# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used.
261+
# [auth.hook.custom_access_token]
262+
# enabled = true
263+
# uri = "pg-functions://<database>/<schema>/<hook_name>"
264+
265+
# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`.
266+
[auth.sms.twilio]
267+
enabled = false
268+
account_sid = ""
269+
message_service_sid = ""
270+
# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead:
271+
auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)"
272+
273+
# Multi-factor-authentication is available to Supabase Pro plan.
274+
[auth.mfa]
275+
# Control how many MFA factors can be enrolled at once per user.
276+
max_enrolled_factors = 10
277+
278+
# Control MFA via App Authenticator (TOTP)
279+
[auth.mfa.totp]
280+
enroll_enabled = false
281+
verify_enabled = false
282+
283+
# Configure MFA via Phone Messaging
284+
[auth.mfa.phone]
285+
enroll_enabled = false
286+
verify_enabled = false
287+
otp_length = 6
288+
template = "Your code is {{ .Code }}"
289+
max_frequency = "5s"
290+
291+
# Configure MFA via WebAuthn
292+
# [auth.mfa.web_authn]
293+
# enroll_enabled = true
294+
# verify_enabled = true
295+
296+
# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
297+
# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`,
298+
# `twitter`, `slack`, `spotify`, `workos`, `zoom`.
299+
[auth.external.apple]
300+
enabled = false
301+
client_id = ""
302+
# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead:
303+
secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"
304+
# Overrides the default auth redirectUrl.
305+
redirect_uri = ""
306+
# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
307+
# or any other third-party OIDC providers.
308+
url = ""
309+
# If enabled, the nonce check will be skipped. Required for local sign in with Google auth.
310+
skip_nonce_check = false
311+
# If enabled, it will allow the user to successfully authenticate when the provider does not return an email address.
312+
email_optional = false
313+
314+
# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard.
315+
# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting.
316+
[auth.web3.solana]
317+
enabled = false
318+
319+
# Use Firebase Auth as a third-party provider alongside Supabase Auth.
320+
[auth.third_party.firebase]
321+
enabled = false
322+
# project_id = "my-firebase-project"
323+
324+
# Use Auth0 as a third-party provider alongside Supabase Auth.
325+
[auth.third_party.auth0]
326+
enabled = false
327+
# tenant = "my-auth0-tenant"
328+
# tenant_region = "us"
329+
330+
# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth.
331+
[auth.third_party.aws_cognito]
332+
enabled = false
333+
# user_pool_id = "my-user-pool-id"
334+
# user_pool_region = "us-east-1"
335+
336+
# Use Clerk as a third-party provider alongside Supabase Auth.
337+
[auth.third_party.clerk]
338+
enabled = false
339+
# Obtain from https://clerk.com/setup/supabase
340+
# domain = "example.clerk.accounts.dev"
341+
342+
# OAuth server configuration
343+
[auth.oauth_server]
344+
# Enable OAuth server functionality
345+
enabled = false
346+
# Path for OAuth consent flow UI
347+
authorization_url_path = "/oauth/consent"
348+
# Allow dynamic client registration
349+
allow_dynamic_registration = false
350+
351+
[edge_runtime]
352+
enabled = true
353+
# Supported request policies: `oneshot`, `per_worker`.
354+
# `per_worker` (default) — enables hot reload during local development.
355+
# `oneshot` — fallback mode if hot reload causes issues (e.g. in large repos or with symlinks).
356+
policy = "per_worker"
357+
# Port to attach the Chrome inspector for debugging edge functions.
358+
inspector_port = 8083
359+
# The Deno major version to use.
360+
deno_version = 2
361+
362+
# [edge_runtime.secrets]
363+
# secret_key = "env(SECRET_VALUE)"
364+
365+
[analytics]
366+
enabled = true
367+
port = 54337
368+
# Configure one of the supported backends: `postgres`, `bigquery`.
369+
backend = "postgres"
370+
371+
# Experimental features may be deprecated any time
372+
[experimental]
373+
# Configures Postgres storage engine to use OrioleDB (S3)
374+
orioledb_version = ""
375+
# Configures S3 bucket URL, eg. <bucket_name>.s3-<region>.amazonaws.com
376+
s3_host = "env(S3_HOST)"
377+
# Configures S3 bucket region, eg. us-east-1
378+
s3_region = "env(S3_REGION)"
379+
# Configures AWS_ACCESS_KEY_ID for S3 bucket
380+
s3_access_key = "env(S3_ACCESS_KEY)"
381+
# Configures AWS_SECRET_ACCESS_KEY for S3 bucket
382+
s3_secret_key = "env(S3_SECRET_KEY)"

0 commit comments

Comments
 (0)