Make memes fast: pick a template, add your caption, and send it to friends instantly.
- Flutter installed
- Supabase CLI installed
- NodeJS installed
This project uses an incremental declarative schema workflow for the public schema:
- Declarative source of truth:
supabase/schemas/*.sql - Existing
supabase/migrations/*.sqlremain unchanged (no history rewrite / squash) - New schema changes should be generated as versioned migrations
Current schema file order is configured in supabase/config.toml:
./schemas/00_extensions.sql./schemas/10_types.sql./schemas/20_tables.sql./schemas/30_indexes.sql./schemas/40_functions.sql./schemas/50_triggers.sql./schemas/60_rls_policies.sql
- Edit the relevant file(s) in
supabase/schemas/. - Generate a migration from the declarative diff:
supabase db diff --local --schema public -f <migration_name>- Review the generated file in
supabase/migrations/.
Do not rely on declarative schema_paths for these:
- DML and backfills (
INSERT,UPDATE,DELETE) cron.schedule(...)alter publication ...storage.bucketsrowsgrant/revokeandcomment on
-
.env.development.example->.env.development -
.env.staging.example->.env.staging -
.env.production.example->.env.production -
supabase/.env.local.example->supabase/.env.local -
meme_templates/.env.development.example->meme_templates/.env.development -
meme_templates/.env.staging.example->meme_templates/.env.staging -
meme_templates/.env.production.example->meme_templates/.env.production
Navigate into supabase/config.toml and update your local LAN IP in:
auth.additional_redirect_urls
supabase startThe migration creates helper public.upsert_vault_secret(...) and manages triggers + cron schedules.
Set environment-specific values after migrations are applied:
Run these statements as the project owner role (SQL Editor / migration role).
select public.upsert_vault_secret(
'edge_functions_base_url',
'http://host.docker.internal:54321',
'Local base URL for internal DB->Edge calls'
);
select public.upsert_vault_secret(
'edge_functions_apikey',
'<LOCAL_SB_SECRET_KEY>',
'Local machine apikey used by webhook/cron invocations'
);supabase functions serve --env-file supabase/.env.localEnsure .env.development contains:
LEGAL_BASE_URL=http://<YOUR-LAN-IP>:8080/development/legal
Build the legal site:
legal/scripts/build_legal_site.shServe the generated static files on all interfaces:
cd legal/dist
python3 -m http.server 8080 --bind 0.0.0.0Use the same LAN IP in LEGAL_BASE_URL so emulators and real devices can reach the host machine.
flutter pub getdart run build_runner build --delete-conflicting-outputsflutter gen-l10nflutter run --flavor development --dart-define-from-file=.env.developmentSet secrets per project (staging and production each separately):
- SB_PUBLISHABLE_KEY: <SB_PUBLISHABLE_KEY>
- SB_SECRET_KEY: <SB_SECRET_KEY>
- FIREBASE_SERVICE_ACCOUNT_JSON: <ONE_LINE_JSON>
- LEGAL_CALLBACK_BASE_URL:
Run as project owner role (SQL Editor / migration role):
select public.upsert_vault_secret(
'edge_functions_base_url',
'https://<PROJECT_REF>.supabase.co',
'Hosted base URL for internal DB->Edge calls'
);
select public.upsert_vault_secret(
'edge_functions_apikey',
'<SB_SECRET_KEY>',
'Hosted machine apikey used by webhook/cron invocations'
);