Code Monkey home page Code Monkey logo

convex-auth5's Introduction

Convex + Next.js + Auth.js + Tailwind + shadcn/ui

This template provides a minimal setup to get Convex working with Next.js. It uses Auth.js for user authentication.

Setting up

Clone the template and install dependencies:

npm create convex@latest -- -t get-convex/convex-nextauth-template

Then:

  1. Run npx convex dev --once, and follow the steps to provision a Convex backend
  2. Generate private and public key by running node generateKeys.mjs
    • Paste the private key to the .env.local file
    • Paste the public key to your Convex dashboard, which you can open by running npx convex dashboard
  3. Generate a random secret (via openssl rand -base64 33 or npx auth secret) and save it as AUTH_SECRET to the .env.local file
  4. Generate another random secret and save it as CONVEX_AUTH_ADAPTER_SECRET to
    • the .env.local file
    • to your Convex dashboard
  5. Follow this guide to create a GitHub OAuth app and then add AUTH_GITHUB_ID and AUTH_GITHUB_SECRET to .env.local
  6. Follow this guide to sign up for Resend and then add AUTH_RESEND_KEY to .env.local

Now your .env.local should match .env.example and there should be JWKS and CONVEX_AUTH_ADAPTER_SECRET variables on your Convex dashboard.

You can now run:

npm run dev

and open your app at http://localhost:3000

See Convex docs at https://docs.convex.dev/home

convex-auth5's People

Contributors

hbela avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.