Skip to main content

Local development

Setup - Up and running in less than 5 minutesโ€‹

Depending on your preference, you can either use Docker Sail or Laravel Herd to set up a local development environment for Saasykit.

First of all, fork the SaaSykit repository to your GitHub account. You can do this by clicking the "Fork" button on the top right corner of the SaaSykit repository.

Sail is a light-weight command-line interface for interacting with Laravel's default Docker development environment. Sail provides a great starting point for building a Laravel application using PHP, MySQL, and Redis without requiring prior Docker experience. You will need to have Docker installed on your machine to use Sail.

If you prefer to watch a video tutorial, you can watch the below video to get started: (all the commands used in the video are also listed below):

Once you get docker installed on your machine, you can follow the below steps to get started with Saasykit.

  1. Clone the forked SaaSykit repository to your local machine:

    git clone [your-forked-repository-url]
  2. Change into the project directory

    cd [your-forked-repository-name]
  3. Install composer dependencies

    composer install --ignore-platform-reqs --no-interaction --no-scripts --prefer-dist
  4. Copy .env.example to .env

    cp .env.example .env
  5. Open the .env file and make sure that the ports defined under # local development settings are not in use by any other application on your machine. If they are, you can change them to any other port of your choice.

  6. Run the below command to start the docker containers

    ./vendor/bin/sail up -d
  7. Generate app secret

    ./vendor/bin/sail artisan key:generate
  8. Run migrations

    ./vendor/bin/sail artisan migrate
  9. Run seeders

    ./vendor/bin/sail artisan db:seed
  10. Link storage

    ./vendor/bin/sail artisan storage:link
  11. Install npm dependencies

    ./vendor/bin/sail npm install
  12. Build assets

    ./vendor/bin/sail npm run build
  13. Run the NPM (vite) watcher

    ./vendor/bin/sail npm run dev

That's it! ๐ŸŽ‰ Open the browser and go to http://localhost:8080 (or change the port here if you choose another port in .env.). You should see the Saasykit home page.

Creating an Admin Userโ€‹

You can create an admin user by running the below command:

./vendor/bin/sail artisan app:create-admin-user

With that use you can access the admin panel by going to /admin and logging in with the credentials you just created.

Demo dataโ€‹

Saasykit comes with demo data that you can use to test the application and see how things look and work. The demo data includes products, plans, discounts, blog posts, and users, etc.

To install the demo data, you can run the below command:

./vendor/bin/sail artisan db:seed "Database\Seeders\Demo\DemoDatabaseSeeder"

Development Resourcesโ€‹

Saasykit is based on the awesome Laravel framework. If you are new to Laravel, you can check out the Laravel documentation to get started with Laravel.

If you are already familiar with Laravel, you will easily be able to get started with Saasykit as it follows the same coding standards and best practices as Laravel.

The admin panel and user dashboard are built using Filament. Filament is a beautiful, modern, and responsive admin panel for Laravel applications.

Keeping your fork up to dateโ€‹

To keep your fork up to date with the original repository, you can follow the below steps:

  1. Add the original repository as a remote

    git remote add upstream https://github.com/saasykit/saasykit.git
  2. Fetch the branches and commits from the original repository

    git fetch upstream
  3. Merge the changes from the original repository into your local branch

    git merge upstream/main

Then you can push the changes to your forked repository.

tip

It's a good practice to regularly keep your fork up to date with the original repository to get the latest features and bug fixes. This will also help you to avoid/reduce the merge conflicts in case you edited the same files that was updated in the original repository.