The new Ripple frontend.
  • JavaScript 47.4%
  • CSS 39.7%
  • Less 8.5%
  • Go 3%
  • HTML 1.4%
Find a file
2019-08-23 11:43:03 +02:00
data Ranking criteria fixes 2019-07-29 00:07:31 +02:00
modules Updated hardcoded server ips 2019-06-03 00:04:42 +02:00
routers Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
scripts Update locales 2018-02-25 12:17:28 +01:00
semantic Fix placeholder color being completely white 2017-01-05 22:42:41 +01:00
services Revert "Use relative addresses for working with local modules." 2017-12-29 15:25:04 -06:00
static Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
templates Ranking criteria fixes 2019-07-29 00:07:31 +02:00
vendor Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
website-docs@1bd4238f62 Updated submodule website-docs 2019-08-23 11:42:28 +02:00
.drone.yml add drone 2018-04-28 21:57:44 +02:00
.editorconfig add drone 2018-04-28 21:57:44 +02:00
.eslintrc eslint config 2017-12-30 17:06:59 -06:00
.gitignore Add basic oauth flow 2017-06-10 09:06:05 +02:00
.gitmodules Add submodule website-docs 2017-05-02 15:11:02 +02:00
2fa.go append query to redir URL in 2fa 2017-07-31 15:41:52 +02:00
avatar.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
beatmap.go merge appends and remove shiet 2018-01-06 10:36:02 -06:00
context.go fix breaking changes 2018-01-01 18:49:57 +01:00
dev.go Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
doc.go ⬆️ v1.8.6 ⬆️ 2018-05-14 20:50:47 +02:00
errors.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
funcmap.go Play Time 2019-05-17 00:22:35 +02:00
Gopkg.lock Bancho API privs, Bancho OAuth, update api vendor 2019-07-20 13:20:19 +02:00
Gopkg.toml require license to be agreed before starting hanayo 2018-02-04 12:00:10 +01:00
gulpfile.js make dark site a real setting instead of an easter egg 2018-01-01 20:32:40 +01:00
helpers.go pass valid context to Exchange code 2018-01-24 22:59:17 +01:00
irc.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
LICENSE Forgetting we are using GNU AGPL: check 2016-12-08 14:24:07 +01:00
loadchangelog.go Support for new changelog format 2018-12-20 18:48:57 +01:00
localisation.go Revert "Use relative addresses for working with local modules." 2017-12-29 15:25:04 -06:00
login.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
main.go require license to be agreed before starting hanayo 2018-02-04 12:00:10 +01:00
messages.go Add messages system (for {error,success,info,...} messages) 2016-07-04 16:18:50 +02:00
oauth.go Revert "Use relative addresses for working with local modules." 2017-12-29 15:25:04 -06:00
package.json Start implementing localisation in JavaScript 2017-04-02 17:45:29 +02:00
profbackground.go Slight increase of 13% of profile background quality 2017-04-11 18:55:49 +02:00
profile.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
pw.go Create token revocation page 2017-07-26 16:28:49 +02:00
rate_limiter.go use getContext instead of MustGet("context").(context) 2016-10-22 17:12:58 +02:00
README.md Explain why you shouldn't write code like hanayo in the README 2018-06-02 20:41:43 +02:00
recovery.go Update vendor 2017-02-12 12:05:00 +01:00
register.go Don't add user to leaderboard when they register 2017-04-11 23:20:54 +02:00
semantic.json Display achievements on user profiles 2018-01-23 20:34:57 +01:00
sessions.go Make Language set in the Context, not by the template 2017-05-02 15:15:05 +02:00
simple.go ADD EVERYTHING TO TEMPLATES FILE OH YEAH 2017-04-04 21:53:27 +02:00
startuato_linux.go deploy a specific branch 2017-07-10 13:52:23 +02:00
startuato_windows.go When refreshing templates, restart the entire webserver 2016-11-03 17:52:37 +01:00
templates.go ignore non-html files while loading templates 2018-01-23 15:52:38 +01:00
tracking.go Move from git.zxq.co to zxq.co 2017-01-14 19:15:25 +01:00
yarn.lock Start implementing localisation in JavaScript 2017-04-02 17:45:29 +02:00

Hanayo build status

This repository has a mirror here. The original repo is still here.

To fellow developers: this is not how you do it!

The biggest flaw of hanayo are that when I set out to create it, I wanted to create a template system that:

  • Created a handler by simply having the file "be there"
  • Could fetch the data it needed on its own, often from the Ripple API
  • Had the actual Go code be as little as possible

This was not immediately evident to me, a Go beginner, but what I did there was basically make Go be PHP.

The biggest lesson I learned on how to properly do templates, was learning to use Vue. Yes, Vue can be used for the frontend and not really for server-rendered stuff, but even just learning how to do stuff with it can help you understand what a template is actually supposed to be in order to be maintainable.

The key concepts and insights for me where:

  • Separating clearly code and markup, making the template declarative and keeping as little code in the template
  • A template should be purely functional. Its mere creation should not generate side effects, nor should it be dependent on things that are not its precise inputs: for a given input there is a specific output.
  • The concept of component as a single self-contained entity which is the same wherever you use it is very powerful.
  • Once a template/component starts becoming too big, split it into more components.

But don't stop here. Actually making a project using Vue helps you to understand this much more easily than using mere words. Go ahead and build something, even if just to play around!