🔄מודול 7 | מעבר ל-Supabase שלכם

מ-Base44 ל-Supabase שלכם

מייצאים את הקוד והנתונים מ-Base44, ובונים מחדש את מסד הנתונים ב-Supabase שלכם עם Claude Code

🤔רגע, מה הבעיה?

🟢
Supabase שלכם
הפרויקט שפתחתם
ריק לגמרי
אין טבלאות, אין כלום
➡️
🟡
Base44 Cloud
ה-backend המנוהל של Base44
Entities, Auth, RLS, Integrations
הכל מנוהל בשבילכם
ב-Base44 ה-backend כולו מנוהל בשבילכם - מסד נתונים, אימות משתמשים, RLS ואינטגרציות.
אבל כשרוצים לעבור ל-Supabase שלכם - צריך לייצא את הקוד והנתונים, ולבנות את הסכמה מחדש

הפתרון: ייצוא + בנייה מחדש

כמו להעתיק את התוכניות של הבית - ואז לבנות אותו מחדש במקום חדש

🔶 שלב 2
🚀

בנייה מחדש עם Claude Code

Claude Code קורא את קבצי ה-entity, בונה את הסכמה וה-RLS ב-Supabase, ומייבא את ה-CSVs

➡️
🟡 שלב 1
📦

ייצוא מ-Base44

מסנכרנים את הקוד ל-GitHub ומייצאים את הנתונים כ-CSV לכל entity

📋מה בדיוק עובר?

🗄️

Tables

כל entity הופך לטבלה עם העמודות והסוגים שלו

🔒

RLS Policies

מדיניות האבטחה מתורגמת מקבצי ה-jsonc ל-SQL

📊

הנתונים

כל הרשומות מגיעות כ-CSV ומיובאות לטבלאות

Edge Functions

backend functions הופכות ל-Supabase Functions

👥

Auth

משתמשים עוברים ל-Supabase Auth (ידנית)

💻

קוד האפליקציה

ה-React שלכם מתסנכרן ל-GitHub ונשאר שלכם

🗺️הזרימה המלאה

1
🟡 Base44

מסנכרנים את הקוד ל-GitHub

Dashboard - לוחצים על סמל GitHub ומחברים ריפו. כל קבצי ה-entity והפונקציות יורדים אליכם

2
🟡 Base44

מייצאים נתונים כ-CSV

Dashboard - Data - בוחרים entity - More Actions - Export. חוזרים על זה לכל entity שיש בה נתונים

3
🧑‍💻 אתם

מכינים את התיקייה

git pull, ומניחים את כל קובצי ה-CSV בתיקיית data/ בתוך הפרויקט

4
🔶 Claude Code

שולחים את הפרומפט למטה

Claude Code קורא את קבצי ה-entity, בונה טבלאות + RLS + Edge Functions, ומייבא את ה-CSVs ל-Supabase שלכם

5
🧑‍💻 אתם

בודקים ב-Dashboard

נכנסים ל-Supabase Dashboard ורואים שהטבלאות, ה-Policies והנתונים נוצרו

🔶הפרומפט ל-Claude Code

אחרי שייצאתם קוד ו-CSVs - שולחים את זה ל-Claude Code והוא בונה הכל ב-Supabase שלכם

1
ודאו שהקוד מסונכרן - ושקבצי ה-entity נמצאים ב-base44/entities וה-CSVs בתיקיית data/
2
הכינו את פרטי Supabase - Project URL ו-DB Password מ-Supabase Dashboard - Settings - Database
3
העתיקו את הפרומפט למטה - ושלחו אותו ב-Claude Code
📋Claude Code Migration Prompt (Base44 - Supabase)
I built my app with Base44 and I want to migrate to my own Supabase project so I fully own the database. ## What I already have in this repo (exported from Base44): - Entity schema files in `base44/entities/*.jsonc` - each defines a table's fields, types, and RLS rules - Backend functions in `base44/functions/` (if any business logic exists) - CSV exports of my data (one file per entity), saved in a `data/` folder - downloaded from Base44 Dashboard -> Data -> Export ## What I need you to do: ### 1. Generate the Supabase tables schema - Read every file in `base44/entities/*.jsonc` - For each entity, create a PostgreSQL table that matches its fields and types (string -> text, number -> numeric, boolean -> boolean, date -> timestamptz, etc.) - Include the built-in columns on every table: id (uuid primary key), created_date, updated_date, created_by_id - Mark required fields as NOT NULL, apply defaults where the schema defines them - Output as `supabase/migrations/001_tables.sql` ### 2. Generate RLS policies - For each entity, read its `rls` config (read / create / update / delete rules) - Translate every rule into PostgreSQL RLS policies - ENABLE ROW LEVEL SECURITY on every table - Map role-based rules (e.g. role = "admin") and ownership rules (created_by_id = auth.uid()) - Output as `supabase/migrations/002_rls.sql` ### 3. Re-implement backend functions (if any) - Check `base44/functions/` for functions that hold business logic - Re-implement pure DB logic as SQL functions/triggers, and HTTP-style logic as Supabase Edge Functions in `supabase/functions/` ### 4. Run the migrations on my Supabase - Apply 001_tables.sql and then 002_rls.sql to my Supabase project (use the connection string below) - Create any storage buckets the app needs (if file uploads are used) ### 5. Import the data - For each CSV in `data/`, import it into the matching table (using \copy or the Supabase import tool) - Make sure created_by_id and foreign-key columns map correctly ### 6. Verify - List the created tables, confirm RLS is enabled on each, and confirm row counts match the CSVs ## My Supabase credentials: - Project URL: [REPLACE_WITH_YOUR_PROJECT_URL] - DB Password: [REPLACE_WITH_YOUR_DB_PASSWORD] Start by listing all entity files and showing me the planned tables BEFORE executing anything.
⚠️
חשוב! החליפו את [REPLACE_WITH_YOUR_PROJECT_URL] ו-[REPLACE_WITH_YOUR_DB_PASSWORD] בפרטים שלכם מ-Supabase Dashboard - Settings - Database
💡
איך מייצאים מ-Base44?
קוד: Dashboard - סמל GitHub - Connect to GitHub, ואז git pull.
נתונים: Dashboard - Data - בוחרים entity - More Actions - Export (מקבלים CSV).
בסוף התהליך: Claude Code יראה לכם את רשימת הטבלאות שנוצרו, יאמת ש-RLS מופעל, וישווה את כמויות השורות מול ה-CSVs. היכנסו ל-Supabase Dashboard וודאו שהכל שם!

צ'קליסט אחרי המעבר ✅

תבדקו שהכל עבר כמו שצריך

כל הטבלאות (מקבצי ה-entity) נוצרו ב-Supabase
RLS מופעל על כל הטבלאות וה-policies תואמים ל-jsonc
הנתונים יובאו - כמות השורות תואמת ל-CSVs
Edge Functions deployed (אם היו backend functions)
משתמשים הוגדרו מחדש ב-Supabase Auth
עדכנתם את ה-ENV באפליקציה לכיוון Supabase החדש