:seedling: :package: :stew: :family: Helping people buy good food at good prices, together.
Before we start, please
node@8
and npm@5
cobuy_development
(i.e. using a command like CREATE DATABASE cobuy_development;
in psql
)git lfs install
git clone git@github.com:root-systems/cobuy
cd cobuy
npm run burnthemall # TODO npm install
# see 'How to get private development config' section below
npm run db migrate:latest
npm run db seed:run
npm run dev
git-lfs
dogstack
app/components/Navigation.js
<any dumb component and its style file>
<any component that has buttons or text fields or sliders>
app/locales/en.json
, <any component with text>
.storybook/config.js
, agents/stories/index.js
, agents/stories/Profile.js
*/updaters/*
ordering/epic.js
, agents/components/SignIn.js
*/getters/*
<almost any>
*/dux/*
, */services/*
, */containers/*
, server.js
, db/migrations/*
agents/containers/Register.js
dogstack
! :dog: :dog: :dog:
We're following the dogstack folder structure convention.
topic
(e.g. agents
)npm start
Starts production server
npm start
npm run dev
Starts development server
npm run dev
npm run storybook
Starts storybook server
npm run storybook
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 db
Runs knex
command, with any arguments.
npm run db migrate:latest
npm run db seed:run
Anything that a developer working on Cobuy should know about.
TODO organize all the miscy mushy magic
Use a ~/.pgpass
file to automate your passwords!
echo "localhost:5432:*:postgres:password" > ~/.pgpass
chmod 600 ~/.pgpass
Create your database with:
createdb cobuy_development -h localhost -U postgres
Drop your database with:
dropdb cobuy_development -h localhost -U postgres
Connect to your database with:
psql -h localhost -U postgres -d cobuy_development
Our development config is stored in a private repository:
cd ../
git clone git@github.com:Enspiral-Pods-Swarm/cobuy-config
cp cobuy-config/*.js cobuy/config
heroku run npm run db migrate:latest --app=cobuy
All models must have an assoicated JSON schema. See #118 for more info.
We're using json-schema-faker to fake data for tests and storybook.
So you want to tell a story about dumb React components, ey?
Start storybook with npm run storybook
The configuration for storybook lives in .storybook/
.
The stories are in ${topic}/stories/index.js
. The dumb components are in ${topic}/components/${name}.js
If you add a "story", please add your topic story to .storybook/config.js
Check out app/stories/index.js
for example stories, which you can copy into a new topic.
NOTE: At the moment, hot-reload does not work when changing messages in app/locales/*.json
.
All numbers should be represented as strings and manipulated with bigmath
.
Developers should be using British spelling in the codebase
All assets (binary files) should be checked in using Git LFS:
git lfs add <file>
They must also be manually added to our production OpenStack Object storage cobuy-assets
container.
This can be found at: https://dashboard.cloud.catalyst.net.nz/project/containers/container/cobuy-assets
Ensure the name of the file is the same locally and remotely.
AGPL-3.0
Emoji artwork is provided by EmojiOne and is licensed under CC-BY 4.0