GraphQL : Graph Query Language, a way to directly query database in an elegant graph structure which greatly simplifies query construction VS Traditional SQL.
Hasura: Hasura is an open-source engine that allows you to instantly access and manipulate your data over the GraphQL API. It provides real-time GraphQL APIs on new or existing databases, which means you can quickly build applications without worrying about designing and managing complex backend infrastructure.
PosrgreQL: Relational Database which is used to store user data.
Postman: It is a tool to test API. it can also test Graphql API.
Linode: Linode is a cloud hosting provider that offers scalable and high-performance virtual private servers (VPS) and other cloud services.
Githup Action: Service which allows easy running CI/CD pipelines
vue 3: Frontend Framework which allows easy and quick building of web apps.
Flowbite: Vue 3 component library which provides lot of basic components needed to build webapp. such as button, forms etc.
Docker : Docker is a platform that allows you to package and run software applications in isolated environments called containers, making it easier to deploy and manage applications across different systems.
Auth0 : platform that provides authentication and authorization services for applications and API.
Implemented Concepts
User Management System: A system which allows user to Register, Login, manage their account detail.
Roles: A set of permissions and privileges assigned to a user or group of users. They are used to control access to data and operations through the GraphQL API
Authentication : Process of verifying that the user is who they say they are. This is done by using Auth0 services.
Authorization : The process of determining if a user is allowed to perform an action. This is done by checking if a user has permission for that action.
Other Concepts
GDPR : General data protection regulation, a set of laws which govern how personal data is handle in the EU
Summary
User account need to be created, removed, user data update via API/interface. The API will be used by Fronted app which enable management of user accounts.
Reference level explanation
User management involves storing data in Posgresql Database and through GraphQL API data can be access.
GraphQL API should be able to allow admin and user to view, create, update, delete users.
Users have the following fields in user table :
id(Primary key)
name
auth_id (generated by Auth0 during registration of user )
email
Two methods to create user :
Programmatically by creating user in Auth0 then creating a corrosponding user in the Hasura PosgresQL DB
Manually by creating user in DB using dashboard connected to GraphQL api.
Frontend and User interface
This dashboard display images for user avatar and options for management of users.
Data display is in the form of a table with rows being each user and column being the fields of the users. The table is also pagenated.
Every time changes are made to the table, the changes are sent to the backend asynchronously via GraphQL mutations. Hasura will update the table in DB and the table will be updated in the frontend
List of actions that can be performed on the table :
view user
Modify user
Delete user
Serch user
Sort by column
Filter by column
Vue 3 app created to display the user management dashboard.
Flowbite component structure the app.
Frontend user Hasura graphql to perform above List of actions.
Database Setup
Hasura-cli will create the user table in the DB using sql migration. The Hasura-cli will also be used to create the Graphql API such as defining subscriptions and mutations.
Admin Secret and endpoint will be stored in a config file as environment varables.
Authentication
We will use Auth0 to authenticate users and provide them with a JWT token. The JWT token will be used to authenticate users and provide them with access to user management.
Alternatives
Using preexisting user management system such as Auth0 would be a good alternative if we are not using Hasura and Graphql.
Aut0 is a paid services and we would need to pay for the service.
Which parts of the current system affacted by this request?
we will be creating new Vue3 app, a new Hasura GraphQL API, PosgresQL DB in hasura instance.
What other requests are related with this request?
RFW0009 User login
Does this request depend on fullfillment of any other request?
This request does not depend on fullfillment of any other request.
Future possibilities
How do you see the particular system or part of the system affected by this request be altered or extended in the future?
In the Future, the user management system will be integrated Passwordless signup and login system (ie. Auth0 services). This will allow user to sign up and login to the app.
Infrastructure
Will be creating :
A new vue3
A new Hasura GraphQL API
A new Posgresql DB in Hasura
Version History
History of changes made to this RFC
NA
Recordings
List of audio recording of related discussion.
NA
Work Phases
Implementation
Non coding Preparation :
[x] Planning
Implementation :
[x] Creating Hasura graphQL API
[x] Applying Migration to Posgresql DB
[x] Postman API testing for Hasura GraphQL API
[x] Creating vue3 app
[x] Connecting Vue3 app to Hasura GraphQL API
[x] Create user Management system
[x] Testing user management system
[x] Fixing bugs in user management system
Documentation
[x] API documentation of Postman
Deployment workflow
[x] Dockerizing Hasura instance and node api server
[x] Creating Github Action workflow for CI/CD
[x] Creating Github Action workflow for Linode server ( For backed api server)
Testing
[x] Unit testing
[x] Postman API for GraphQL API
[x] Testing Github Action workflow for CI/CD
[x] Testing Github Action workflow for Linode (for backend api server)
Table of Contents
Housekeeping
This [RFC0008] is related to RFW0008
Named Concepts
Technologies
GraphQL : Graph Query Language, a way to directly query database in an elegant graph structure which greatly simplifies query construction VS Traditional SQL. Hasura: Hasura is an open-source engine that allows you to instantly access and manipulate your data over the GraphQL API. It provides real-time GraphQL APIs on new or existing databases, which means you can quickly build applications without worrying about designing and managing complex backend infrastructure. PosrgreQL: Relational Database which is used to store user data. Postman: It is a tool to test API. it can also test Graphql API. Linode: Linode is a cloud hosting provider that offers scalable and high-performance virtual private servers (VPS) and other cloud services. Githup Action: Service which allows easy running CI/CD pipelines vue 3: Frontend Framework which allows easy and quick building of web apps. Flowbite: Vue 3 component library which provides lot of basic components needed to build webapp. such as button, forms etc. Docker : Docker is a platform that allows you to package and run software applications in isolated environments called containers, making it easier to deploy and manage applications across different systems. Auth0 : platform that provides authentication and authorization services for applications and API.
Implemented Concepts
User Management System: A system which allows user to Register, Login, manage their account detail. Roles: A set of permissions and privileges assigned to a user or group of users. They are used to control access to data and operations through the GraphQL API Authentication : Process of verifying that the user is who they say they are. This is done by using Auth0 services. Authorization : The process of determining if a user is allowed to perform an action. This is done by checking if a user has permission for that action.
Other Concepts
GDPR : General data protection regulation, a set of laws which govern how personal data is handle in the EU
Summary
User account need to be created, removed, user data update via API/interface. The API will be used by Fronted app which enable management of user accounts.
Reference level explanation
User management involves storing data in Posgresql Database and through GraphQL API data can be access. GraphQL API should be able to allow admin and user to view, create, update, delete users.
Users have the following fields in user table :
Two methods to create user :
Frontend and User interface
This dashboard display images for user avatar and options for management of users.
Data display is in the form of a table with rows being each user and column being the fields of the users. The table is also pagenated.
Every time changes are made to the table, the changes are sent to the backend asynchronously via GraphQL mutations. Hasura will update the table in DB and the table will be updated in the frontend
List of actions that can be performed on the table :
Vue 3 app created to display the user management dashboard.
Flowbite component structure the app.
Frontend user Hasura graphql to perform above List of actions.
Database Setup
Hasura-cli will create the user table in the DB using sql migration. The Hasura-cli will also be used to create the Graphql API such as defining subscriptions and mutations. Admin Secret and endpoint will be stored in a config file as environment varables.
Authentication
We will use Auth0 to authenticate users and provide them with a JWT token. The JWT token will be used to authenticate users and provide them with access to user management.
Alternatives
Using preexisting user management system such as Auth0 would be a good alternative if we are not using Hasura and Graphql. Aut0 is a paid services and we would need to pay for the service.
Drawbacks
N/A
Useful References
Hasura Vue3 Flowbite Auth0 PosgresQL apollo graphQL
Unresolved Questions
NA
Parts of the system affected
Future possibilities
Infrastructure
Will be creating :
Version History
History of changes made to this RFC NA
Recordings
List of audio recording of related discussion. NA
Work Phases
Implementation
Non coding Preparation :
Implementation :
Documentation
[x] API documentation of Postman
Deployment workflow
Testing