Implementing Auth and Database for 8-Bit Oracle

May 5, 20242 min read

Details on setting up authentication and database for the 8-Bit Oracle project using Next.js, Supabase (with Auth-UI for OAuth2), and Tailwind CSS...

Abstract:
This post details the initial backend setup for the 8-Bit Oracle project, focusing on authentication and database integration using Next.js, Supabase (with Auth-UI for OAuth2 and Magic Links), and Tailwind CSS. It discusses the rationale behind choosing Supabase over Firebase, the decision to defer Web3Auth integration, and announces the live beta signup.

Estimated reading time: 1 minute

Current Tech Stack

  • Framework: Next.js (app router)
  • Internationalization: next-intl
  • CSS: Tailwind CSS
  • Backend: Supabase with Auth-UI

Overview

Now that the website explains what the app needs, it's time to set up how users log in (authentication) and sign up for the beta. This marks the beginning of our backend setup.

Authentication Choices

Why OAuth2 with Supabase

I chose OAuth2 because it's widely used. Supabase Auth connects directly to the PostgreSQL database's user and profile tables. This makes managing user data simpler.

Supabase Auth-UI

I used Supabase Auth-UI because it makes setting up "magic links" (login links sent via email) easy. Note: this library has not been updated since February 2024.

Web3Auth: Future Considerations

I've decided to wait on using Web3Auth for now because it requires manually connecting it to the database.

OAuth2 Provider Setup

Setting up Google as an OAuth2 provider was important. This helps it work well with Supabase Auth, which then automatically links to the database.

Supabase vs. Firebase

I chose Supabase instead of Firebase because Supabase is open-source, and I might be able to host it myself in the future.

Beta Signup Live

The beta signup is now available at 8-bit oracle beta signup. Feel free to sign up.

Thanks for reading.

Augustin Chan is CTO & Founder of Digital Rain Technologies, building production AI systems including 8-Bit Oracle. Previously Development Architect at Informatica for 12 years. BS Cognitive Science (Computation), UC San Diego.