Follow these set-up instructions to start a local instance of Repo Reporter.
First clone then cd
to the root directory of this repo before running these commands.
The flask application will look for a file named .env
in its root directory. If it finds it, it will load it to your local environment. Create this file.
$ touch .env
.env
is a file ignored by git.
A GitHub account authenticates you to the GitHub API. Be sure the account has push privileges for the configured repos.
Create a personal access token on GitHub following these instructions. Be sure to select the repo scope. No other scope is needed.
This token should be kept secret.
The token will allow you to authenticate to Github. The token must be named GITHUB_PERSONAL_ACCESS_TOKEN
.
$ echo GITHUB_PERSONAL_ACCESS_TOKEN=your-newly-aquired-super-secret-token >> .env
The secret key will allow you to define a Flask session. The token must be named RR_SECRET_KEY
.
echo "RR_SECRET_KEY=$(openssl rand -base64 32)" >> .env
MongoDB official install instructions didn't work for me, likely because i'm running Catalina. If you're running Mojave, they might work for you.
$ brew update
$ brew install mongodb
Install MongoDB on Mac Catalina using Homebrew.
$ brew tap mongodb/brew
$ brew install mongodb-community
Start the mongo daemon on it's default port.
$ mongod --dbpath /usr/local/var/mongodb
Ensure you have Python3 installed.
$ python3 --version
This project is built using Python 3.7.3, the macOS Catalina default.
Create a Python3 virtual environment named repo-reporter-venv
:
$ python3 -m venv repo-reporter-venv
Actually, you can name the virtual environment whatever you want with no breaking changes.
Ask linux to run the activate program located in the virtual environment.
$ source repo-reporter-venv/bin/activate
Install dependencies to the repo-reporter-venv
virtual environment lib.
$(repo-reporter-venv) pip install -r ./requirements.txt
Repo reporter is designed two run in one of two environments.
$(repo-reporter-venv) export FLASK_ENV=production
$(repo-reporter-venv) export FLASK_ENV=development
Start the flask server on the default port, 5000
.
$(repo-reporter-venv) flask run
or specify host and port yourself
$(repo-reporter-venv) flask run -h localhost -p 5000
Check that the http server works by typing into your browser url bar: localhost:5000/