Setting Up the Repo (Manual)
Please note ⚠️
If you used the @command-shift/create-backend-app
script, you do not need to follow these manual steps. The script has already done all the required setup mentioned on this page. Feel free to read through if you want a better understanding of what the script did.
Manually setting up the repo
We're going to start by setting up a basic project repository.
-
Create a new directory of the project. You can call it whatever you like, something along the lines of
music-library
would work. -
Initialize a git repo with
git init
. -
Add a
README.md
file in the root of yourmusic-library
folder. Use this file to document your project. you can find a guide on what should go in aREADME
here. -
Create a remote repository for the project on Github.
-
Connect your remote and local repositories. There will be instructions on how to do this on Github.
-
Initialize a node project in your folder with
npm init -y
. This will create a defaultpackage.json
. -
Create a
.gitignore
file. You can do this automatically withnpx gitignore node
,npx
is similar tonpm
, but is used to run scripts without having to store them on your computer. This will create a new file filled with common.gitignore
entries. -
Set up
eslint
in this project withnpx eslint --init
. Answer the question to configure it for common js that runs in node. You should end up with a.eslintrc.json
file which looks like this: -
We are also going to use
Prettier
to format our code. Install thePrettier
VS Code extension for javascript, and create a new file called.prettierrc.json
. This should contain:
You can format all the files in your project with the command npx prettier --write .
. Its best to do this just before committing code to github.
- Commit and push your work so far. A commit message of "initial commit" will do.