Code Monkey home page Code Monkey logo

arena-next-js-oauth-example's Introduction

Are.na OAuth and Next.js example

This repo uses Next.js and OAuth to show a bare bones example of using Are.na to collect entries. A person logs in through using their Are.na account and uses their own user to add blocks. This assumes you want to have a channel you'd like to have people add to via a text input, but this can be adopted for many other uses (adding images, etc).

Note: the channel you use here must be Open (green).

Basic index page is at pages/index.tsx.

The 3 components are in components:

  • AuthButton The login at the top right.
  • Entries The channel contents.
  • Prompt The entry point where a person adds content to the channel.

Getting started

  1. Clone this repo
  git clone [email protected]:broskoski/arena-next-js-oauth-example.git
  1. Register an app at https://dev.are.na
  2. Create an .env file in the top of the repo
  cd arena-next-js-oauth-example
  touch .env
  1. Copy the values given to you at dev.are.na into new values in your .env
  ARENA_CLIENT_ID=<your client id>
  NEXTAUTH_SECRET=<your app secret>
  1. Update the values of CHANNEL_ID at the top of components/Prompt/index.tsx and components/Entries/index.tsx
  2. Run the app locally
  yarn dev

Getting set up on Vercel

The easiest way to get this app running is to set up a (free) app on Vercel.

This assumes you've already registered an account on Vercel, and published your repo to Github.

  1. In Vercel, click 'Add new...' and choose 'Project'
  2. Under "Import Git repository" choose your repo.
  3. Update the settings as desired and click "Deploy"

After the project has deployed, don't forget to add your .env variables to the project. This can be done under Settings > Environment variables. Add ARENA_CLIENT_ID, and NEXTAUTH_SECRET and their respective values in the Environment Variables section under Key and Value.

arena-next-js-oauth-example's People

Contributors

broskoski avatar

Stargazers

 avatar  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.