# Welcome

Hey 👋

Welcome to Launch Stack!

Thank you for purchasing the Launch Stack, it's really important to me!

The documentation has four main sections:

* Backend (Laravel)
* Frontend (Vue)
* App (Frontend of your app)
* Admin (Administration Panel)

If you're new to LaunchStack, start with Get [Started Section](/get-started), after you got the development environment running you can jump to the next sections.


# Get Started

The first thing it's check if already have access to Github Repository, after getting access you need to choose the repository for your use case:

**launchstack-stripe** or **launchstack-paddle**

### **Clone the Release**

<mark style="color:red;">That's an important step, don't clone the repository directly, use the Releases Tab on Github and clone the last.</mark>

**Let's generate our application key:**

```
sail artisan key:generate
```

**Run the migration**

```
php artisan migrate:fresh --seed
```

You will need run migration free with seed because LaunchStack depends on some data like languages, timezones and etc.

#### .Env

Inside the root project folder exist three .env examples:

* .env.example (default)
* .env.docker.example (for use with docker)
* .env.dusk.local.example (to run dusk tests locally)

Copy the correct env file example to your project root as .env and update it with your credentials.

**You can run the Launch stack on your machine in many ways:**

* Running native PHP locally, similar to Laravel Valet
* Running a virtual machine, like a Laravel Homestead
* Running a Docker (Recommended)

#### Docker Support

LaunchStack comes with support Docker Support as default, it's backed by [Laravel Sail](https://laravel.com/docs/master/sail).

To run the Launch Stack with docker, the first time you need to run the command below to install all dependencies

```
docker run --rm \
    -u "$(id -u):$(id -g)" \
    -v "$(pwd):/var/www/html" \
    -w /var/www/html \
    laravelsail/php82-composer:latest \
    composer install --ignore-platform-reqs
```

After you download all docker imagens, you need up the containers:

```
sail up -d
```

With your docker up, you can run commands like:

```
sail npm install && sail npm run dev
```

```
sail artisan make:migration create_your_table
```


# Stack

I'm really passionate about the laravel ecosystem, then our stack cannot be different.

