gratipay / grtp.co

Gratipay Widgets + API
https://grtp.co/
MIT License
26 stars 19 forks source link

Competence Debt #107

Closed techtonik closed 6 years ago

techtonik commented 8 years ago

There is a certain paralysis in http://grtp.co/ (Widgets) development. @whit537 who seems to know how is busy with more important things to put Gratipay back on track. @rummik who created it all switched to other stuff. And I, being a Python coder, lack the knowledge of JavaScript ecosystem to do any changes. So there is a clear need to pave a road how new (Python) people can quickly get up to speed.

"Tank, load the jump program."

What do you need to know to be able to write grtp.co

Or in other word, what is the structure of the competence debt - how much time it takes to recover.

  1. JavaScript (obvious) - take any tutorial (3 days)
  2. NPM - read official site (1 day) or read this intro (5 minutes)
  3. Grunt (switching to Gulp) - (2 days)

Due to a curse of knowledge, shortcuts are important - you may google for a day trying to understand how npm works, or you may read the info that is crafted specifically for your current knowledge state to switch you to the next level in a matter of seconds.

UPDATE (thanks @rummik for feedback):

What do you need to know to be able to maintain and deploy grtp.co site

  1. Linux - how to work in command line, where are configs/files, how to setup users (3 days)
  2. SSH - how to connect, how configure keys (3 days)
  3. Nginx - where is the config, how to locate site sources (1 day)
  4. Git - how to work with Git, where hook scripts are located, how are they executed (3 days)

So the total competence to setup and run grtp.co webserver is 11 + 10 = 21 days. A month of study.

chadwhitacre commented 8 years ago

Actually, @rummik is the one that set up grtp.co. :cat:

techtonik commented 8 years ago

!m @rummik

mattbk commented 8 years ago

+1, !m @techtonik for the initiative.

rummik commented 8 years ago

The way grtp.co works is it uses a git hook to run a grunt task to minify the assets, then uses NGINX to serve static files. Any rendering is done client-side using JS and HTML, and the same with pulling data from the Gratipay API.

V2 was going to be its own server that would run off a Heroku or Dokku instance, and exclusively used SVG for rendering (though there's a small route that would convert the SVGs to PNGs for legacy browsers)

@techtonik, @whit537 For some reason I'm not getting GitHub notifications like I used to, which is why I've been a great deal more dead than usual. Feel free to contact me more directly if there's anything I can help with on the grtp.co codebase. I'm pretty much always around on IRC.

Edit: V2 was pretty much ready when I stopped working on it. I can help get someone else up to speed if they'd like to continue development on it.

chadwhitacre commented 8 years ago

@rummik emerges! :dancer:

rummik commented 8 years ago

So apparently the extension I'm using updated and required a GH API key to handle things correctly. That's sorted now, so I should get updates on anything I'm tagged in from now on :P

chadwhitacre commented 8 years ago

@rummik Sounds about right. :-P

techtonik commented 8 years ago

Updated the info. The grtp.co competence is 21 days of learning from scratch (for a typical C/C++ coder on Windows).

@rummik perhaps you need to check if watch button is active. Maybe they are in spam folder, or maybe there is some email setting in Github. Anyway, I prefer to use https://github.com/notifications bookmark to go through notifications when I have time.

techtonik commented 8 years ago

For now I'd like to have a manual instruction how to setup grtp.co website on clean node, including user config etc.

rummik commented 8 years ago

It basically boils down to creating a new droplet, installing Nginx and Node.js, cloning the repo, then copying in the nginx.conf and post-receive hook from infra/.

This is from memory, so there may be something off:

  1. Set up a droplet on DO, and SSH in
  2. Install Nginx, Node.js, Git, and build-essential with apt-get install nginx nodejs git build-essential
  3. Add a grtp user adduser grtp
  4. Run sudo -u grtp mkdir -m 700 ~grtp/.ssh, then copy your SSH key to ~grtp/.ssh/authorized_keys
  5. Initialize an empty repository with sudo -u grtp git init ~grtp/production
  6. Locally, do a git remote add production grtp@<host>:production && git push production
  7. On the server, ln -s ~grtp/production/infra/nginx.conf /etc/nginx/sites-enabled/grtp.co
  8. And then install the git hook on the server with cp ~grtp/production/infra/post-receive ~grtp/production/infra/.git/hooks/

That should cover it. The v2 branch has a much more simplified setup as it deploys to Heroku/Dokku, and it should detail this in the readme file

rummik commented 8 years ago

@techtonik ^

techtonik commented 8 years ago

Awesome. Some questions:

  1. Install Nginx, Node.js, Git, and build-essential

Why build-essential is needed?

  1. Initialize an empty repository with sudo -u grtp git init ~grtp/production

Why not just clone into production?

rummik commented 8 years ago

Why build-essential is needed?

It isn't. I was on autopilot and thought build-essential would net us make

Why not just clone into production?

No good reason. Probably going with autopilot again causing me to suggest the roundabout way

This also misses the build step (running make)

techtonik commented 8 years ago

I am getting back to it after I gather my 3 pull requests for Heroku. In the meanwhile let's make a mindmap out of competence debt.

rummik commented 8 years ago

The v2 branch also rolled in Heroku support ^^;

rummik commented 8 years ago

I'd really recommend looking at it before getting too far, since it sounds like there's a lot of duplicate effort happening

techtonik commented 8 years ago

I can't merge or review v2, because it mixes, well v2 stuff that I don't know with Gulp/Grunt that I know. So, if those commits are split and rebased, I can merge at least Gulp/Grunt sooner.

techtonik commented 8 years ago

I may be able try to fork v2 and rearrange the commits, but chances are low.

rummik commented 8 years ago

I'll see what I can do. I've got work today, but I should be (relatively) free tonight and tomorrow

techtonik commented 8 years ago

nginx.conf mentions server certificates - this step is missing.

techtonik commented 8 years ago

https://medium.com/@pistacchio/i-m-a-web-developer-and-i-ve-been-stuck-with-the-simplest-app-for-the-last-10-days-fb5c50917df#.vf7bxc63a

I share the pain.

mattbk commented 8 years ago

@techtonik, since you might be the only other person who has a dev environment set up for this right now, is there a way you could review my recent PRs?

techtonik commented 7 years ago

@mattbk sorry, fell out of loop.

Have to raise this ticket again, because I can not update dependencies, because our tests are written for Dalek, test runner for Grunt is not updated to latest Grunt version, and command line runner for Dalek fails on my system (#170).

The solution is to either update grunt-dalek https://github.com/dalekjs/grunt-dalek/pull/13 and release new version on npm or to rewrite tests to supported framework.