-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path30-projects.slide
179 lines (121 loc) · 4.65 KB
/
30-projects.slide
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# Projects
## Use cases
- CLI
- TUI
- Desktop
- Web
- Open-source
## CLI
## cobra
- Used by [many projects](https://github.com/spf13/cobra/blob/main/site/content/projects_using_cobra.md)
- Kubernetes, GitHub CLI, ...
- From the creator of [Viper](https://github.com/spf13/viper)
- The app is built using a structure of [commands](https://pkg.go.dev/github.com/spf13/cobra#Command), arguments and flags
- Includes a `cobra-cli`
- Setup the project
- Add new commands
- Generate autocompletion scripts
[GitHub: cobra](https://github.com/spf13/cobra)
[Digital Ocean: How To Use the Cobra Package](https://www.digitalocean.com/community/tutorials/how-to-use-the-cobra-package-in-go)
## cobra (1/2)
.code assets/projects/cli/cobra.go /START OMIT/,/MIDDLE OMIT/
## cobra (2/2)
.code assets/projects/cli/cobra.go /MIDDLE OMIT/,/END OMIT/
## cli
- Backed by the same maintainers as [negroni](https://github.com/urfave/negroni)
- Features:
- Flexible and permissive help system
- Shell completions
- `man` and markdown docs generating
- Again, custom structures for commands and flags
[GitHub: cli](https://github.com/urfave/cli)
[Urfave CLI: Manual](https://cli.urfave.org/v2/getting-started/)
## cli (1/2)
.code assets/projects/cli/cli.go /START OMIT/,/MIDDLE OMIT/
## cli (2/2)
.code assets/projects/cli/cli.go /MIDDLE OMIT/,/END OMIT/
[Urfave CLI: Examples](https://cli.urfave.org/v2/examples/greet/)
## TUI
## Bubbletea
- Project under [charmbracelet](https://github.com/charmbracelet) organization
- TUI components with [bubbles](https://github.com/charmbracelet/bubbles)
- Style layouts with [lipgloss](https://github.com/charmbracelet/lipgloss)
- Animations with [harmonica](https://github.com/charmbracelet/harmonica)
- Foms and prompts with [huh](https://github.com/charmbracelet/huh)
- Pretty rich ecosystem with plenty of projects
```
type Model interface {
Init() Cmd
Update(Msg) (Model, Cmd)
View() string
}
```
[Charm](https://charm.sh)
[GitHub: bubletea](https://github.com/charmbracelet/bubbletea)
## Bubbletea (1/3)
.code assets/projects/tui/bubbletea.go /START OMIT/,/UPDATE OMIT/
## Bubbletea (2/3)
.code assets/projects/tui/bubbletea.go /UPDATE OMIT/,/VIEW OMIT/
## Bubbletea (3/3)
.code assets/projects/tui/bubbletea.go /VIEW OMIT/,/END OMIT/
## Desktop
## Wails
- Lightweight alternative to [Electron](https://www.electronjs.org) or [Tauri](https://tauri.app)
- Uses web technologies for the frontend
- Javascript, CSS & HTML
- With a Go backend
- Built-in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS
- Wails generates Javascript bindings for your exposed Go code
[Wails](https://wails.io)
[GitHub: wails](https://github.com/wailsapp/wails)
## Wails
.code assets/projects/desktop/wails.go /START OMIT/,/END OMIT/
## Fyne
- GUI toolkit
- Inspired by Material Design
- Supports many platforms
- All major OSs and even mobile
- Custom `fyne` CLI for building the apps
- Defines containers, layouts, widgets, collections etc.
- Supports two-way data bindings
- The maintainars also built a Linux distro using Fyne
- [FyshOS](https://github.com/FyshOS/fynedesk)
[Fyne](https://fyne.io)
[GitHub: Fyne](https://github.com/fyne-io/fyne)
## Fyne
.code assets/projects/desktop/fyne.go /START OMIT/,/END OMIT/
## Web
## HTMX
- HTML extension
- Allows to access AJAX using mark-up
- `GET`/`POST`/`PUT`/`PATCH`/`DELETE`
- Triggers
- Targets
- Swapping
- Supports Web Sockets
- HTMX expects HTML fragments in reponses
- Can be easily added to the mark-up
```
<script src="https://unpkg.com/[email protected]"></script>
```
[HTMX](https://htmx.org)
## HTMX
.code assets/projects/web/htmx.html
[HTMX: Examples](https://htmx.org/examples/)
## Go with a frontend framework
- [React](https://react.dev) is not the only way
- [Vue.js](https://vuejs.org)
- [Angular](https://angular.io)
- [Svelte](https://svelte.dev)
- [SolidJS](https://www.solidjs.com)
- Or just wait a couple of days for the next one to drop
## Open-source
## Open-source
- Most of the technologies presented throughout this course are written in Go
- Getting started:
- [Introduction to GitHub and Open-Source Projects](https://www.digitalocean.com/community/tutorial-series/an-introduction-to-open-source)
- [Github Trending Go Repositories](https://github.com/trending/go?since=monthly)
- [Github Hacktoberfest Go Pepositories](https://github.com/topics/hacktoberfest?l=go)
- [Hacktoberfest Go Projects](https://hacktoberfest-projects.vercel.app/repos/Go?p=2)
- [Up for Grabs Go](https://up-for-grabs.net/#/filters?tags=go)
- [Awesome Go](https://github.com/avelino/awesome-go)