LogoMkSaaS Docs

Updating the Codebase

How to keep your MkSaaS project up to date with the latest changes

MkSaaS is actively maintained and regularly updated with new features, bug fixes, and security patches. This guide explains how to update your project to the latest version.

While updating your codebase to the latest version is possible, it's important to note that the more customizations you make to your application, the more complex the update process becomes. This is because updates involve rebasing your custom code on top of the latest MkSaaS code using Git, which may require resolving merge conflicts and careful handling to preserve your customizations.

Before updating your codebase, ensure your Git repository is clean with no uncommitted changes.

Update Process

If you started your project using the Git repository, you can pull updates directly. There are two approaches:

Option A: Merge Approach (Safer)

Choose this option if you want a safer update process with clear merge points.

# Add the upstream remote if you haven't already
git remote add upstream https://github.com/mksaas/mksaas.git
 
# Fetch the latest changes
git fetch upstream
 
# Create a new branch for the update
git checkout -b update-mksaas
 
# Merge the changes (resolve conflicts if necessary)
git merge upstream/main

Option B: Rebase Approach (Cleaner History)

Choose this option if you prefer a linear history. This approach is more advanced and may require more Git experience to resolve conflicts.

# Add the upstream remote if you haven't already
git remote add upstream https://github.com/mksaas/mksaas.git
 
# Fetch latest changes and rebase
git pull upstream main --rebase

If you have any merge conflicts, you will have to resolve them manually. If you are not sure how to do this, please refer to the Git documentation.

Method 2: Manual Update

If you prefer to update manually or didn't use Git:

  1. Download the latest version of MkSaaS
  2. Compare your customized files with the new version
  3. Apply changes selectively, focusing on:
    • package.json for dependency updates
    • Configuration files like next.config.js
    • Core functionality in src/lib and src/components directories

Dependency Updates

To update only the dependencies:

# Update all dependencies to their latest versions
pnpm update
 
# Update a specific dependency
pnpm update next
 
# Update to specific versions
pnpm add next@latest

For major dependency updates, check compatibility first:

# Check for major updates
pnpm dlx npm-check-updates
 
# Apply major updates (use with caution)
pnpm dlx npm-check-updates -u
pnpm install

Database Schema Updates

When updates include database schema changes:

  1. Check the migration files in the drizzle directory
  2. Apply migrations with:
pnpm run db:migrate

Testing After Updates

After updating, thoroughly test your application:

  1. Run the development server:
pnpm run dev
  1. Check for console errors
  2. Test critical user flows
  3. Run linting and formatting:
pnpm run lint
pnpm run format
  1. Check build:
pnpm run build

Keeping Up with Changes

To stay informed about updates:

  1. Watch the GitHub repository
  2. Check the changelog regularly
  3. Join the Discord community
  4. Follow MkSaaS on Twitter/X and other social platforms

Next Steps

Now that you understand how to keep your MkSaaS project up to date, explore these related topics:

Table of Contents