Skip to content

mischa-s/legit-boilerplate

 
 

Repository files navigation

buttcloud-provider

a hosted Scuttlebutt pub-as-a-service provider

table of contents

start

before you start, please

git clone git@github.com:buttcloud/buttcloud-provider
cd buttcloud-provider
npm install
npm run sql migrate:latest
npm run sql seed:run
npm run dev

design

ux

  • join
    • land
    • sign in
    • create pub
    • pay for pub
    • start pub service
  • monitor
    • land
    • sign in
    • view pub
    • see stats
  • command
    • land
    • sign in
    • view pub
    • run command

data models

  • users
    • id
    • name
    • email
  • pub
    • bots
      • id
      • userId
      • name
      • status (up, down, none)
    • stats
      • stream Docker stats
    • commands
      • relay commands to pub services
    • orchestrator
      • on schedule, check what pubs are up
      • have 1 pub per 1 GB memory, 1 hub per 15 GB memory
      • queue worker jobs to ensure correct swarm
  • payment
    • products
    • plans
    • customers
    • subscriptions

architecture

  • web server
  • swarm worker
    • manage hub machines
      • create hub
      • destroy hub
    • manage pub services
      • ensure pub service is up
      • ensure pub service is down
  • mailer worker
  • pub service(s)

stack

folder structure

we're following the dogstack folder structure convention, adapted for our stack.

available scripts

npm start

starts production server

npm start

npm run dev

starts development server

npm run dev

TODO npm test

runs ava tests

Can optionally take a glob

npm test -- './todos/**/*.test.js'

Default glob is ./**/*.test.js ignoring node_modules

npm run lint

checks for standard style

can optionally take a glob

npm run lint -- './todos/**/*.js'

default glob is ./**/*.js ignoring node_modules

npm run sql

runs knex command, with any arguments.

npm run sql migrate:latest
npm run sql seed:run

notes

After deploy: migrate on heroku!

heroku login
heroku run npm run sql migrate:latest --app=buttcloud-demo

Postgres DEV setup

use a ~/.pgpass file to automate your passwords!

echo "localhost:5432:*:postgres:password" > ~/.pgpass
chmod 600 ~/.pgpass

create your database with:

createdb buttcloud_provider_development -h localhost -U postgres

drop your database with:

dropdb buttcloud_provider_development -h localhost -U postgres

connect to your database with:

psql -h localhost -U postgres -d buttcloud_provider_development

background image

https://pixabay.com/en/love-heart-set-seamless-pattern-3102033/

  • search terms
    • seamless
    • tile
    • repeating
    • geometric
    • abstract
    • mosaic
  • open source friendly websites
    • pixabay.com

emoji

license

AGPL-3.0

attributions

About

a hosted Scuttlebutt pub-as-a-service provider

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%