@staqjs/client v0.0.32
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', landingPageHeader: 'SaaS apps are great', landingPageSubheader: 'You should totally subscribe', 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 ```Test out the routes
Run
yarn startand head tohttp://localhost:3000to see your landing page generated courtesy ofstaq. You should see something like this.
Contributor Guide
Here's how to set staq up locally to hack on it.
Clone the repo.
$ git clone git@github.com/staqjs/staqCreate a fresh React project. Let's call it
staq-dev.$ npx create-react-app staq-devCreate a fresh Firebase project. Here are some more details.
Register your clone of
staqwithnpm link$ cd /path/to/staq/clone $ npm linkLink your clone of
staqto the new React project$ cd /path/to/staq-dev $ npm link staqLink the new project's React to your clone of
staq. (Assuming your clone ofstaqandstaq-devare siblings in the file tree.)$ cd /path/to/staq/clone $ npm link ../staq-dev/node_modules/reactFollow the Quickstart steps to install
staqto the newstaq-devproject.In one terminal, start a file watcher in your
staqclone that will recompile with any changes.$ cd /path/to/staq/clone $ yarn startIn another terminal, start up
staq-dev.$ cd /path/to/staq-dev $ yarn start
Create a Firebase Project
Head over to the Firebase Console.
Click Add Project
Follow the steps to create the project.
On the left side bar of the project dashboard, click Authentication.
On the Authentication page, go to the Sign-in Method tab and enable Email/Password sign-in.
On the left side bar, click Database. Create a Firestore database.
All done!
License
MIT © mroll
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago