Setting up your environment - resant18/routeplan GitHub Wiki

This is a simple list of instructions that should allow you to run the project correctly, however, there are a few things that you need to do on your end if you want to run this locally and connect it to your own MongoDB database.

  1. make sure that you have node installed on your machine (nvm is highly recommended), for this project use node v10.13.0

  2. in the /config folder, add a new file called "keys_dev.js", paste the example code below and replace <YOUR_MONGO_URI> with a valid MongoDB URI string and <YOUR_SECRET> with a secret (the random string used to sign and encrypt a jwt):

      module.exports = {
        mongoURI: <YOUR_MONGODB_URI>,
        secretOrKey: <YOUR_SECRET>,
      };
    
  3. This project uses port 5000 to run the backend server, however, new Macs use that port by default and you should update the code to use a different port (for example, 5001) to avoid conflicts. If not using Mac, you can skip this step. To do this update app.js and package.json as shown below:

      // app.js
    
      // ...
    
      const port = process.env.PORT || 5001;
    
      // ...
    
      // package.json
      {
    
      // ...
    
      "proxy": "http://localhost:5001"
      }
    

This should be all you need to run the project locally. Now run the project in development mode (npm run dev) and navigate to http://localhost:3000 to view the dashboard.