{"id":29182911,"url":"https://github.com/magiclabs/example-nextjs-faunadb-todomvc","last_synced_at":"2025-07-01T20:33:28.053Z","repository":{"id":48526809,"uuid":"304192019","full_name":"magiclabs/example-nextjs-faunadb-todomvc","owner":"magiclabs","description":null,"archived":false,"fork":false,"pushed_at":"2023-03-05T14:16:56.000Z","size":481,"stargazers_count":26,"open_issues_count":8,"forks_count":10,"subscribers_count":5,"default_branch":"master","last_synced_at":"2023-03-06T02:38:18.008Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"example-nextjs-faunadb-todomvc.vercel.app","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/magiclabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-15T02:50:25.000Z","updated_at":"2023-03-06T02:38:18.008Z","dependencies_parsed_at":"2023-02-06T05:45:22.179Z","dependency_job_id":null,"html_url":"https://github.com/magiclabs/example-nextjs-faunadb-todomvc","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/magiclabs/example-nextjs-faunadb-todomvc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-nextjs-faunadb-todomvc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-nextjs-faunadb-todomvc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-nextjs-faunadb-todomvc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-nextjs-faunadb-todomvc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/magiclabs","download_url":"https://codeload.github.com/magiclabs/example-nextjs-faunadb-todomvc/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/magiclabs%2Fexample-nextjs-faunadb-todomvc/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263033235,"owners_count":23403118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-07-01T20:33:27.296Z","updated_at":"2025-07-01T20:33:27.984Z","avatar_url":"https://github.com/magiclabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FaunaDB with Magic Authentication (featuring Next.js)\n\nFollow along with [the official tutorial](https://docs.magic.link/guides/todomvc) to build your own FaunaDB-powered TodoMVC app with Magic passwordless login!\n\n👉 See the [live demo](https://example-nextjs-faunadb-todomvc.vercel.app/login)\n\n## Deploy your own\n\nDeploy the example with [Vercel](https://vercel.com/docs):\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/git/external?repository-url=https%3A%2F%2Fgithub.com%2Fmagiclabs%2Fexample-nextjs-faunadb-todomvc\u0026env=NEXT_PUBLIC_MAGIC_PUBLISHABLE_KEY,MAGIC_SECRET_KEY,FAUNADB_SECRET_KEY,ENCRYPTION_SECRET)\n\n## Configuration\n\nLogin to the [Magic Dashboard](https://dashboard.magic.link/) to get API keys for your application.\n\n![Magic Dashboard](https://gblobscdn.gitbook.com/assets%2F-M1XNjqusnKyXZc7t7qQ%2F-M3HsSftOAghkNs-ttU3%2F-M3HsllfdwdDmeFXBK3U%2Fdashboard-pk.png?alt=media\u0026token=4d6e7543-ae20-4355-951c-c6421b8f1b5f)\n\nNext, you'll create a FaunaDB database for your application [here](https://dashboard.fauna.com/db-new/). 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`](./init.fql) from either [FaunaDB's CLI](https://github.com/fauna/fauna-shell) 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).\n\nNext, create a `32` random string as your encryption secret. You can create one in the terminal with openssl running `openssl rand -base64 24`\n\nNext, copy the `.env.local.example` file in this directory to `.env.local` (this file is intentionally ignored by Git):\n\n```bash\ncp .env.local.example .env.local\n```\n\nThen, set each variable in `.env.local`:\n\n- `NEXT_PUBLIC_MAGIC_PUBLISHABLE_KEY` should look like `pk_test_abc` or `pk_live_ABC`\n- `MAGIC_SECRET_KEY` should look like `sk_test_ABC` or `sk_live_ABC`\n- `FAUNADB_SECRET_KEY` should look like `fnRB4Ld...`\n- `ENCRYPTION_SECRET` should look like a random string of `32` chars\n\nTo complete your deployment on Vercel, you'll need to configure some environment variables with the [Environment Variables UI](https://vercel.com/blog/environment-variables-ui) or using the [Vercel CLI](https://vercel.com/download) ([Documentation](https://vercel.com/docs/cli#commands/env)).\n\nInstall [Vercel CLI](https://vercel.com/download); 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.\n\n```bash\nvercel env add\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclabs%2Fexample-nextjs-faunadb-todomvc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmagiclabs%2Fexample-nextjs-faunadb-todomvc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmagiclabs%2Fexample-nextjs-faunadb-todomvc/lists"}