App

πŸ’‘ Idea

An desktop app that take screenshot every specified minutes and upload to the server so your manager can track your work progress (read micro management).

πŸ“ Requirements

  • Not electron
  • Cross platform
  • Fun to develop

πŸ› οΈ Tech Stack

  • Wails with Golang for OS level’s tasks

  • Vue for frontend (UI will be simple, so Vue, React, Angular, whatsoever is fine)

πŸ’… Design

I found the Linear design system is very cool and it has a community version in Figma https://www.figma.com/community/file/1222872653732371433/linear-design-system, so let’s use it.

Figma

πŸš€ Development

Wails doc is good enough, so I will just write down some notes here.

wails init -n myproject -t vue-ts

Ok we got this, basically a Go application with Vue inside the frontend directory

.
β”œβ”€β”€ README.md
β”œβ”€β”€ app.go
β”œβ”€β”€ build
β”‚Β Β  β”œβ”€β”€ README.md
β”‚Β Β  β”œβ”€β”€ appicon.png
β”‚Β Β  β”œβ”€β”€ bin
β”‚Β Β  β”‚Β Β  └── myproject.app
β”‚Β Β  β”‚Β Β      └── Contents
β”‚Β Β  β”‚Β Β          β”œβ”€β”€ Info.plist
β”‚Β Β  β”‚Β Β          β”œβ”€β”€ MacOS
β”‚Β Β  β”‚Β Β          β”‚Β Β  └── myproject
β”‚Β Β  β”‚Β Β          └── Resources
β”‚Β Β  β”‚Β Β              └── iconfile.icns
β”‚Β Β  β”œβ”€β”€ darwin
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ Info.dev.plist
β”‚Β Β  β”‚Β Β  └── Info.plist
β”‚Β Β  └── windows
β”‚Β Β      β”œβ”€β”€ icon.ico
β”‚Β Β      β”œβ”€β”€ info.json
β”‚Β Β      β”œβ”€β”€ installer
β”‚Β Β      β”‚Β Β  β”œβ”€β”€ project.nsi
β”‚Β Β      β”‚Β Β  └── wails_tools.nsh
β”‚Β Β      └── wails.exe.manifest
β”œβ”€β”€ frontend
β”‚Β Β  β”œβ”€β”€ READ-THIS.md
β”‚Β Β  β”œβ”€β”€ README.md
β”‚Β Β  β”œβ”€β”€ index.html
β”‚Β Β  β”œβ”€β”€ package.json
β”‚Β Β  β”œβ”€β”€ src
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ App.vue
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ assets
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ fonts
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  β”œβ”€β”€ OFL.txt
β”‚Β Β  β”‚Β Β  β”‚Β Β  β”‚Β Β  └── nunito-v16-latin-regular.woff2
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── images
β”‚Β Β  β”‚Β Β  β”‚Β Β      └── logo-universal.png
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ components
β”‚Β Β  β”‚Β Β  β”‚Β Β  └── HelloWorld.vue
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ main.ts
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ style.css
β”‚Β Β  β”‚Β Β  └── vite-env.d.ts
β”‚Β Β  β”œβ”€β”€ tsconfig.json
β”‚Β Β  β”œβ”€β”€ tsconfig.node.json
β”‚Β Β  β”œβ”€β”€ vite.config.ts
β”‚Β Β  └── wailsjs
β”‚Β Β      β”œβ”€β”€ go
β”‚Β Β      β”‚Β Β  └── main
β”‚Β Β      β”‚Β Β      β”œβ”€β”€ App.d.ts
β”‚Β Β      β”‚Β Β      └── App.js
β”‚Β Β      └── runtime
β”‚Β Β          β”œβ”€β”€ package.json
β”‚Β Β          β”œβ”€β”€ runtime.d.ts
β”‚Β Β          └── runtime.js
β”œβ”€β”€ go.mod
β”œβ”€β”€ go.sum
β”œβ”€β”€ main.go
└── wails.json

Install Tailwinds

cd myproject/frontend

# More here πŸ‘‰ https://v2.tailwindcss.com/docs/guides/vue-3-vite
npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
npx tailwindcss init -p

Wails will bind Go code to Window and generate corresponding Typescript for us, so we can use it in frontend.

Ok let’s implement the UI first. It’s all about me, Tailwind classes and Vue components, nothing fancy here. It took me about 1 hours Sunday afternoon to get this screen.

Ui

(To be continue…)