From defa1d9b0c363c4a09740f22cbda56de05d255a8 Mon Sep 17 00:00:00 2001 From: Souma Date: Sun, 4 Oct 2020 02:53:52 +0530 Subject: [PATCH] update readme --- README.md | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/README.md b/README.md index ffcccf8..c45f6bf 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,60 @@ # VIDLY-BACKEND This project is the backend of Vidly, an imaginary video rental app. +## Setup + +Make sure to follow all these steps exactly as explained below. Do not miss any steps or you won't be able to run this application. + +### Install MongoDB + +To run this project, you need to install the latest version of MongoDB Community Edition first. + +https://docs.mongodb.com/manual/installation/ + +Once you install MongoDB, make sure it's running. + +### Install the Dependencies + +Next, from the project folder, install the dependencies: + + npm i + +### Populate the Database + + node seed.js + +### Run the Tests + +You're almost done! Run the tests to make sure everything is working: + + npm test + +All tests should pass. + +### Start the Server + + node index.js + +This will launch the Node server on port 3900. If that port is busy, you can set a different point in config/default.json. + +Open up your browser and head over to: + +http://localhost:3000/api/genres + +You should see the list of genres. That confirms that you have set up everything successfully. + +### (Optional) Environment Variables + +If you look at config/default.json, you'll see a property called jwtPrivateKey. This key is used to encrypt JSON web tokens. So, for security reasons, it should not be checked into the source control. I've set a default value here to make it easier for you to get up and running with this project. For a production scenario, you should store this key as an environment variable. + +On Mac: + + export vidly_jwtPrivateKey=yourSecureKey + +On Windows: + + set vidly_jwtPrivateKey=yourSecureKey + ### **API Endpoints** * genres * customers