My own walkthrough of setting up Bones
Replace
kaizerroll
with your own username wherever you see it in the following examples!
Also, only one person on the team needs to create the Github repo (1-2). Everyone else can be added as a project member and clone it.
- Fork bones from https://github.com/FullstackAcademy/bones
- click the fork button at the top-right
- You should now have your own remote copy of this repo listed with your own Github repositories
- Mine is at https://github.com/kaizerroll/bones
- Rename your project (optional)
- From https://github.com/kaizerroll/bones click Settings then Rename to your desired name
- My fork is now at https://github.com/kaizerroll/GraceShopper
- Clone local copy
git clone https://github.com/kaizerroll/GraceShopper
- Note:
git clone https://github.com/kaizerroll/GraceShopper <optional-folder-name>
also works - The name of the folder of your local repo doesn't actually matter, but the name of your project on Github does
-
cd GraceShopper
-
Set upstream (optional)
- Setting an 'upstream' remote repo allows us to pull updates from the original bones project if necessary
git remote add upstream https://github.com/FullstackAcademy/bones
git remote -v
should now show both origin and upstream- origin - the remote repo you forked to. You can pull and push changes to this repo as you own it!
- upstream - the remote repo you forked from. You can only pull changes to this repo as you don't own it!
- periodically you can merge any updates from upstream with
git pull upstream master
. You shouldn't need to do this but we will let you know if there are any bugfixes to bones that happen during your GraceShopper phase.
- Install dependencies
yarn
(ornpm install
)- If you don't have
yarn
, get it withnpm install -g yarn
. I recommend it as it's faster and messes up less often for me. It's pretty straightforward to replace npm with yarn, and most commands are more straightforward with sensible default behavior (yarn add express
vsnpm install --save express
). - Check https://yarnpkg.com/en/docs/cli/ to learn more.
- If you don't have
- Update node (optional)
- if you get a complaint that your node version is not up to date, we need to get a later version.
- I use an npm module called
n
, which is a node version manager like nvm - this let's you switch between different versions of node when necessary without much fuss. yarn global add n
n
to check current version you are usingn latest
to download and use latest version of node
- Run
npm run dev
will start your app with the node environment variable NODE_ENV set to "development". This is a bit overkill for your needs, but it allows one to set up things like different logging or startup behavior depending on the NODE_ENV, which could be "production", "testing" etc.- Running the app should progressively tell you about things you need to do before it is 'ready'
- Name It
- lower case and hyphenated project name in
package.json
likegrace-shopper
- Create a DB
- I use Postico but any means work. What you want is a database with a name that matches your project name (so mine is 'grace-shopper').
- You can see that the url the Sequelize is looking for at
db/index.js
, i.e.postgres://localhost:5432/${name}