Files: 6e1db83ccf670a232dd3372c8c7e1519e92689cf / README.md
5206 bytesRaw
business-stack
work in progress
real-world, production-quality stack for Craftworks
stack
- task runner: npm scripts
- client bundler: browserify
- es6/jsx transform: babelify
- css transform: cssify and css-modules-require-hook
- bulk require: bulkify
- configuration: simple-rc
- utility functions: ramda
- data model: tcomb
- database: knex
- api service: feathers-knex
- api validator: feathers-tcomb
- TODO api authentication: feathers-authentication
- api transport: feathers-rest
- client transport: isomorphic-fetch
- client: feathers-client
- render action { creators, reducers }: feathers-action
- render action store: redux
- render getters: reselect
- render router: redux-router
- render views: react
- render forms: tcomb-form
- test specs: ava
- test features: cucumber
- test dom: zombie
- TODO generators: plop
directory structure
/config/
/config/index.js
/config/{ NODE_ENV }.js
/app/${ module }/
- symlink
/app
to/node_modules/app
- only do relative requires if within module
- otherwise, always require top-down (
require('app/things/model')
).
- symlink
/feature/
/feature/support/world.js
/feature/step_definitions/steps.js
/feature/todos.feature
micro-services
TODO split into micro-services based on mad-science-stack
TODO write docs about what is a micro-service
app modules
in contrast to frameworks like Rails which split our app
into directories for each "type" of file (models, views, controllers), our app
is split into directories for each module, where each module contains the various types of files within that module.
each module directory may contain any of:
index.js
: exports all the below exports from the modulemodels/*.js
: exportstcomb
modelsconstants.js
: exports constants (such as redux action types)actions.js
: exports redux actionsreducer.js
: exports redux reducerroutes.js
: exportsfunction (store) { return <ReactRouter.Route /> }
getters.js
: exportsreselect
getters for use in containers'connect
containers/*.js
: exports smart componentconnect
ed withreact-redux
components/*.js
: exports dumb componentcomponents/*.css
: exports css modules for respective componentservice.js
: exportsfeathers
service (recommended to usefeathers-knex
andfeathers-tcomb
)client.js
: exportsfeathers-client
setup postgres database
install docker
- to install db, run
npm run pg:pull
- to create db, run
npm run pg:run
- to start db, run
npm run pg:start
- to stop db, run
npm run pg:stop
- to remove db, run
npm run pg:rm
- to show db logs, run
npm run pg:logs
run latest migrations with
npm run knex -- migrate:latest
or run [any other knex
command] with npm run knex -- [command] [args]
known issues
- adding a new file won't always be noticed by
node-dev
orwatchify
due to usage ofbulk-require
). potential fix is to usechokidar-cli
and some transform to watch for new files and re-run the script command
resources
Built with git-ssb-web