├── .gitignore
├── README.md
├── app.tmpl.go
├── frontend
└── src
│ ├── assets
│ ├── fonts
│ │ ├── OFL.txt
│ │ └── nunito-v16-latin-regular.woff2
│ └── images
│ │ └── logo-universal.png
│ ├── index.html
│ ├── libs
│ └── .gitkeep
│ ├── main.css
│ └── main.js
├── go.sum
├── go.tmpl.mod
├── main.tmpl.go
├── template.json
└── wails.tmpl.json
/.gitignore:
--------------------------------------------------------------------------------
1 | # After editing .gitignore to match the ignored files, you can do < git ls-files -ci --exclude-standard >
2 | # to see the files that are included in the exclude lists; you can then do
3 | #
4 | # @ Linux/MacOS: < git ls-files -ci --exclude-standard -z | xargs -0 git rm --cached >
5 | # @ Windows (PowerShell): < git ls-files -ci --exclude-standard | % { git rm --cached "$_" } >
6 | # @ Windows (cmd.exe): < for /F "tokens=*" %a in ('git ls-files -ci --exclude-standard') do @git rm --cached "%a" >
7 | # ...to re-init the ignore list
8 |
9 | # Wails directories
10 | build/bin
11 | frontend/wailsjs
12 |
13 | # Wails junk files
14 | .syso
15 |
16 | # Go files
17 | go.sum
18 |
19 | # IDEs
20 | .idea
21 | .vscode
22 |
23 | # System enviroment variables
24 | env
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | ## About
2 |
3 | This is an extremely straightforward Wails template, comprising essential web components (HTML, CSS, JS) and intentionally lacking any front-end frameworks, dependencies, or Node package management.
4 | As a result, you'll end up with an exceptionally lightweight source folder (1 - 5MB).
5 |
6 | That being said, this is a good template for something like a ``Hello World`` application, which doesn't require you to store ~200-300MB of source files.
7 |
8 | ## Instruction
9 |
10 | 1. Do all the setup/ installation for [Wails](https://wails.io/docs/gettingstarted/installation).
11 | 2. Open command prompt on your desire directory.
12 | 3. ``> wails init -n [your-app-name] -t https://github.com/KiddoV/wails-pure-js-template``
13 | 4. ``> cd ./[your-app-name]``
14 | 5. ``> wails dev``
15 | 6. Keep developing...
16 |
17 | ## Live Development
18 |
19 | To run in live development mode, run `wails dev` in the project directory. The frontend dev server will run on http://localhost:34115. Connect to this in your browser and connect to your application.
20 |
21 | ## Building
22 |
23 | To build a redistribute, production mode package, use `wails build`.
24 |
25 | Or build with [UPX](https://upx.github.io/) for better distribution size: ``wails build -upx -upxflags="--best --lzma"``
26 |
27 | To use ``UPX``, you need to download and at least put the path in the ``System Enviroment Variables``:
28 |
29 | *Windows*
30 | 
31 |
32 | ## Adding Dependencies
33 |
34 | You don't have to rely on ``npm`` to add dependencies.
35 |
36 | If your application requires internet access, you can add dependencies via a ``CDN`` links.
37 |
38 | If your application is used offline, simply download dependencies and save them in the ``src/libs`` folder, then import them in the index.html file.
39 |
40 | E.g.
41 | ```html
42 |
43 | ```
--------------------------------------------------------------------------------
/app.tmpl.go:
--------------------------------------------------------------------------------
1 | package main
2 |
3 | import (
4 | "context"
5 | "fmt"
6 | )
7 |
8 | // App struct
9 | type App struct {
10 | ctx context.Context
11 | }
12 |
13 | // NewApp creates a new App application struct
14 | func NewApp() *App {
15 | return &App{}
16 | }
17 |
18 | // startup is called at application startup
19 | func (a *App) startup(ctx context.Context) {
20 | // Perform your setup here
21 | a.ctx = ctx
22 | }
23 |
24 | // domReady is called after front-end resources have been loaded
25 | func (a App) domReady(ctx context.Context) {
26 | // Add your action here
27 | }
28 |
29 | // beforeClose is called when the application is about to quit,
30 | // either by clicking the window close button or calling runtime.Quit.
31 | // Returning true will cause the application to continue, false will continue shutdown as normal.
32 | func (a *App) beforeClose(ctx context.Context) (prevent bool) {
33 | return false
34 | }
35 |
36 | // shutdown is called at application termination
37 | func (a *App) shutdown(ctx context.Context) {
38 | // Perform your teardown here
39 | }
40 |
41 | // Greet returns a greeting for the given name
42 | func (a *App) Greet(name string) string {
43 | return fmt.Sprintf("Hello %s, It's show time!", name)
44 | }
45 |
--------------------------------------------------------------------------------
/frontend/src/assets/fonts/OFL.txt:
--------------------------------------------------------------------------------
1 | Copyright 2016 The Nunito Project Authors (contact@sansoxygen.com),
2 |
3 | This Font Software is licensed under the SIL Open Font License, Version 1.1.
4 | This license is copied below, and is also available with a FAQ at:
5 | http://scripts.sil.org/OFL
6 |
7 |
8 | -----------------------------------------------------------
9 | SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10 | -----------------------------------------------------------
11 |
12 | PREAMBLE
13 | The goals of the Open Font License (OFL) are to stimulate worldwide
14 | development of collaborative font projects, to support the font creation
15 | efforts of academic and linguistic communities, and to provide a free and
16 | open framework in which fonts may be shared and improved in partnership
17 | with others.
18 |
19 | The OFL allows the licensed fonts to be used, studied, modified and
20 | redistributed freely as long as they are not sold by themselves. The
21 | fonts, including any derivative works, can be bundled, embedded,
22 | redistributed and/or sold with any software provided that any reserved
23 | names are not used by derivative works. The fonts and derivatives,
24 | however, cannot be released under any other type of license. The
25 | requirement for fonts to remain under this license does not apply
26 | to any document created using the fonts or their derivatives.
27 |
28 | DEFINITIONS
29 | "Font Software" refers to the set of files released by the Copyright
30 | Holder(s) under this license and clearly marked as such. This may
31 | include source files, build scripts and documentation.
32 |
33 | "Reserved Font Name" refers to any names specified as such after the
34 | copyright statement(s).
35 |
36 | "Original Version" refers to the collection of Font Software components as
37 | distributed by the Copyright Holder(s).
38 |
39 | "Modified Version" refers to any derivative made by adding to, deleting,
40 | or substituting -- in part or in whole -- any of the components of the
41 | Original Version, by changing formats or by porting the Font Software to a
42 | new environment.
43 |
44 | "Author" refers to any designer, engineer, programmer, technical
45 | writer or other person who contributed to the Font Software.
46 |
47 | PERMISSION & CONDITIONS
48 | Permission is hereby granted, free of charge, to any person obtaining
49 | a copy of the Font Software, to use, study, copy, merge, embed, modify,
50 | redistribute, and sell modified and unmodified copies of the Font
51 | Software, subject to the following conditions:
52 |
53 | 1) Neither the Font Software nor any of its individual components,
54 | in Original or Modified Versions, may be sold by itself.
55 |
56 | 2) Original or Modified Versions of the Font Software may be bundled,
57 | redistributed and/or sold with any software, provided that each copy
58 | contains the above copyright notice and this license. These can be
59 | included either as stand-alone text files, human-readable headers or
60 | in the appropriate machine-readable metadata fields within text or
61 | binary files as long as those fields can be easily viewed by the user.
62 |
63 | 3) No Modified Version of the Font Software may use the Reserved Font
64 | Name(s) unless explicit written permission is granted by the corresponding
65 | Copyright Holder. This restriction only applies to the primary font name as
66 | presented to the users.
67 |
68 | 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69 | Software shall not be used to promote, endorse or advertise any
70 | Modified Version, except to acknowledge the contribution(s) of the
71 | Copyright Holder(s) and the Author(s) or with their explicit written
72 | permission.
73 |
74 | 5) The Font Software, modified or unmodified, in part or in whole,
75 | must be distributed entirely under this license, and must not be
76 | distributed under any other license. The requirement for fonts to
77 | remain under this license does not apply to any document created
78 | using the Font Software.
79 |
80 | TERMINATION
81 | This license becomes null and void if any of the above conditions are
82 | not met.
83 |
84 | DISCLAIMER
85 | THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88 | OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89 | COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90 | INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91 | DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92 | FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93 | OTHER DEALINGS IN THE FONT SOFTWARE.
94 |
--------------------------------------------------------------------------------
/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KiddoV/wails-pure-js-template/6691cce276e22c482991980fe0a68262420b9781/frontend/src/assets/fonts/nunito-v16-latin-regular.woff2
--------------------------------------------------------------------------------
/frontend/src/assets/images/logo-universal.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/KiddoV/wails-pure-js-template/6691cce276e22c482991980fe0a68262420b9781/frontend/src/assets/images/logo-universal.png
--------------------------------------------------------------------------------
/frontend/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |