Skip to content

Latest commit

 

History

History
84 lines (56 loc) · 5.16 KB

README.md

File metadata and controls

84 lines (56 loc) · 5.16 KB

SECRET HOGWARTS 🏰

SCHOOL of DATA SORCERY 🧙

Muggles Welcome 💖

From: Headmaster Shillbus DumbleTor (Secret Order of Merlin, Grand Sorcerer, Chief Warlock, Supreme Mugwump, International Confederation of Wizards)

Dear [Codename],

We are pleased to inform you that you have been formally invited to attend Secret Hogwarts: School of Data Witchcraft and Wizardry. Many Secret Agents don’t understand their own magical powers. Everyone learns better together!

Enclosed you will find a list of all necessary books and equipment.

COURSE BOOKS

All students should have a copy of each of the following:

OTHER EQUIPMENT

  • 1 wand: GitHub account
  • 1 cauldron: set up your environment
  • 1 set glass or crystal phials: contribute some data
  • 1 telescope: ask questions to help gather insights
  • 1 set brass scales: metrics

Students may also bring, if they desire, an 🦉 owl OR a 🐈 cat OR a 🐸 toad.

FaunaDB with Magic Authentication (featuring Next.js)

Refer to this demo and tutorial to build your own FaunaDB-powered TodoMVC app with Magic passwordless login!

Deploy your own!

Deploy an example using Vercel Now:

Deploy with Vercel Now

Configuration

Login to the Magic Dashboard to get API keys for your application.

Magic Dashboard

Next, you'll create a FaunaDB database for your application here. Once you've configured your database, you'll need to prepare it for the schema expected by this example code. Execute the step-by-step queries found in init.fql from either FaunaDB's CLI or FaunaDB's Dashboard shell interface. Finally, you'll need to acquire an admin access key for your database (located in the "Security" page of FaunaDB's Dashboard sidebar).

Next, copy the .env.local.example file in this directory to .env.local (this file is intentionally ignored by Git):

cp .env.local.example .env.local

Then, set each variable in .env.local:

  • NEXT_PUBLIC_MAGIC_PUBLISHABLE_KEY should look like pk_test_abc or pk_live_ABC
  • MAGIC_SECRET_KEY should look like sk_test_ABC or sk_live_ABC
  • FAUNADB_SECRET_KEY should look like fnRB4Ld...
  • ENCRYPTION_SECRET is a secret value you choose with at least 32 characters

To complete your deployment on Vercel, you'll need to configure some environment variables with the Environment Variables UI or using the Vercel CLI (Documentation).

Install Vercel CLI; log in to your account from the CLI; link your project; then run the following command to add the NEXT_PUBLIC_MAGIC_PUBLISHABLE_KEY, MAGIC_SECRET_KEY, FAUNADB_SECRET_KEY, and ENCRYPTION_SECRET environment variables.

vercel env add