Database:
- PostgreSQL
- Redis (not implemented)
Backend:
- Koa
- Pug
Frontend:
- React
- Redux
Testing:
- Unit - Jest
- Acceptance - Selenium & Puppeteer (via @dollarshaveclub/e2e)
- Monitors - Puppeteer (via @dollarshaveclub/monitor)
isomorphic/
- stores all code used by eitherserver/
orclient/
server/
- stores all server related codeutils/
- utilities that has no business logiclib/
- logic and helpers that do not depend on a database, but do affect business logicpsql/
- setting up and migrating the databasemodel/
- database modeling and business logicapp/
- bootstrap the Koa appcontrollers/
- routing logicapi/
- API routesroutes/
- non-API routes
client/
- all client-side app codeui/
- all visual UI componentscomponents/
- all non-connected componentsstories/
- stories for all non-connected components for Storybookapi-sdk/
- SDK for the APIstore/
- redux store<domain>
- the redux store is stored by domainactions
reducer
index.js
- the action dispatcher for this domain. These are the only functions connected components should be calling.
routes/
- connected components that are served by a route
public/
- all static assets served publiclytests/
- tests that span both the server and the clientmonitors/
- API and Puppeteer smoke testsautomation/
- Selenium tests
Currently, this app is built as a monorepo. For small projects, this is sufficient and makes adding features easy. However, this becomes difficult to scale. Here's a plan for modularization, which depends on your app:
utils
/lib
- a module for allutils
and/orserver/lib
server/model/
- a module for all app business logicstorybook
- a module/app for the storybook.storybook
client/ui/
client/compoonents/
client/stories/
api-sdk/
- an isomorphic module for working with your APIclient/store
- a module for your redux storetests/monitors/
- a module for your monitors and to run themtests/automation/
- a module for your automation tests
Ownership of parts of the app and modularized can be split by discipline:
- Server - Backend
- Storybook - Frontend UI
- Redux store - Frontend App
- API SDK - Backend and Frontend App
- Tests - QA as well as Frontend and Backend