Restore all packages from root folder:
$ yarn # yarn install
You can install Postgres or run your server in a Docker container.
- Install postgres. When prompted to enter the
postgres
user password, usesa.pg.01
or one of your choice- Make sure to update the password in
server/datastore/create/knexfile.js
if you picked a different password.
- Make sure to update the password in
- For more information about setting up the server see official docs
- Install Docker and docker-compose
- Run
yarn database:docker-server
to create the docker container for the Postgres Server (volume to persist data will be mounted)
Once you have configured your Postgres server, run the following commands:
- Create the
reactseeddb
database,pg
user and grant access to database:yarn database:create
- Create tables running migrations:
yarn migrate:latest
- Populate database running the seeds:
yarn seed:run
$ yarn dev # or (yarn run dev)
$ yarn prod # build and start
Open browser on localhost:4000
$ yarn build # build production assets
$ yarn start # execute production server
$ yarn test # execute all tests
$ yarn lint # execute linting
test
: exec all test (client usesjest
, server usestape
)test:client
: exec client testtest:server
: exec server test
tdd
: exec test (on watch mode)lint
: exec linting (eslint
)migrate:*
: knex migrationsmigrate:make
: create migration scriptmigrate:latest
: exec migrationsmigrate:rollback
: rollback migration
seed:*
: data seedsseed:make
: create seed scriptseed:run
: exec seeds
stats
: runnpm
statsbuild
: build production assetsstart
: exec production serverdev
: exec development serverprod
: build production assets and exec production server
In develop we use git hooks for automate linting and testing.
Using husky with yarn
:
$ yarn add husky --dev --force # ensures hooks will be installed
Install hooks manually (using node
):
$ node node_modules/husky/bin/install