Building software is expensive and time-consuming. Gravity provides you with all the boilerplate functionality needed for a SaaS web-app so you can focus on building the features that matter.
Connect your Stripe account and start collecting subscription payments from your customers in minutes. We’ve spent weeks building a SaaS payments engine so you don’t have to.
Everything you need to create a beautiful, responsive web app. From icons and forms to calendars and a full charting library – all built using the Golden Ratio. Simply copy and paste the code examples to build your own UI in seconds.
Users can sign up, sign in or reset their password. The complicated stuff like updating card details or switching plans is also handled for you. Permissions are included so users can only access the features they’ve paid for.
Users can invite their teammates to sign up an account and join their team. Comes with a fully-functional user interface for adding, updating or deleting team members.
Only hardcore masochists enjoy building HTML emails, so we’ve saved you the pain and built all the emails you’ll need as beautiful HTML templates. Just connect your Mailgun account and start sending emails.
On the premium plans, you’ll get access to every new feature we release. We have some super-exciting stuff in the pipeline, like SaaS metrics for your business and integration with your accounting software.
Save thousands of dollars hiring expensive lawyers to write legal documents for your SaaS business. Our homepage template comes with a boilerplate terms and conditions page and GDPR-compliant privacy policy.
Built using a standard Model-View-Controller pattern with an RESTFUL API running on Express and MySQL, you can get to grips with the codebase in minutes. Plugging in your own code to add new features is easy-peasy.
Download the code and run the setup file. In less than two minutes, you’ll have a fully-functioning web application that can process payments, manage users and deliver SaaS metrics for your business.
/*
* auth.signupAccount()
* creates a new account + a new stripe customer
* processes the payment and creates a new recurring monthly subscription
* params are passed from the front-end signup form via router.js
*/
exports.signupAccount = function(name, email, password, referer, stripe_id, plan, session){
return new Promise(function(resolve, reject){
var accountId, planPrice;
// check if the email address is already registered with an account
account.doesExist(email, null).then(function(exists){
if (!exists)
return account.create(email, referer, stripe_id, plan);
else
throw ({ status: false, error: "emailError", message: "Account already exists" });
}).then(function(res){
// create a new stripe customer
accountId = res;
return account.createStripeCustomer(email, stripe_id);
}).then(function(customerId){
// subscribe the account to a new stipe subscription plan
return account.subscribeToPlan(accountId, customerId, plan);
}).then(function(price){
// create the user and add to account
planPrice = price;
return user.create(name, email, password, accountId, "owner");
}).then(function(userId){
// set permissions and autheticate user
session.user = userId;
session.account = accountId;
session.permission = "owner";
// send welcome email
mail.send(email, "Welcome to Gravity!", "welcome-account", { name: name, plan: plan, price: planPrice });
// redirect user to dashboard
resolve({ success: true });
}).catch(function(err){
reject(err);
});
});
}