- Server Side Render (initial url load is created server-side.)
- based on https://github.com/frandiox/vite-ssr and https://github.com/web2033/vite-vue3-tailwind-starter
- uses vue 3 (composition api), vue-router, vueuse, vee-validate, universal-cookie, axios
- uses polka for ssr nodejs server and sirv
- uses Pinia for store https://pinia.esm.dev/
npm i
Run local dev (ssr version)
npm run dev-ssr
Run local (build) ssr (prod in local)
npm run serve-ssr:dist
Build ssr version
npm run build-ssr
Run local dev
npm run dev
Build spa
npm run build
Run local preview
npm run serve
-
rename
~.envto.envfor vite env config- VITE_API_BASEURI = the api uri
-
/src/pages/app- main app pages folder -
/src/routes- routing logic; seemiddleware.json how stack handles authentication;- uses
meta.authinroutes.jsfor protected pages
- uses
-
/src/stores- pinia stores;auth.jshandles authentication logic
- call images inside
/src/assestsfolder like<img src="@/assets/logo.png"> - SSR may sometimes will not work for Components designed for clientside only
- to solve this use
<client-only>...</client-only>
- to solve this use