Updating the Codebase
How to keep your MkSaaS project up to date with the latest changes
MkSaaS is 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, so please be patient. This is because updates involve rebasing your custom code on top of the latest MkSaaS template 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
Method 1: Using Git (Recommended)
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/MkSaaSHQ/mksaas-template.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/mainOption 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/MkSaaSHQ/mksaas-template.git
# Fetch latest changes and rebase
git pull upstream main --rebaseIf 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:
- Download the latest version of MkSaaS
- Compare your customized files with the new version
- Apply changes selectively, focusing on:
package.jsonfor dependency updates- Configuration files like
next.config.js - Database schema updates in
src/db/schema.ts
Dependency Updates
To install new dependencies:
pnpm installnpm installyarn installbun installDatabase Schema Updates
When updates include database schema changes:
- Check the schema changes in the
src/db/schema.tsfile - Generate migration files:
pnpm run db:generatenpm run db:generateyarn db:generatebun run db:generate- Apply migrations to the database with:
pnpm run db:migratenpm run db:migrateyarn db:migratebun run db:migrateTesting After Updates
After updating, thoroughly test your application:
- Run the development server:
pnpm run devnpm run devyarn devbun run dev- Check for console errors
- Test critical user flows
- Run linting and formatting:
pnpm run lint
pnpm run formatnpm run lint
npm run formatyarn lint
yarn formatbun run lint
bun run format- Check build:
pnpm run buildnpm run buildyarn buildbun run buildKeeping Up with Changes
To stay informed about updates:
- Watch the GitHub repository
- Check the Roadmap regularly
- Join the Discord community
- Follow MkSaaS on Twitter/X and other social platforms
Video Tutorial
Next Steps
Now that you understand how to keep your MkSaaS project up to date, explore these related topics:
MkSaaS Docs