go-sample-webpage/readme.md

47 lines
1.4 KiB
Markdown
Raw Normal View History

2021-11-08 01:34:32 +00:00
# Sample Webapplication in Go
Sample Webapplication in go, create a kind of skeleton for monolith webapplicaion. Useed to create a small MVP Project.
## Structur
Create (self contained) pkg for a group of pages. The pkg included the View and Go files for the Pages e.g. user pages.
2021-11-08 01:25:36 +00:00
## Including Packages
* https://github.com/go-chi/chi -> Routing and middelware
* https://github.com/go-chi/jwtauth -> For JWT Auth
* https://github.com/golang-migrate/migrate -> for mysql migration
* https://github.com/urfave/cli -> for cli commands like migration
2021-11-03 01:18:09 +00:00
2021-11-08 01:34:32 +00:00
# Features
## Global Layout
The "globale layout" is put arround each response from a pkg web response. It read the response buffer from and use the content to parse the layout.tmpl. It works via middelware
## JWT-Auth
*todo*
## Migrations
Its possitlbe to execute the migrations via `go run ./ migrate`. It execute the migration files in database/migrations/*.sql
## One Binary
Everything (include templaes and migration) can be added in one binary
## Make commands
*todo*
# Dev
2021-11-03 01:18:09 +00:00
2021-11-08 01:25:36 +00:00
Test für das entwickeln von Monolith webanwendung mit html gui in go.
2021-11-03 01:18:09 +00:00
Es gibt unabhängige packages im pkg ordner die eine oder mehrere seiten beinhalten können. Jedes pkg beinhaltet alles um funktionieren zu können.
Das layout gibt es einmal zentral und wird per chi middelware reingereicht.
2021-11-04 01:24:38 +00:00
Alles ist in einem binary
2021-11-08 01:34:32 +00:00
# next steps
2021-11-08 01:25:36 +00:00
* conifg per env
* makefile
2021-11-08 02:33:36 +00:00
* ci/Cd bis docker image bauen
* Hot reload while develop