- Install
yarn
(version 1.22.x) - In this directory, run
yarn install
to install all the dependenceies. - Run
cp server/.env.example server/.env
to create an environment file, and fill in the relevant fields. - Set up Prettier to format your code consistently and automatically. The Prettier VSCode extension does this very well.
Run yarn client
and yarn server
in separate terminals to start developing.
yarn build:client
will type-check, compile, and bundle the frontend (everything in client/
).
yarn build:server
will type-check and compile the backend (everything in server/
).
yarn build
will build the entire project at once.
Although Parcel is much faster and easier to configure than Webpack for
builds, it does not perform type checking. Therefore, we expect development on this project will
be done in an IDE that gives significant feedback when type errors occur (such as VSCode). This
gives us the speed of Parcel, and the development advantages of TypeScript. While running
yarn build:client
performs type checking then uses Parcel to bundle the JavaScript, yarn dev
may continue to work even when type errors are present.
It's usually easiest to use something like pm2
to keep the process running and easily manage it:
yarn global add pm2
yarn build:client # might take a full minute or so to run
pm2 start server/server.js
pm2 save # save configuration so pm2 can restart server.js on VM reboot