okturtles / group-income Goto Github PK
View Code? Open in Web Editor NEWVoluntary Basic Income system that's decentralized and end-to-end encrypted.
Home Page: https://groupincome.org
License: GNU Affero General Public License v3.0
Voluntary Basic Income system that's decentralized and end-to-end encrypted.
Home Page: https://groupincome.org
License: GNU Affero General Public License v3.0
Either via a modal or via a new page, we need a way to log the user in, and then a button to log them out.
At some point we should also go over how we're taking your markup and integrating it with the build system and Vue js. There are some things that would make that simpler for us to do (like not having special classes on the body
tag, not having special "padding" in general, or at least make it consistent across all .html
files so that class variables can be replaced with template strings like {{page-class}}
to templatify the whole thing).
Babel recommends against using transform-runtime
/babel-register
and against using babel-node
in production.
Instead we should have grunt dist
generate a dist/backend/server.js
file and run that with plain old node (and moving what's currently in dist/
into dist/frontend
).
EDIT: see this!
See also: #73 — Start moving project over to Node 7
Check out the handy list of links here: https://github.com/okTurtles/group-income-simple/wiki/Architecture-Notes#misc-useful-things
Bulma is based on flexbox and seems quite awesome:
/cc @brodeur
Without being able to use async/await JS code can get unwieldy. We have support for babel everywhere except ejs templates (I think?).
vueify gives an example of how to do this. it's pretty simple:
var options = require('./options')
var babel = require('babel-core')
module.exports = function (raw, cb) {
try {
var res = babel.transform(raw, options.babel || {})
} catch (err) {
return cb(err)
}
cb(null, res.code)
}
preparse the templates and replace what's inside the delimiters with the output of babel, then pass it to ejs.
Requires some hack-foo while we're using Gruntfile.js (see #23).
Instead of:
.catch(function (err) {
logger(err)
reply(err)
})
Do:
.catch(function (err) {
logger(err)
reply(ErrToBoom.badRequest(err))
})
Per: http://hapijs.com/api/#error-transformation
Already did this for user.js
, just needs to be done everywhere else.
Convert assert
usage to should
.
EDIT: we don't need to convert the existing stuff. assert
is perfectly fine and actually has an elegance to it. Might only use should
where assert
is less elegant.
See TODO in user.js
People aren't telepathic.
Draft description of "Group Income Simple" for the About page. Explain what's similar to and different from Group Income.
Dependencies can be taken offline (availability) or become compromised (security).
We can create forks of all dependencies we use, and also reference them by git hash. Also, we can use Yarn (#120), and we "shrinkwrap" them (i.e. simply put them in this repo).
Look through dist/app.js
for things we don't need or could easily replace with something else.
Off-hand I'm noticing:
Obviously minifying the app.js
file will help to reduce line count too.
EDIT:
Low-hanging fruit, should be simple. If you don't have time for this feel free to assign to me, but it's probably less than 30 minutes of work.
Basically make npm test
be an alias for grunt test
(via package.json
), and have it:
standard
(just add a call to 'standard'
in the array for grunt.registerTask
)test/index.js
, which should launch the API server (just like DNSChain's test files launch a DNSChain instance) so that when grunt test
is invoked all the tests work without having to run any other command from the terminalPotentially useful:
require
HTML/CSS and other text files. Can then potentially manually search/replaceIt's insecure to download and run random code form the net.
Ideally, a simple way to chroot/sandbox it by specifying:
something like containers/docker/unikernels.
See if it's possible to design project such that it's a requirement to develop using the sandbox (i.e. project won't function/run otherwise).
We're not sure what the best way for distributing funds (that works, & meets member needs and local laws) will be.
Define what the user experience will be in terms of sending money.
This issue is somewhat related to #37.
Use grunt-webpack
See webpack for browserify users (and browserify for webpack users)
Get the component hot-reload thing working
Ensure it's simple to switch back to browserify
Make a note of the browserify and webpack related dev dependencies in a wiki, then replace the browserify deps with webpack equivalents
Webpack dependencies:
npm i -D grunt-webpack babel-loader css-loader ejs-html-loader vue-html-loader vue-style-loader vue-loader webpack webpack-dev-server
Make it clear how "vendor" related JS (i.e. jquery, modernizer, etc.) gets added and used by the project
Either in a Wiki or frontend/simple/README.md
(and linked to from README.md
) add docs explaining:
main.js
(consider creating an issue to create an isolated and easier-to-edit routes.js
file)Architecture Stack Overview
section.HTTP(S) is an insecure mess.
Make sure the website does all the CORS / same origin stuff especially!
hapi
to add CORS to API requests! http://hapijs.com/api/#serverrouteoptionsUseful plugins:
Useful libraries:
Misc:
It's super annoying that Grunt doesn't support ES6 cleanly yet (hacks are needed). We need es6 support in grunt (via babel) in order to use async
/await
syntax in the tests.
Depends on #8.
Dependencies go out of date and some are security issues are discovered.
Benchmark the site and see how much is transferred. If it's not much this isn't necessary, but if it is then this needs to be done.
See: https://vuejs.github.io/vue-router/en/lazy.html
It's more elegant in Webpack (#44) to do this, but it can be done with browserify too (just involves an extra .json
file).
We'll at some point need to be able to deploy GI to a running server.
Background:
grunt dev
as the only way of serving the app.chel serve
which is the ideal way that this issue would be closedchel serve
would be implementing grunt serve
- the idea of which would be to serve an optimized production build of the app.I think whether we do chel serve
or grunt serve
first, we need a command to generate a build of the app that is production optimized. Currently we only generate a development build.
So a possible route forward would be to:
grunt deploy
command that uses esbuild
to create a production bundle of the appgrunt serve <folder>
that just runs the server on port 8000 by default (and not browsersync
). Make sure to take into account the contracts
folder (perhaps grunt deploy
would copy the contracts
folder into a directory containing the groupincome bundle).
chel serve
is essentially the same thing, but more difficult to implement because the chel
command doesn't have the Chelonia server in it (that's still here in Group Income under the backend/
folder)See:
EDIT: Another possibility is making it possible install a groupincome
command via npm install -g
and running that.
The point is our current approach of running grunt dev
is not appropriate for deploying to a server, and we need something simpler and without the overhead of grunt dev
.
Differences between "Group Income Simple" (GIS) and "Group Income" (GI) will impact the tests of GIS.
Brainstorm and document differences between GIS and GI. Where possible and feasible, include suggestions of how to adjust GIS to be as close to GI as possible
We can start looking into this once we've got the components finished — #6
This issue can be easily split up among multiple people.
First we should make a survey of all of the components to be extracted out of the HTML and into .vue files (i.e. make a list here), and then have at it!
EDIT: Many of these components are too simple to be worth creating .vue
files out of. For those we just stick to the regular old markup and ignore (unless there's an obvious reason not to) the idea of making Vue components out of them. These I've marked, for now at least, "TOO SIMPLE — SKIP!"
For now we will use .vue
files primarily as pages. Only if it meaningfully improves the markup should we be spending our times creating components out of things that are already effectively components (like <button>
). It may even be worth considering avoiding the use of Vue.js and simply relaying on the Hapi backend to render template-based views directly (that would mean serving "normal" HTML files instead of this tiny skeleton). I've created issue #6 for this purpose.
Here are the components I've isolated:
Note that as per new-user.html
it can have a $
at the start and an optional image in the description!
This is made up of the above components!
It should also be flexible enough to look like the box on user-profile.html
!
pay-group.html
We don't know for certain what UX for payments groups will like best.
Set up a trial of various payment structures:
We need to be able to signify that people are using a version of Group Income that we plan on significantly changing.
The site needs to clearly distinguish between the two versions, and on the about page (#7) we can have a blurb explaining the difference.
server.auth.strategy('cookie_strategy', 'cookie', {
password: 'abcdef',
cookie: 'group-income-simple',
ttl: 2592000000, // 1 month
isSecure: false // HTTP allowed
})
What's the reason isSecure
is set to false
there?
gr2m/hapi-cors-headers#2 (comment)
So, I get the part about the security issue, but why isn't it a simple config option in Hapi to say:
allowedDomains: ['domain1.com', 'domain2.com']
?
Requiring modules will import all of their code when sometimes you only need a fraction. This bloats and slows the app.
Main issue is slowness. See: standard/standard#459
People use radically different resolution displays, and assets that look good on one don't look good on the other.
most of these from http://vuejs.org/guide/application.html
grunt test
(#8) multiple timesUseful libraries:
Useful links:
There are TODOs in the code that need to-doing to to-get-rid-of-ing.
EJS currently doesn't work within .vue
files, which isn't a big deal but would be neat if it did:
<template lang="ejs">
<div><%- include views/included %></div>
<template>
Corresponding issue in vue-loader
: vuejs/vue-loader#197
Note: if views/included.ejs
is modified and saved the change might not propagate through webpack-dev-server
(which we aren't using atm, so might not be an issue).
See http://hapijs.com/tutorials/views + new edits to #6.
Hapi's vision plugin homepage has great examples of how to set this up and what templating languages are supported.
.html
files like jekyll does it?.vue
files that are unneeded.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.