├── Procfile
├── .gitattributes
├── .gitignore
├── static
├── hero.png
├── logo.png
├── octocat.png
├── mixpanel.js
├── style.css
└── newrelic.js
├── README.md
├── .env.format
├── views
├── head.pug
├── generate.pug
├── new.pug
├── done.pug
├── mixpanel.pug
└── hi.pug
├── newrelic.js
├── package.json
└── index.js
/Procfile:
--------------------------------------------------------------------------------
1 | web: node index.js
2 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | views linguist-documentation
2 | * linguist-language=JavaScript
3 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | logs
2 | *.log
3 | npm-debug.log*
4 | node_modules
5 | .env
6 | .DS_Store
7 |
--------------------------------------------------------------------------------
/static/hero.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siddharthkp/pay-with-a-star/HEAD/static/hero.png
--------------------------------------------------------------------------------
/static/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siddharthkp/pay-with-a-star/HEAD/static/logo.png
--------------------------------------------------------------------------------
/static/octocat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/siddharthkp/pay-with-a-star/HEAD/static/octocat.png
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | [](https://paywithastar.herokuapp.com)
2 |
--------------------------------------------------------------------------------
/.env.format:
--------------------------------------------------------------------------------
1 | DEBUG=true # points to localhost in debug mode
2 | PORT=8080
3 | CLIENT_ID= github app client id
4 | CLIENT_SECRET=github app secret
5 | DATABASE_URL=path to database
6 | #MIXPANEL_TOKEN=mixpanel token (optional)
7 |
--------------------------------------------------------------------------------
/views/head.pug:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | include ./mixpanel.pug
7 |
--------------------------------------------------------------------------------
/newrelic.js:
--------------------------------------------------------------------------------
1 | 'use strict'
2 |
3 | /**
4 | * New Relic agent configuration.
5 | *
6 | * See lib/config.defaults.js in the agent distribution for a more complete
7 | * description of configuration variables and their potential values.
8 | */
9 | exports.config = {
10 | /**
11 | * Array of application names.
12 | */
13 | app_name: ['Pay with a star'],
14 | /**
15 | * Your New Relic license key.
16 | */
17 | license_key: process.env.NEWRELIC_KEY,
18 | logging: {
19 | /**
20 | * Level at which to log. 'trace' is most useful to New Relic when diagnosing
21 | * issues with the agent, 'info' and higher will impose the least overhead on
22 | * production applications.
23 | */
24 | level: 'info'
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/views/generate.pug:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pay with a star - Share link
4 | include ./head.pug
5 |
6 |
7 |
8 |

9 |

10 |
Here's your link
11 |
12 |
13 |
14 |
15 | script(type='text/javascript').
16 | document.getElementById('share-link').addEventListener('click', function() {
17 | mixpanel.track('Click sharing link');
18 | });
19 |
20 |
21 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "pay-with-a-star",
3 | "version": "1.0.0",
4 | "description": "Pay with a star",
5 | "main": "index.js",
6 | "scripts": {
7 | "test": "echo \"Error: no test specified\" && exit 1",
8 | "start": "node index.js"
9 | },
10 | "repository": {
11 | "type": "git",
12 | "url": "github.com/siddharthkp/pay-with-a-star"
13 | },
14 | "keywords": [
15 | "pay",
16 | "github",
17 | "star"
18 | ],
19 | "author": "siddharthkp",
20 | "license": "ISC",
21 | "dependencies": {
22 | "body-parser": "1.15.2",
23 | "dotenv": "2.0.0",
24 | "express": "4.14.0",
25 | "newrelic": "1.28.3",
26 | "pg": "6.0.3",
27 | "pug": "2.0.0-beta4",
28 | "raven": "0.11.0",
29 | "request": "2.74.0"
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/views/new.pug:
--------------------------------------------------------------------------------
1 |
2 |
3 | Pay with a star - Generate a link
4 | include ./head.pug
5 |
6 |
7 |
8 |

9 |

10 |
Create your own link
11 |
12 |
13 |
19 |
20 | script(type='text/javascript').
21 | mixpanel.track_forms('#new-form', 'Create link from new');
22 |
23 |
24 |
--------------------------------------------------------------------------------
/views/done.pug:
--------------------------------------------------------------------------------
1 |
2 |
3 | pay with a star - Thanks!
4 | include ./head.pug
5 |
6 |
7 |
8 |

9 |

10 |
Thanks for the star!
11 |
12 |
13 | script(type='text/javascript').
14 | var redirect_url = location.search.split('=')[1];
15 | document.getElementById('url').textContent = redirect_url;
16 | document.getElementById('url').href = redirect_url;
17 | mixpanel.track('Done page', {redirect_url: redirect_url});
18 | if (redirect_url) {
19 | window.setTimeout(function() {
20 | window.location = redirect_url;
21 | }, 3000);
22 | }
23 |
24 |
25 |
--------------------------------------------------------------------------------
/static/mixpanel.js:
--------------------------------------------------------------------------------
1 | (function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
2 | 0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
3 | for(h=0;h
2 |
3 | Pay with a star
4 | include ./head.pug
5 |
6 |
7 |
8 |

9 |

10 |
get paid in stars
11 |
for your open source work
12 |
13 |
14 |
15 |
1
16 |
Generate your link
17 |
18 |
19 |
2
20 |
People star your repo
21 |
22 |
23 |
3
24 |
They get access to content
25 |
26 |
27 |
28 |
31 |
40 | script(type='text/javascript').
41 | mixpanel.track_links('#demo-link', 'Demo link from home');
42 | mixpanel.track_forms('#home-form', 'Create link from home');
43 |
44 |