* [Laravel](https://laravel.com)
* [Inertiajs](https://inertiajs.com/)
* [Tailwind](https://tailwindcss.com)
* [Vue 3](https://vuejs.org/)
* [Heroicons](https://heroicons.com/)
* [Stripe](https://stripe.com/)
* [Paddle](https://www.paddle.com/)
* [Chart.js](https://www.chartjs.org/)
* [Postgres](https://www.postgresql.org/)
* [MySQL](https://www.mysql.com/)


# Updates

The Launch Stack is regularly maintained with consistent updates, including new features and bug fixes.

Updates are delivered in the private github repository.

It's recommended to integrate the Github repository into your workflow so that you can easily merge updates into your modified codebase.

### Releases

{% hint style="warning" %}
We recommend only using releases, do not start your project using any branch like main, development and etc.

Only use stable releases allowed in Github.
{% endhint %}


# Introduction

The LaunchStack backend it's provided by Laravel Framework, and comes with all the required things.


# Application Structure

If you are familiar with Laravel, you won't have problems, because I don't like changing the default structure powered by the core team.

* The Root Directory
  * The `app` Directory
  * The `bootstrap` Directory
  * The `config` Directory
  * The `database` Directory
  * The `public` Directory
  * The `resources` Directory
  * The `routes` Directory
  * The `storage` Directory
  * The `tests` Directory
  * The `vendor` Directory
* The App Directory
  * The `Broadcasting` Directory
  * The `Console` Directory
  * The `Enums` Directory
  * The `Events` Directory
  * The `Exceptions` Directory
  * The `Http` Directory
  * The `Jobs` Directory
  * The `Listeners` Directory
  * The `Mail` Directory
  * The `Models` Directory
  * The `Notifications` Directory
  * The `Policies` Directory
  * The `Providers` Directory
  * The `Rules` Directory


# Config


# API


# Authentication

The LaunchStack supports two ways of Authentication:

* [Email and Password](/backend/authentication/email-and-password) (enabled by default)
* [Social Login](/backend/authentication/social-login)


# Email and Password

Don't worry about the email and password authentication methods, it's enabled by default in LaunchStack.


# Social Login

The Social login is not enabled by default, but you can easily enable it.

1. Enable your social providers on config/launchstack.app
2. Add your credentials to your .env file

### Built-in providers

* `facebook`
* `twitter`&#x20;
* `google`
* `github`
* `gitlab`
* `linkedin`
* `bitbucket`


# Debugging

The LaunchStack comes with Laravel Telescope as default for debugging your application like:

* Requests
* Commands
* Schedule
* Queue Jobs
* Batches
* Cache
* Events
* Exceptions
* Logging
* Mail
* Models
* Notifications
* Queries
* Redis
* Views

{% hint style="danger" %}
The telescope not will be installed on production, it's a required dev composer package.
{% endhint %}

<figure><img src="https://2817866723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3E47fqhZjdekrDACG84x%2Fuploads%2FUocAPfTIl350vNj0Z2FA%2FScreenshot%202023-03-28%20at%202.37.08%20PM.png?alt=media&amp;token=0f73ea3b-90a7-422d-b0c6-34f5f6452031" alt=""><figcaption><p>Laravel Telescope</p></figcaption></figure>


# Environment Variables

The LaunchStack environment file works with the pattern provided by Laravel, but we have added some keys like social login, stripe, etc.

Checkout our .env.example below:

```
APP_NAME=LaunchStack
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=https://launchstack.test

CASHIER_LOGGER=stack
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=launchstack
DB_USERNAME=
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DISK=
QUEUE_CONNECTION=sync
SESSION_DRIVER=database
SESSION_LIFETIME=1440

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="no-reply@launchstack.app"
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

DIGITALOCEAN_SPACES_KEY=
DIGITALOCEAN_SPACES_SECRET=
DIGITALOCEAN_SPACES_ENDPOINT=https://nyc3.digitaloceanspaces.com
DIGITALOCEAN_SPACES_REGION=ncy3
DIGITALOCEAN_SPACES_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1

# Stripe
STRIPE_KEY=
STRIPE_SECRET=
STRIPE_WEBHOOK_SECRET=

# Vite
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_STRIPE_KEY="${STRIPE_KEY}"

# Telescope
TELESCOPE_ENABLED=true

# Google Social Auth
GOOGLE_CLIENT_ID=
GOOGLE_CLIENT_SECRET=
GOOGLE_CLIENT_REDIRECT="https://launchstack.app/google/callback"

# Github Social Auth
GITHUB_CLIENT_ID=
GITHUB_CLIENT_SECRET=
GITHUB_CLIENT_REDIRECT="https://launchstack.app/github/callback"

# Facebook Social Auth
FACEBOOK_CLIENT_ID=
FACEBOOK_CLIENT_SECRET=
FACEBOOK_CLIENT_REDIRECT="https://launchstack.app/facebook/callback"

# Twitter Social Auth
TWITTER_CLIENT_ID=
TWITTER_CLIENT_SECRET=
TWITTER_CLIENT_REDIRECT="https://launchstack.app/twitter/callback"

# Linkedin Social Auth
LINKEDIN_CLIENT_ID=
LINKEDIN_CLIENT_SECRET=
LINKEDIN_CLIENT_REDIRECT="https://launchstack.app/linkedin/callback"

# Gitlab Social Auth
GITLAB_CLIENT_ID=
GITLAB_CLIENT_SECRET=
GITLAB_CLIENT_REDIRECT="https://launchstack.app/gitlab/callback"

# Bitbucket Social Auth
BITBUCKET_CLIENT_ID=
BITBUCKET_CLIENT_SECRET=
BITBUCKET_CLIENT_REDIRECT="https://launchstack.app/bitbucket/callback"

# Sentry
SENTRY_LARAVEL_DSN=
SENTRY_TRACES_SAMPLE_RATE=1.0
```


# File Uploads

LaunchStack comes with all filesystems [supported by Laravel](https://laravel.com/docs/10.x/filesystem), but we recommend using any S3-compatible driver like Digital Ocean Spaces or AWS S3.

You can change the configurations on the file:

```
config/filesystems.php
```

For **Digital Ocean Spaces**, you need to add inside your .env file:

```
# Driver
FILESYSTEM_DISK=spaces

# Digital Ocean Credentials
DIGITALOCEAN_SPACES_KEY=
DIGITALOCEAN_SPACES_SECRET=
DIGITALOCEAN_SPACES_ENDPOINT=
DIGITALOCEAN_SPACES_REGION=
DIGITALOCEAN_SPACES_BUCKET=
```


# Logging


# Mail

The LaunchStack comes with all supported drivers from Laravel.

* SMTP (credentials)
* Sendmail
* Mailgun
* SES
* Postmark

#### .env file

```properties
MAIL_MAILER=[smtp,sendmail,mailgun,ses,postmark]
MAIL_HOST=
MAIL_PORT=
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=[null,tls]
MAIL_FROM_ADDRESS=
MAIL_FROM_NAME=
```


# Handling Errors \[Sentry]

Launch Stack comes with sentry as default for handling errors on the product, if you want to use sentry, you need only set in your .env file the credentials like:

```
SENTRY_LARAVEL_DSN=
SENTRY_TRACES_SAMPLE_RATE=1.0
```

For more information [sentry.io](https://sentry.io/)


# Notifications


# Email Notifications


# In-App Notifications


# Payments \[Stripe]

Subscriptions Payments are supported out of the box in LaunchStack, all you need to do it's add your plans inside the file config/launchstack.php and set up your .env file.

```
# Stripe
STRIPE_KEY=pk_test_28YpPevvtsgQsuk9I3XdQ6dT
STRIPE_SECRET=sk_test_h2uTKRYUMY2JprSOgL3vAwRp
STRIPE_WEBHOOK_SECRET=

# Plans
STRIPE_PRICE_ID_TIER_01=price_111
STRIPE_PRICE_ID_TIER_02=price_222
STRIPE_PRICE_ID_TIER_03=price_333
```

```php
'billing' => [
    'plans' => [
        [
            'name' => 'Tier 1',
            'price' => 9,
            'trialDays' => 7,
            'stripeId' => env('STRIPE_PRICE_ID'),
            'description' => "",
            'features' => [
                'Feature 1',
                'Feature 2',
                'Feature 3',
                'Feature 4'
            ]
        ],
        // your plans
    ]
]
```

Some valid credit cards for testing, more info at [Stripe Documentation](https://stripe.com/docs/testing#cards).

**Visa**

```
Card: 4242424242424242
Date: Any future date
CVV: Any 3 digits
```

**MasterCard**

```
Card: 5555555555554444
Date: Any future date
CVV: Any 3 
```


# Payments \[Paddle]

Subscriptions Payments are supported out of the box in LaunchStack, all you need to do it's add your plans inside the file config/launchstack.php and set up your .env file.

.env

```
# Paddle
PADDLE_SANDBOX=true
PADDLE_VENDOR_ID=
PADDLE_VENDOR_AUTH_CODE=
PADDLE_PUBLIC_KEY=""

# Plans
PADDLE_PRICE_ID_TIER_01=8844
PADDLE_PRICE_ID_TIER_02=8855
PADDLE_PRICE_ID_TIER_03=8866
```

launchstack.app

```php
'billing' => [
    'plans' => [
        [
            'name' => 'Tier 1',
            'price' => 9,
            'paddleId' => env('PADDLE_PRICE_ID_TIER_01'),
            'trialDays' => 7,
            'description' => "Description of plan",
            'features' => [
                'Feature 1',
                'Feature 2',
                'Feature 3',
                'Feature 4'
            ]
        ],
        // your plans
    ]
]
```

Some valid credit cards for testing, more info at [Paddle Documentation](https://developer.paddle.com/getting-started/c052e9e8d265f-working-with-the-paddle-sandbox#test-cards).

**Valid card without 3DS**

```
Card: 4242 4242 4242 4242
Date: Any future date
CVV: Any 3 digits
```


# Routing

The LaunchStack routes are split into files like:

* routes/admin.php
* routes/app.php
* routes/blog.php
* routes/website.php
* routes/web.php \[**It's responsible to include all routes above**]
* routes/auth.php
* routes/api.php
* routes/channels.php
* routes/console.php

Let's suppose you want to add the help center to your application, you need to create a new file inside the routes folder like **help.php**

```php
<?php

use Illuminate\Support\Facades\Route;

use App\Http\Controllers\Help\ArticleController;

Route::get('/help', [ArticleController::class, 'index'])->name('help.articles.index');
Route::get('/help/{slug}', [ArticleController::class, 'show'])->name('help.articles.show');
```


# Testing

LaunchStack comes with tests for code provided by us, like auth, team management, user management, feedback, blog, website and etc.

The tests are divided into two parts, **Feature** and **Browser** tests, both located in the tests folder.


# Feature Tests

LaunchStack follows the Laravel test guides, check out[ the documentation](https://laravel.com/docs/master/testing).

#### The tests are divided by namespaces like:

* Admin
* App
* Blog
* Website
* Auth

#### How to create a new test

```sh
php artisan make:test UserTest
```

#### How to run tests

```bash
php artisan test
```


# Browser Tests

The E2E tests in LaunchStack it's powered by Laravel Dusk, you can find more info on [Laravel Documentation](https://laravel.com/docs/master/dusk).

#### Create a new Dusk test class

```
php artisan dusk:make User
```

#### Create a new Dusk page class

```
php artisan dusk:page User
```

#### How to run tests

```
php artisan dusk
```


# Introduction

The front end in LaunchStack it's built on [inertiajs](https://inertiajs.com/) and [vue 3](https://vuejs.org/).

#### How it works

Inertiajs it's an interface between the backend (Laravel) and the frontend framework (vue), example of sending data from controller to view:

```php
use Inertia\Inertia;
use App\Models\Post;

class PostsController extends Controller
{
    public function index()
    {
        $posts = Post::latest()->paginate(10);
        
        return Inertia::render('Posts/Index', [
            'posts' => $posts
        ]);
    }
}
```

#### Posts/Index.vue

```javascript
<script setup>
const { posts } = defineProps({
    posts: Object,
});
</script>
<template>
    
    <div v-for="post in posts" :key="post">
        {{ post.title }}
    </div>
    
</template>
```


# Routing

You don't need to manage frontend routes when using Inertiajs, the laravel will manage it.

More information on [Inertia Docs](https://inertiajs.com/routing#defining-routes).


# Tailwind and SCSS

Launch Stack uses the tailwind css 3 as the default to build all the components, in addiction support SCSS, then you can add your custom SCSS codes.

The style main file it's:

```
/resources/css/app.scss
```

And it's imported on:

```
/resources/js/app.js
```

**Live Reloading**

It's out-of-the-box on LaunchStack, after you save chances on any javascript or scss file, the server will refresh the content.

**Colors**

LaunchStack comes with all default colors provided by the tailwindcss library. You can add more and change the colors inside the tailwind.config.js file that you modify with your own brand colors.

**Font**

The Launch Stack uses the Inter Font as default, but you can modify it by changing the CDN on app.blade.php and on tailwind.config.js

**Help**

If you're new to TailwindCSS and need more help, please check the [TailwindCSS docs](https://tailwindcss.com/).


# Views


# Layouts

LaunchStack comes with 5 different layouts:

* Admin
* App
* Blog
* Auth
* Website

All Layouts it's under the **/resources/js/Layouts** folder.

### How to use these layouts in the vue component or page

```javascript
<script setup>
import AuthLayout from "@/Layouts/Auth/Master.vue";
</script>

<template>
    <AuthLayout>
        // your content here
    </AuthLayout>
</template>
```

#### How to add more templates for your application

Let's suppose you want to create a help center for your project, you can create the layout on **/resources/js/Layout/Help/Master.vue**

Then you can use:

```javascript
<script setup>
import HelpLayout from "@/Layouts/Help/Master.vue";
</script>

<template>
    <HelpLayout>
        // your content here
    </HelpLayout>
</template>
```


# Components


# Command Palette

The Command Palette it's a nice way to give easy access to your main features, it can be enabled or disabled inside the **config/launchstack.php** file.

To customize links, icons, and actions, you need to check: **resources/js/Layouts/App/CommandPalette.vue**


# Feedback

LaunchStack comes with one amazing Feedback tool!

You can collect the rating and additional comments from users.

![](https://2817866723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3E47fqhZjdekrDACG84x%2Fuploads%2F6aCuBLsdSfTxVProkQKa%2FScreenshot%202023-03-29%20at%203.24.57%20PM.png?alt=media\&token=ade78b05-af6a-4441-a815-ed293a568abe)

All the settings are located on file config/launchstack.php, for example:

```php
'feedback' => [
    'enabled' => true,
    'question' => 'How would you rate your experience?',
    'more_info' => 'Tell us about your experience',
    'show_again_in' => 30, // days
],
```

If you want to customize the component appearance or functionalities, please check the file: **resources/js/Layouts/App/Feedback.vue**


# Form


# Modal


# Pagination

LaunchStack provides a default pagination component, 100% compatible with Laravel, Vue, and Inertiajs.

### How to use&#x20;

```php
class BlogController extends Controller
{
    public function home()
    {
        return Inertia::render('Blog/Home', [
            'posts' => BlogPost::published()->latest()->paginate(12)
        ]);
    }
}
```

```javascript
# resources/js/Components/Pagination.vue

<script setup>
import Pagination from "@/Components/Pagination.vue";
const { posts } = defineProps({
    posts: Object,
});
</script>
<template>
    <div v-for="post in posts" :key="post">
        {{ post.title }}
    </div>

    <Pagination :data="posts" />
</template>
```

The component was two different **styles:**&#x20;

* list \[default value]
* table

You can directly pass props to the component:

```javascript
<Pagination :data="posts" style="table" />
```


# i18n

LaunchStack supports multi-language out of the box, the language files are located in the lang folder on the root.

Currently, LaunchStack comes with two languages, **English** and **Portuguese**, let's check how to use it.

#### lang/en/sidebar.php

```php
return [
    'command_palette' => 'Command Palette',
    'dashboard' => 'Dashboard',
    'help' => 'Help Center',
    'settings' => 'Settings',
    'notifications' => 'Notifications'
];
```

#### lang/pt-BR/sidebar.php

```php
return [
    'command_palette' => 'Paleta de comandos',
    'dashboard' => 'Painel de controle',
    'help' => 'Central de ajuda',
    'settings' => 'Configurações',
    'notifications' => 'Notificações'
];
```

#### Vue file

```javascript
{{ $t("sidebar.dashboard") }}
```

{% hint style="success" %}
You can see the i18n working by changing your language inside the account/edit and checking the sidebar items like Command Palette, Dashboard and etc.
{% endhint %}


# Account


# API


# Billing


# Team Members


# Team Settings


# Introduction

Admin Panel it's an all-in-one place to manage your SaaS Application.

{% content-ref url="/pages/Vt33dnj4w3QQlrPYgeZO" %}
[Team Management](/admin/team-management)
{% endcontent-ref %}

{% content-ref url="/pages/PriG9CmuixbabRpBsjAa" %}
[User Management](/admin/user-management)
{% endcontent-ref %}

{% content-ref url="/pages/rtFxYRy9yAL1HMq2qcog" %}
[Notifications](/admin/notifications)
{% endcontent-ref %}

{% content-ref url="/pages/6L31qwFR5Tr6vXvpds1T" %}
[Feedback](/admin/feedback)
{% endcontent-ref %}

{% content-ref url="/pages/bmZNnibLc6XlHXiEiI7b" %}
[Blog Management](/admin/blog-management)
{% endcontent-ref %}


# Team Management


# User Management


# Notifications


# Feedback

Collect feedback from your users from anywhere in your application by simply importing the Feedback component. Users can provide a rating of positive, neutral, or negative and also provide a comment.

All feedback, along with metrics is available from the Feedback tab of the Admin Panel.

<figure><img src="https://2817866723-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3E47fqhZjdekrDACG84x%2Fuploads%2F2TVUqkg0OPfRnG9CZhzA%2FScreenshot%202023-03-29%20at%206.16.20%20PM.png?alt=media&amp;token=a08b824c-75dd-4c5f-b7c8-e212f69790f6" alt=""><figcaption></figcaption></figure>


# Blog Management


