This template should help get you started developing with Vue 3 PWA in Vite, with Pocetbase as backend.
🚨Important Notes🚨
You should probably just use nuxt or vitesse instead.
This template should help get you started developing with Vue 3 PWA in Vite, with pocketbase as backend. I've setup to deploy it on fly.io but you can deploy it anywhere.
backend
: backend contains all the backend codebackend/build
: contains all the build related files. Includes Dockerfile.backend/cmd
: contains all the files that direclty provide commands to the program. This would also include the starting point for our app.src
: contains all the front end source codesrc/assets
: contains all the assets you want bundled via vitesrc/components
: contains all the vue componentssrc/composables
: contains all the composables for the appsrc/layouts
: contains all the layouts and it's components for the appsrc/lib
: contains all the module level business logicsrc/main
: main entry point for the appsrc/pages
: contains all the top level page components for the appsrc/stores
: contains pinia storessrc/symbols
: contains symbols to use via provide/inject vue api@
is root of your frontend source code. i.e. ./src
VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar) + Go
.vue
Imports in TSTypeScript cannot handle type information for .vue
imports by default, so we replace the tsc
CLI with vue-tsc
for type checking. In editors, we need TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue
types.
If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:
Extensions: Show Built-in Extensions
from VSCode's command paletteTypeScript and JavaScript Language Features
, right click and select Disable (Workspace)
Developer: Reload Window
from the command palette.See Vite Configuration Reference.
pnpm install
cd backend
go mod tidy
cp .env.example .env
pnpm dev
cd backend
go run cmd/server/main.go serve
Note that it doesn't hot reload. yet. I'll add a makefile later
pnpm build
cd backend
go build -o server cmd/server/*.go
If you're using flyctl (Highly Recommended!)
cd backend
flyctl deploy --dockerfile build/Dockerfile
pnpm lint