PHPackages                             elefant/app-saasy - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. elefant/app-saasy

ActiveElefant-app[Utility &amp; Helpers](/categories/utility)

elefant/app-saasy
=================

SaaS helper app for the Elefant CMS

4135[8 issues](https://github.com/jbroadway/saasy/issues)JavaScript

Since Jun 25Pushed 13y ago2 watchersCompare

[ Source](https://github.com/jbroadway/saasy)[ Packagist](https://packagist.org/packages/elefant/app-saasy)[ RSS](/packages/elefant-app-saasy/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Saasy - SaaS Manager
====================

[](#saasy---saas-manager)

Saasy is an [Elefant](http://www.elefantcms.com/) app that provides the glue for building custom software-as-a-service (SaaS) apps. It provides the basic customer and account management, [Bootstrap](http://twitter.github.com/bootstrap/index.html)integration, and app structure, so you can focus on creating the custom functionality of your SaaS app.

Status: **Beta**

Screenshot
----------

[](#screenshot)

[![Saasy Account management screen](https://camo.githubusercontent.com/3accdb34a64f9c3a34d5fd3fa7846b2e92522938bbd5c247e76acc8eb8d043d2/68747470733a2f2f7261772e6769746875622e636f6d2f6a62726f61647761792f73616173792f6d61737465722f6373732f73616173792d6163636f756e742e706e67)](https://camo.githubusercontent.com/3accdb34a64f9c3a34d5fd3fa7846b2e92522938bbd5c247e76acc8eb8d043d2/68747470733a2f2f7261772e6769746875622e636f6d2f6a62726f61647761792f73616173792f6d61737465722f6373732f73616173792d6163636f756e742e706e67)

Installation
------------

[](#installation)

1. Drop the app into your `apps` folder.
2. Copy the file `apps/saasy/conf/config.php` to `conf/app.saasy.config.php` and edit the settings there. This is where most of your customization will occur.
3. Copy the file `apps/saasy/conf/user_config.php` to `conf/app.user.config.php`to link the user signup, update, and profile screens to Saasy's handlers.
4. Copy the included `sample_bootstrap.php` into the root of your website and rename it `bootstrap.php`.
5. Copy the included `saasy.html` into your `layouts` folder.
6. In the global `conf/config.php` set the `default_handler` to `"saasy/index"`, set the `default_layout` to `"saasy"`, and set `session_domain = top`.
7. Go to Tools &gt; SaaS Manager to install the database schema for customers and accounts.

**Note:** It's also a good idea to change the `session_domain` setting to `top` in the global `conf/config.php`. This will ensure logins work across subdomains, so a login to `www.example.com` also works on `mysubdomain.example.com`.

To do
-----

[](#to-do)

- More documentation/examples
- Billing/subscription management
- Admin dashboard to manage customers and accounts
- Customizable theme colours

Customization
-------------

[](#customization)

Saasy works by hooking your own app into its various settings. You should only need to edit the Saasy configuration in `conf/app.saasy.config.php`, but not any of the Saasy source files directly.

Instead, create a secondary app that will contain all of your models, view templates, and handlers, and point Saasy to them via the above config file. Here's an example folder structure for a typical Saasy setup:

```
apps/
	myapp/
		conf/
		handlers/
		models/
		views/
	saasy/
		conf/
		handlers/
		lib/
		models/
bootstrap.php (copied from apps/saasy/sample_bootstrap.php)
conf/
	app.saasy.config.php (copied from apps/saasy/conf/config.php)
layouts/
	saasy.html (copied from apps/saasy/saasy.html)

```

### Using the app scaffold generator

[](#using-the-app-scaffold-generator)

Saasy adds a command to the Elefant command line tool that you can use to automatically generate the basic scaffolding and configuration file for an app. Here is the format the command expects:

```
./elefant saasy/app   [, ]

```

- `` is the name of the folder for your app
- `` is the title of your SaaS app
- `` is a list of navbar tabs for your app

For example, to create a basic app called "Project Spot" with navbar options for Messages, Tasks, Files, and a Wiki, you would say:

```
./elefant saasy/app projectspot "Project Spot" Messages Tasks Files Wiki

```

This will create a preconfigured `conf/app.saasy.config.php`, and the outline of your app including models, schema, handlers, and views.

From here, you'll need to edit your database schema, found in `apps//conf/`, then import it via:

```
./elefant import-db apps//conf/install_mysql.sql

```

Make sure to change the appname and the schema file according to the database your site is using.

### Adding sections to your SaaS app

[](#adding-sections-to-your-saas-app)

To add a new section to your SaaS app, create a handler in your app with the following layout:

```

```

If your handler's name is `myapp/reports`, to include this in your SaaS menu, add the following line to `apps/saasy/conf/config.php`'s `[Sections]` section:

```
reports[myapp/reports] = Reports

```

This will now appear as "Reports" in your SaaS app menu.

### Adding a custom theme

[](#adding-a-custom-theme)

To add a custom theme, create a handler in your own app named `theme.php` with the following contents:

```
