lopenling / Requests

For managing requests and everything related with requests
0 stars 0 forks source link

[RFC0008] Minimal User-Management #11

Open lobsam opened 1 year ago

lobsam commented 1 year ago

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 :

  1. Programmatically by creating user in Auth0 then creating a corrosponding user in the Hasura PosgresQL DB
  2. 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 :

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

Testing