Skip to content
This repository has been archived by the owner on Apr 12, 2018. It is now read-only.

gitlytics/Gitlytics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gitlytics

To use locally

For running locally, the GithubClient model searches for two environment variables so that we don’t have to define them in the code.

These are GH_USERNAME and GH_PASSWORD. To set, in the same terminal you will run the server from, type (with the quotes):

export GH_USERNAME='username'
export GH_PASSWORD='password'

Test out by using echo $GH_USERNAME

Add these to your .bashrc for persistance

Run it

bin/rails server

Database

If we want to use Heroku for hosting, we should ensure not to use SQLite and rather use PostgreSQL (https://devcenter.heroku.com/articles/sqlite3). The alternative is to set up an ec2 or digitial ocean instance and handle the DB creation, etc. on our own.

http://stackoverflow.com/questions/19953653/how-to-set-up-postgres-database-for-local-rails-project

Add the following line to /etc/postgresql/9.4/main/pg_hba.conf: local all gitlytics md5

create user: gitlytics

restart postgres: sudo service postgresql restart

rake db:create

Best Practices

CSS Styles

The CSS styling is handled in app/assets/stylesheets/, but do not edit the global css file application.css. Instead edit the scss file application.scss which is in the same directory and compile by running ./compileCSS.sh. This is scss sytax, which is like css but includes variable names and several other useful css improvements. Teach me how to scss.

Global HTML header

The code in app/views/layouts/application.html.erb is applied to each HTML page globally. So things like the page titles, bootstrap include, and global font are here only once and therefore do not need to be included in any other html files.

Image minification

If you add even a single image to the repo, perform a lossless minification with optipng filename. This saves on our total repo size without sacrificing quality

Credits

Font generated by flaticon.com under creativecommons 3.0. The authors are: Freepik