Home / Companies / Hasura / Blog / May 2019

May 2019 Summaries

6 posts from Hasura

Filter
Month: Year:
Post Summaries Back to Blog
This tutorial guides you through building a WhatsApp clone using Hasura's real-time GraphQL APIs. The backend is built in two parts: firstly, the backend with Hasura GraphQL Engine and secondly, the frontend with React Hooks and TypeScript. The app's source code is available for reference. The tutorial begins by deploying Hasura on Hasura Cloud and setting up a PostgreSQL database via Heroku. It then moves onto creating the necessary tables in the database: users, chat, chat_users, and message. Relational modeling with constraints is also discussed to leverage the relational features of Postgres. The tutorial continues by defining relationships between these tables using Hasura's console. It then demonstrates how to create queries for various use-cases such as listing all chats, users/groups, and messages in a chat. Mutations are also covered for inserting chats/groups, messages, deleting chats, and updating user profiles. Real-time data is achieved using GraphQL Subscriptions where the client watches for changes in data and the server pushes data to the client whenever there's a change. The tutorial concludes by defining role-based access control permissions model for the app's user role. The next part of the tutorial will cover integrating these GraphQL APIs with the React frontend using Hooks, TypeScript, and GraphQL Code Generator.
May 28, 2019 1,608 words in the original blog post.
This blog post discusses common access control patterns that can be used with Hasura GraphQL Engine to granularly allow or restrict data. The Hasura GraphQL Engine is a thin server that sits on any Postgres database and allows CRUD operations with real-time GraphQL and access control. It enables role-based access control, which can be integrated with most Auth providers. Access control rules in Hasura are functions of session variables such as x-hasura-role and x-hasura-user-id. The post covers setting up access control rules as functions of these session variables, including insert, select, update, and delete permissions. It also provides examples of specific use cases for enforcing users to insert articles as themselves, handling multiple roles, using views for access control, and enforcing fields to have only particular values.
May 23, 2019 1,582 words in the original blog post.
The text discusses building and deploying a real-time application using Svelte 3 and GraphQL, specifically using svelte-apollo and Hasura Cloud, and deploying it on the Now 2.0 platform. Svelte is highlighted for its efficient compilation of components into imperative code, resulting in smaller bundles without dependencies on a virtual DOM, which enhances performance and simplifies state management. The process involves setting up a Hasura Cloud project for real-time GraphQL APIs, cloning a demo app to illustrate fetching and updating data using GraphQL queries, mutations, and subscriptions, and deploying the app using Now CLI. The text emphasizes Svelte's minimal learning curve and its advantages over traditional frameworks like React and Vue due to its reduced boilerplate code and performance benefits. Additionally, it mentions the SSR framework for Svelte, called Sapper, for those concerned with SEO, and encourages readers to try the demo and reach out for support via various platforms.
May 23, 2019 792 words in the original blog post.
In this post, we explore building a 3factor app using Hasura's instant real-time GraphQL and Now 2.0 for serverless deployments. A 3factor app is an architecture pattern for modern full stack apps that includes Realtime GraphQL, Reliable Event System, and Async Serverless. The benefits of this approach include high feature velocity, scalability, and reduced backend ops maintenance. The demo app features a GraphQL API to fetch profile information, an external API providing weather information extending Hasura API (deployed to Now), and a serverless function that reverses the name of the profile. We also discuss why serverless could be beneficial, such as minimizing backend ops, automatic failover, and cost efficiency. To build the demo app, we use Hasura GraphQL Engine on Heroku for real-time GraphQL on Postgres and Now 2.0 for deploying serverless functions and extending Hasura with custom logic as Remote Schemas. We also demonstrate how to create event triggers on tables in the Postgres database using Hasura Console and configure webhooks to carry out business logic. In summary, this post provides an overview of building a 3factor app using GraphQL and serverless technology, highlighting its benefits and demonstrating how to implement it with Hasura and Now 2.0.
May 21, 2019 1,326 words in the original blog post.
The text provides instructions on how to reset Hasura migrations. It involves deleting local migration files, truncating the migration history on the server, pulling schema and metadata from the server, creating new migration files, and verifying the status of the migration. This process can be used to squash all migration files into a single one by snapshotting the state of a server and adding it as a new migration.
May 21, 2019 259 words in the original blog post.
ARTEMIS is an open-source tool developed by INSPIRE group and FORTH, Greece in collaboration with the Center for Applied Internet Data Analysis at UCSD. It monitors BGP to detect potential hijacking attempts against a network's prefixes. The system can identify such attacks within seconds, allowing for immediate mitigation. ARTEMIS has been tested on various networks including major Greek ISP, a dual-homed edge academic network, and a US R&E backbone network. The tool is built as a multi-container Docker application with backend and frontend sections. To implement a real-time GUI to fetch data from their Postgres database, the ARTEMIS team considered several solutions before discovering Hasura on discussion sites. After testing Hasura's console and deploying a working demo, they decided to migrate to it. Hasura now serves as the main API for accessing the Postgres database on the frontend, allowing ARTEMIS to fully utilize GraphQL features while dropping REST when not needed. This adoption has significantly improved the tool's functionality and efficiency.
May 02, 2019 243 words in the original blog post.