⚠️ WARNING: This code is not 100% production ready. I mean... it's just a demo.
This is a VENM stack (basically MERN, but with Vue.js instead of React) JWT auth demo, including a silent/background refresh feature. It utilises Vue 3's Composition API alongside TypeScript and Vuex on the frontend, and as you've probably guessed by now, Node.js with Express and MongoDB (and also TypeScript) on the backend.
npm install
Create .env
file in project's root directory. Add the following variables:
BACKEND_PORT= # Port of Express auth server
DB_URL= # MongoDB Connection URL
ORIGIN_URL= # URL of CORS origin; i.e. Vue app's URL
JWT_SECRET= # Secret used for signing JWTs
VUE_APP_API_URL= # Express auth server's URL
npm run serve
For backend:
npm run serve:backend
npm run build