Giter Site home page Giter Site logo

bagussatoto / kyoto Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kyoto-framework/kyoto

1.0 1.0 0.0 3.11 MB

Golang SSR-first Frontend Library

Home Page: https://kyoto.codes

License: MIT License

Go 59.82% Dockerfile 0.53% HTML 28.22% JavaScript 5.93% TypeScript 4.52% SCSS 0.97%

kyoto's Introduction

kyoto

An HTML render engine concept that brings frontend-like components experience to the server side with native html/template on steroids. Supports any serving basis (net/http/gin/etc), that provides io.Writer in response.

License Go Report Card Go Reference

Disclaimer
This project in early development, don't use in production! In case of any issues/proposals, feel free to open an issue

Installation

As simple as go get github.com/yuriizinets/kyoto
Check documentation page for quick start: https://kyoto.codes/docs/get-started.html

Usage

Kyoto project setup may seem complicated and unusual at first sight.
It's highly recommended to follow documentation while using library: https://kyoto.codes/docs/get-started.html

This example is not completely independent and just shows what the code looks like when using kyoto:

package main

import (
	"html/template"

	"github.com/yuriizinets/kyoto"
	"github.com/yuriizinets/kyoto-uikit/twui"
)

type PageIndex struct {
	Navbar kyoto.Component
}

func (p *PageIndex) Template() *template.Template {
	return mktemplate("page.index.html")
}

func (p *PageIndex) Init() {
	p.Navbar = kyoto.RegC(p, &twui.AppUINavNavbar{
		Logo: `<img src="/static/img/kyoto.svg" class="h-8 w-8 scale-150" />`,
		Links: []twui.AppUINavNavbarLink{
			{Text: "Kyoto", Href: "https://github.com/yuriizinets/kyoto"},
			{Text: "UIKit", Href: "https://github.com/yuriizinets/kyoto-uikit"},
			{Text: "Charts", Href: "https://github.com/yuriizinets/kyoto-charts"},
			{Text: "Starter", Href: "https://github.com/yuriizinets/kyoto-starter"},
		},
		Profile: twui.AppUINavNavbarProfile{
			Enabled: true,
			Avatar: `
					<svg class="w-6 h-6 text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"></path></svg>
				`,
			Links: []twui.AppUINavNavbarLink{
				{Text: "GitHub", Href: "https://github.com/yuriizinets/kyoto/discussions/40"},
				{Text: "Telegram", Href: "https://t.me/yuriizinets"},
				{Text: "Email", Href: "mailto:[email protected]"},
			},
		},
    })
}

References

Project main page: https://kyoto.codes/
Documentation: https://kyoto.codes/docs/
UIKit: https://github.com/yuriizinets/kyoto-uikit
Demo project, Hacker News client made with kyoto: https://hn.kyoto.codes/
Demo project, features overview: https://github.com/yuriizinets/kyoto/tree/master/.demo

Support

Buy me a Coffee

Or directly with Bitcoin: bc1qgxe4u799f8pdyzk65sqpq28xj0yc6g05ckhvkk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.