Skip to content

Chain-Love/chain-love-contributor

 
 

Repository files navigation

Chain.Love Contributor

Chain.Love Contributor helps non-technical contributors propose updates to the Chain.Love infrastructure database. The tool mirrors the Chain.Love style guide, validates input with Zod, authenticates with GitHub via NextAuth, and automatically opens a pull request with the generated CSV entries.

Features

  • Step-by-step wizard – explains provider vs. network entries, collects data, and surfaces style guide hints.
  • Dynamic validation – category-specific Zod schemas ensure slugs, booleans, and JSON columns match repository rules.
  • GitHub automation – forks the upstream repo, creates a branch, commits CSV updates, and opens a PR.
  • Submission summary – preview the serialized CSV rows before sending the pull request.

Prerequisites

  • Node.js 20+
  • npm (or compatible package manager)
  • GitHub OAuth app configured for this project

Environment Variables

Create a .env.local file (or use the provided .env.example) with the following values:

GITHUB_CLIENT_ID=your_github_oauth_app_id
GITHUB_CLIENT_SECRET=your_github_oauth_app_secret
NEXTAUTH_SECRET=generate_a_random_32_character_string

# Optional overrides (defaults are Chain-Love/chain-love, main)
UPSTREAM_OWNER=Chain-Love
UPSTREAM_REPO=chain-love
UPSTREAM_BASE_BRANCH=main

GitHub OAuth callback URL

Set the callback URL in your GitHub OAuth app to:

http://localhost:3000/api/auth/callback/github

(Replace the host when deploying.)

Getting Started

npm install
npm run dev

Open http://localhost:3000 to access the wizard. Use Connect GitHub to sign in; the session provides the short-lived token required to create forks, branches, and pull requests.

Usage Flow

  1. Overview – learn when to add provider entries vs. network overrides.
  2. Category & Scope – choose the service category and whether you’re adding a reusable provider row, a network reference, or a network-only entry.
  3. Details – fill the form tailored to the selected category. Boolean toggles output TRUE/FALSE, lists convert to JSON arrays, and slug generation helps maintain naming consistency.
  4. Review & Submit – preview the CSV rows, then submit. The app will fork the repo if necessary, commit the changes to a new branch, and open a pull request. The resulting PR link is displayed for follow-up actions (star repo, share in Discussion #41, etc.).

Project Structure

  • app/ – Next.js App Router pages and API routes (OAuth, submissions).
  • components/ – UI primitives and the submission wizard components.
  • lib/ – Validation schemas, GitHub helpers, and shared utilities.
  • docs/ – Internal planning notes for data model, auth setup, validation, PR flow, and documentation plan.

Scripts

  • npm run dev – start the development server.
  • npm run build – generate a production build.
  • npm run start – run the production build.
  • npm run lint – run eslint (custom config excludes the upstream/widget clones).

Deployment Notes

  • Update the OAuth callback URL in your GitHub app to the deployed domain.
  • Provide the same environment variables (GITHUB_CLIENT_ID, GITHUB_CLIENT_SECRET, NEXTAUTH_SECRET, and optional upstream overrides) on the hosting platform.
  • Ensure the deployment has write access to GitHub (users must sign in to authorize the app).

License

This project is released under the MIT License.

About

Fork of the winner's project of the 1st Chain.Love's hackathon

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 97.2%
  • CSS 2.4%
  • JavaScript 0.4%