Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
55 lines
2.8 KiB
Plaintext
55 lines
2.8 KiB
Plaintext
---
|
|
status: "published"
|
|
title: "Migrating from Makerkit v1 to Next.js Supabase"
|
|
label: "Migrating from v1"
|
|
order: 9
|
|
description: "Guidelines for migrating from Makerkit v1 to Next.js SaaS Boilerplate."
|
|
---
|
|
|
|
🚀 Welcome to your journey from Makerkit v1 to the Next.js SaaS Boilerplate!
|
|
|
|
This guide is designed to help you understand the changes between the two versions and navigate your project migration to the new v2. Whether you're a seasoned developer or just starting out, we've got you covered!
|
|
|
|
Here's a roadmap of the steps you'll take:
|
|
|
|
1. **Bootstrap a new project**: Kickstart a new project using the Next.js SaaS Boilerplate 🎉
|
|
2. **Update Schema**: Tweak the Postgres schema foreign key references, and integrate your existing tables 🧩
|
|
3. **Move files from older app**: Transport your files to the new app structure 📦
|
|
4. **Update imports to existing files**: Refresh imports to align with the new file structure 🔄
|
|
5. **Update configuration**: Modify the configuration files to match the new schemas ⚙️
|
|
|
|
## 1. Bootstrap a new project
|
|
|
|
The Next.js SaaS Boilerplate is a fresh take on Makerkit v1. You'll need to create a new project using this innovative boilerplate. Follow the [installation guide](clone-repository) to get your new project up and running in no time!
|
|
|
|
## 2. Update Schema
|
|
|
|
The schema in the Next.js SaaS Boilerplate has evolved significantly from Makerkit v1. You'll need to update your Postgres schema to match the new one.
|
|
|
|
Previously, you'd have a foreign key set to the organization ID:
|
|
|
|
```sql
|
|
organization_id bigint not null references organizations(id) on delete cascade,
|
|
```
|
|
|
|
Now, you'll have a foreign key set to the account ID as a UUID:
|
|
|
|
```sql
|
|
account_id uuid not null references public.accounts(id) on delete cascade,
|
|
```
|
|
|
|
In v2, an account can be both a user or an organization. So, instead of referencing the organization ID as in v1, you'll now reference the account ID.
|
|
|
|
## 3. Move files from older app
|
|
|
|
You have the flexibility to add these files to either the "user scope" (`/home`) or the "account scope" (`/home/[account]`). Note that in v3, all routes live under the `[locale]` segment (e.g., `app/[locale]/home/[account]/`). Choose the one that best suits your project needs.
|
|
|
|
## 4. Update imports to existing files
|
|
|
|
You'll need to update the imports to your existing files to match the new file structure. This applies to all the components and utilities that you imported from Makerkit. For instance, a button previously imported from `~/core/ui/Button`, will now be imported from `@kit/ui/button`.
|
|
|
|
## 5. Update configuration
|
|
|
|
Lastly, you'll need to update the configuration files to match the new schemas. The configuration is now split across various files at `apps/web/config`. Pay special attention to the billing schema, which is now more versatile (and a bit more complex).
|
|
|
|
Ready to get started? Let's dive in! 🏊♀️ |