Skip to content

peachcloud/peachhub-provider

Repository files navigation

peachhub-provider

travis

a hosted Scuttlebutt pub-as-a-service provider

DEMO 👀

table of contents

start

before you start, please

git clone git@github.com:peachcloud/peachhub-provider
cd peachhub-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=peachcloud-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 peachhub_provider_development -h localhost -U postgres

drop your database with:

dropdb peachhub_provider_development -h localhost -U postgres

connect to your database with:

psql -h localhost -U postgres -d peachhub_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

increase file watch

if you get an ENOSPC error related to watching files in development:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

source

css selector chart

https://www.red-gate.com/simple-talk/wp-content/uploads/imported/1269-Locators_table_1_0_2.pdf?file=4937

The css selectors that look like :contains("text") dont work, i googled it, apparently that kind of selector is a jquery thing 🤷

license

AGPL-3.0

attributions

About

[deprecated] a hosted Scuttlebutt pub-as-a-service hub provider

Resources

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published