Here are detailed instructions on how to download this repository and get the application running. To achieve this, we will be working heavily in the terminal. Below you'll find a general overview of the application's expected behavior.
-
In your computer's terminal, navigate to the directory of your choice and
git clonethis repository.- When you're in the directory of your choice, paste this command into your terminal:
git clone https://github.com/jsdev17/issues.gitthen hitEnter.
- When you're in the directory of your choice, paste this command into your terminal:
-
Once you've cloned the repository, you should see two directories at the root level: one named
serverand another namedclient. Go into each of these directories and run the commandnpm installinside the terminal.- For the sake of clarity, this means you'll be running
npm installtwice; once insideserverand another insideclient. You can do this one at a time, or you can open a second tab in your terminal and run these commands simultaneously on two separate tabs.
- For the sake of clarity, this means you'll be running
-
Once
npm installis finished inserver, then- Create a
.envfile _at the root level. In this file, add three varibles:TOKEN=(ask the owner this repo for a token),DB_URI=mongodb://localhost/strategic-test, andTESTING=false. Creating a.envfile with these environment variables is very important. If you don't have the first two, the server won't start properly. - Start MongoDB in your computer. You can do this by opening a new terminal tab, or window, and running the
mongodcommand. - Once Mongo is running, run
npm startinside theserverdirectory. This will start the server.
- Create a
-
In
client, all you have to do is runnpm startoncenpm installis done. This will automatically open the application on your browser.
The application is a working prototype, and is thus tailored to retrieve and render data from GitHub repositories and issues for this account only. If you wish to fetch and render repositories from another GitHub account, you may do so by making a slight change in the source code; however, you will not be able to see each repository's issues (assuming there are any). This is because in order for issues to be rendered, they need to be matched with documents in the database; that is to say, if there's not a document (in the database) for each issue retrieved from GitHub, there will be no match and the issue won't be rendered. When you start the server, data will be automatically initialized into MongoDB; however, this data currently only matches issues in this repository. This behavior may or may not change in future versions of this application. For now, just keep in mind its present limitations.
There's a file named ReposPage.js in the client directory. The path to this file is the following: client/src/components/ReposPage.js.
On line 13, inside the component's state, change the value of user to fetch repositories of another GitHub user. Like so:
this.state = {
repos: [],
loaded: false,
user: 'change the value of this'
}You must enter a valid GitHub username.