Vue3 | Apollo | GraphQl | Express | PrimeVue | Typescript | Vite
This is super simple full-stack simple JWT auth example. Focusing on principles and not look or UI appearance.
– FOR LEARNING PURPOSES ONLY –
Just like everyone else I am still learning…
Although this works well I am not sure if it is the best way
of going about handling Auth. If you find a better way of going
about Auth using a similar stack. PLEASE SHARE.
I did not find much info and resources using a similar stack online.
Please inform me if you find a better means of handling this.
- State management
- Simple JWT auth
- Route guards
- ? Apollo graphql magic ?
I used many open source NPM packages:
- Many more check Package.Json
Requires Node.js to run.
Install the dependencies and devDependencies and start the server and client.
cd api npm i
Create environment variables.
create .env in root dir ACCESS_TOKEN_SECRET= YOUR SECRET REFRESH_TOKEN_SECRET= YOUR SECRET
ORM environment setup.
Make sure you have MYSQL installed on your PC along with a database already created.
FILL IN ALL VARIABLESthis is required to establish a databse connection.
cd client npm i
Apollo client setup.
/src/apollo/index.ts edit GRAPHQL_API_URL to your graphql server endpoint apollo.config.js edit client.service.url to your graphql server endpoint npm run dev
Verify everything is working… vist.
Learn and enjoy! ?
Cagatay Civici PrimeVue is awesome.Thank you