emilioschepis / dispensa-hackathon

Project for the Hasura x Hashnode Hackathon

Home Page:https://blog.emilioschepis.com/series/hasura-hashnode-hackathon

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dispensa

Hello! This is the public repository for Dispensa, the application that helps you track what groceries and items you have at home so you can better organize the shopping for the week or the next meal.

This application was made as part of the Hashnode x Hasura Hackathon in March 2022.

The whole journey was blogged on Hashnode, you can find the series here: Hashnode x Hasura Hackathon Series

Download

You can try out the Open Beta right now!

🍎 TestFlight Open Beta for iOS

🤖 Beta Track for Android

Screenshots

Dispensa is a very simple and minimalistic app (mostly because it was made in two weeks...)

Home screen Search screen Product screen

Tech stack

Even though the app is simple, it is built on modern technologies and is ready to be scaled and improved without problems.

Authentication

The authentication is handled by Auth0 and integrated in the app through Expo Auth Session. This approach leverages JWT tokens to keep the user authenticated through refresh tokens that rotate regularly. Being session-less allows us not to have any actual servers that handle the authentication state of the users.

Database & GraphQL

Of course the star of the show is Hasura, which provides a GraphQL layer on top of a Postgres database making it incredibly flexible and quick to iterate on.

The JWT generated by Auth0 is used to authenticate and authorize users on their inventory and products, and the use of GraphQL ensures that minimal network bandwidth is used during sessions.

For this Hackathon I went with Hasura Cloud for its auto-scaling and monitoring capabilities. The database itself is hosted on Heroku.

Code generation

The integration between Hasura and the app is generated by GraphQL Code Generator which keeps the queries type-safe and always up-to-date.

The generated types are then used by the urql GraphQL client in combination with a couple of custom Exchanges.

CI & CD

Dispensa has a CI & CD system integrated through GitHub Actions and Expo EAS.

On each push, the project is built and linted through this action.

Whenever a new tag is created, a version is built and deployed to Google Play and the App Store with a single command through this action.

About

Project for the Hasura x Hashnode Hackathon

https://blog.emilioschepis.com/series/hasura-hashnode-hackathon

License:MIT License


Languages

Language:TypeScript 98.2%Language:JavaScript 1.6%Language:Shell 0.2%