Many education institutions across the world have changed into fully online experiences with the current pandemic.
FREMONT, CA: With each education center’s backend stack witnessing new highs in usage, serverless solutions are more essential than ever. Here is how to create a robust school management system leveraging Auth0 for identity management and FaunaDB as a serverless database. FaunaDB enables the creation of globally distributed databases with virtually no traffic limits. Users can perform as many reads/writes as they desire.
The School Management System has three categories of users such as students, teachers, and managers. FaunaDB is a serverless database that enables one to focus on the business logic and worry less about setup and maintenance. Creating a database is as seamless as running a CreateDatabase command. All maintenance is done behind the scenes by engineers and automated DevOps at FaunaDB. The complexities connected with other databases, like selecting regions and configuring storage, are nonexistent with FaunaDB, global/multi-region by default.
Auth0 enables users to define authentication rules which will restrict authentication to emails present on the FaunaDB database. Within the same rule, it will create a FaunaDB secret and attach it to its user document. The secret will ensure that users can read/mutate resources defined within their role. The FQL Get function is then leveraged to return the matched results, in this case, a user document. A credential is generated for a specific user, leveraging the Create function on the Tokens collection.
In building out this section, users will create a Student role and construct functions related to course registration. Recall that the populate-collections script generated students, teachers, and managers to test with. Running the development server and authenticate a student leveraging these details. FaunaDB provides an authorization system out of the box which deploys Attribute-Based Access Contro. The secret/role attached to a user can do what its rules say.