mischa-s / dogstack

:dog: :dog: :dog: a popular-choice grab-bag framework for teams working on production web apps

Home Page:https://dogstack.js.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dogstack on a post-it note
dogstack

🐶 🐶 🐶 a popular-choice grab-bag framework for teams working on production web apps

🐱 see also catstack, dogstack's smarter, slimmer, more cunning partner in crime

features

  • provides generators for scaffolding apps made of popular libraries
  • abstracts away the app plumbing that you don't want to write again, and let's you focus on features
  • prescribes enough opinion to reduce friction for your team
  • is omakase, modules are hand-picked by expert chefs to deliver a consistent taste throughout
  • gives prescriptive opinions for how to structure production-scale apps, to reduce friction for your team

examples

documentation

dogstack.js.org

cli usage

dev server

starts development server

dog dev server

server

starts production server

dog server

test

runs ava tests

can optionally take a glob

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

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

lint

checks for standard style

can optionally take a glob

dog lint -- './todos/**/*.js'

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

api usage

server.js

export configuration for the feathers server

example:

// server.js
export default {
  services: [
    require('./agents/service')
    require('./accounts/service'),
    require('./authentication/service'),
    require('./profiles/service'),
    require('./relationships/service')
  ]
}
// agents/service.js
import feathersKnex from 'feathers-knex'

export default function () {
  const app = this
  const db = app.get('db')

  const name = 'dogs'
  const options = { Model: db, name }

  app.use(name, feathersKnex(options))
  app.service(name).hooks(hooks)
}

const hooks = {
  before: {},
  after: {},
  error: {}
}

store.js

export configuration for the redux store:

  • updater: a function of shape action => state => nextState, combined from each topic using redux-fp.concat
  • epic: a function of shape (action$, store, { feathers }) => nextAction$, combined from each topic using combineEpics
  • middlewares: an array of functions of shape store => next => action
  • enhancers: an array of functions of shape `createStore => createEnhancedStore
// store.js
import updater from './updater'
import epic from './epic'

const middlewares = []
const enhancers = []

export default {
  updater,
  epic,
  middlewares,
  enhancers
}

style.js

export configuration for fela

  • fontNode: query selector string or dom node to render app fonts
  • theme: object passsed to <FelaThemeProvider theme={theme} />
  • setup: function of shape (renderer) => {}
// style.js
export default {
  fontNode: '#app-fonts',
  theme: {
    colorPrimary: 'green',
    colorSecondary: 'blue'
  },
  setup: (renderer) => {
    renderer.renderStatic(
      { fontFamily: 'Lato' },
      'html,body,#app'
    )
    renderer.renderFont('Lato', [
      'https://fonts.gstatic.com/s/lato/v11/qIIYRU-oROkIk8vfvxw6QvesZW2xOQ-xsNqO47m55DA.woff'
    ])
  }
}

client.js

export configuration for feathers client

// client.js
export default {
  services: []
}

root.js

export configuration for root React component

  • appNode: query selector string or dom node to render app content
  • styleNode: query selector string or dom node to render app styles
// root.js
export default {
  appNode: '#app',
  styleNode: '#app-styles',
}

routes.js

export React routes

TODO this is not yet standardized, at the moment depends on your Layout.

layout.js

export layout React component, which accepts routes as props

TODO this is not yet standardized

About

:dog: :dog: :dog: a popular-choice grab-bag framework for teams working on production web apps

https://dogstack.js.org/


Languages

Language:JavaScript 100.0%