Skip to content

Latest commit

 

History

History
85 lines (56 loc) · 3.79 KB

SETUP.md

File metadata and controls

85 lines (56 loc) · 3.79 KB

Project Setup

Setup Walkthrough

Requirements

  • IntelliJ Idea Community Edition (Download)
  • Java SDK (JDK)
    • If JDK is missing, don't worry, IntelliJ will assist you installing JDK from the IDE. See troubleshooting.

Steps

Clone Repo

Clone repo with your favorite tool, or with CLI using following command

git clone https://github.com/hossain-khan/github-stats.git

Open in IntelliJ

Open the checked out directory in IntelliJ IDEA

ℹ️ Instead of using IntelliJ, you can use Gradle command after configuring local.properties ./gradlew run

IntelliJ open

Select dir

Once project is synced using gradle, you should see the project load like following

Setup local.properties

Rename the provided local_sample.properties to local.properties.

Generate token and update other configurations as appropriate

Generate stats using Main.kt

Once configuration is in place, all you need to do is open the Main.kt and ▶️ run it.

Run using gradle command

You can also use following gradle command to run the stats generator

./gradlew run

See troubleshooting section if you encounter issue.

Preview Stats

Once the generator app finishes running, you will see report in the project root directory that contains both ASCII and CSV report.
Here is sample snapshot of reports from different repositories:

Generated files and folders

Troubleshooting

If you see following error, it could be your token is not setup, or you have exceeded API rate limit.

Exception in thread "main" retrofit2.HttpException: HTTP 401 

Open BuildConfig and enable DEBUG_HTTP_REQUESTS to true to see API request header information to confirm error details.


Missing ▶️ run button, or JDK missing - in this case, take a look at top right corner of the IntelliJ IDEA that will suggest you to install a JDK. Click on the install link and wait for it to complete.

Finally, click on the gradle sync button (🐘🔁) and wait for the sync to complete. If everything went well you should see the ▶️ icon beside main() in the Main.kt file.