Integrate Auth to front end & move api documentation to our /docs page and remove scaler#7
Integrate Auth to front end & move api documentation to our /docs page and remove scaler#7LEEDASILVA wants to merge 11 commits into
Conversation
b1a0ccb to
becc810
Compare
|
This Pr also handles Graphql connection between the front service and the db. It allows us now to query the db with the right role (depending on the user logged in). each file indicates the queries and where we can fetch or add them. The graphql-client is basically the connection to the db via graphql engine ofc |
e667c56 to
9e5c52a
Compare
e69cca7 to
c8c610e
Compare
c8c610e to
9e1e790
Compare
ef91cb1 to
f7618b8
Compare
f7618b8 to
288ac3f
Compare
…er, RoleAdmin) on auth structure to protect other routes when called
…uld be regular integer + fix some issues on the auth route
…query the db using grahpql from the front. Including the token for role permission check feat(hasura): add permissions roles for all tables refactor(api): fix some compatability with front
- login page would have an option to login using magic link - auth verifier for when users click on the magic link from the email
- managing users is only possible with admin role or location manager - location manager can only manage add users from is own location - admins are the only ones that can delete/deactivate the user (is_active to false) - add new field on user table 'is_active' to allow soft delete - fix sequential id increment when we seed the db
288ac3f to
7b60c7c
Compare
… and offline usage
|
Added a way for the graphql requests/queries work with PWA offline! it allows the user to use the application even offline so queries would be cached for a while then refreshed once they have internet. This would allow them to submit issues of equipments even offline and it would be pushed once online. For this had to add a we should probably create a workflow to check if schema.json is updated compared to our database schema? - name: Verify GraphQL schema is up to date
run: |
docker compose up -d postgres hasura
npx -y get-graphql-schema -j -h "x-hasura-admin-secret=<sercrete>" http://localhost:8080/v1/graphql > src/lib/gql/schema.json
git diff --exit-code src/lib/gql/schema.json \
|| (echo "Run 'npm run gql:introspect' and commit the result." && exit 1)or should we add the {
"scripts": {
"gql:generate": "@urql/introspect-schema --header \"x-hasura-admin-secret=$HASURA_ADMIN_SECRET\" $VITE_GRAPHQL_URL --output src/lib/gql/schema.json",
"gql:check": "git diff --exit-code src/lib/gql/schema.json"
}
}then we can just call it like this: - name: Verify GraphQL schema is up to date
run: |
docker compose up -d postgres hasura
npm run gql:generate
git diff --exit-code src/lib/gql/schema.json \
|| (echo "Run 'npm run gql:introspect' and commit the result." && exit 1) |







Docs API
Auth
logout
