staq v0.11.0
staq
Staq is a Javascript library for creating Software-as-a-Service (SaaS) businesses.
The staq package contains a set of React components that implement standard SaaS features including:
- User accounts
- Landing page
- Pricing page
- Subscription management (via Stripe Customer Portal)
The package also ships with a set of NodeJS functions to be used with Google Firebase to implement the backend logic necessary for features like subscription billing with Stripe.
Quickstart
Install
yarn add staqInitialize and configure
In your
index.js, add the following import:import { initStaq, withStaq } from staqCall
initStaqand pass in a configuration object specifying the name of your site and your Firebase config object.initStaq({ siteTitle: 'Test App', firebaseConfig: { // your firebase config } })Also in
index.js, wrap your app inwithStaqTake the first argument toReactDOM.renderand pass it to thewithStaqfunction.```jsx ReactDOM.render( withStaq(<App />), document.getElementById('root') ) ```Use
staqto install standard SaaS features In yourApp.js[x], importStaqRoutesand render them inside your router.```jsx import React from 'react' import { BrowserRouter as Router } from 'react-router-dom' import { StaqRoutes } from 'staq' function App(props) { return ( <Router> <StaqRoutes /> </Router> ) } export default App ```
License
MIT © mroll