Skip to content

docs: Add comprehensive setup guide and troubleshooting section #2092

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

ManiBAJPAI22
Copy link

@ManiBAJPAI22 ManiBAJPAI22 commented Aug 15, 2025

Summary

This PR significantly improves the developer experience for local Kleros v2 setup by adding missing configuration steps and comprehensive troubleshooting guidance.

What's Added

Environment Setup Section

  • API key requirements: Step-by-step instructions for Alchemy and WalletConnect setup
  • Environment file configuration: Complete .env.local file creation with all required variables
  • Alternative configuration methods: Instructions for updating existing .env.local.public

Comprehensive Troubleshooting Section

  • 8 common setup issues with exact error messages and copy-paste solutions:
    1. Volta yarn version errors (volta pin yarn)
    2. Module resolution errors (kleros-app build dependency)
    3. Environment variable errors (missing API keys)
    4. Graph Node fulltext search errors (schema modification)
    5. GraphQL code generation failures (endpoint testing)
    6. Docker/Graph Node connection issues (port conflicts)
    7. Web frontend loading issues (browser debugging)
    8. Simulate task errors (working alternatives)

Issues Addressed

This PR addresses real-world problems that block new contributors:

  • Missing environment variables cause runtime errors with no clear guidance
  • Volta configuration issues prevent yarn commands from working
  • Missing build dependencies cause module resolution failures
  • Broken simulation commands (simulate:all task doesn't exist)
  • No troubleshooting guidance when things go wrong
  • Port number discrepancies between docs and actual behavior

Testing

These improvements are based on actual setup experience where each documented issue was encountered and resolved during a fresh repository clone and setup process.

Impact

This change will:

  • Reduce onboarding friction for new developers
  • Save hours of debugging time with ready solutions
  • Improve developer experience with clear, actionable guidance
  • Prevent common setup failures that discourage contributions

Breaking Changes

None. This is purely additive documentation that enhances the existing setup process without changing any functionality.


PR-Codex overview

This PR focuses on enhancing the README.md by adding detailed environment setup instructions, troubleshooting tips, and clarifying the configuration process for API keys and local development.

Detailed summary

  • Added Environment Setup section with API keys requirements.
  • Included instructions for creating and updating .env.local and .env.local.public.
  • Expanded Troubleshooting section with common issues and solutions.
  • Updated various yarn commands for consistency.

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Summary by CodeRabbit

  • Documentation
    • Expanded Environment Setup with required keys, variable placeholders, example values, and .env guidance.
    • Standardized command examples (removed shell prompts).
    • Clarified installation and deployment steps, including workspace options and a “wait until deployment completes” note.
    • Added a comprehensive Troubleshooting checklist with verification commands and common issue resolutions.
    • Introduced a Getting Help section with community links and pointers to package-specific READMEs.

## Summary

This PR significantly improves the developer experience for local Kleros v2 setup by adding missing configuration steps and comprehensive troubleshooting guidance. 

## What's Added

### 🔧 Environment Setup Section
- **API key requirements**: Step-by-step instructions for Alchemy and WalletConnect setup
- **Environment file configuration**: Complete `.env.local` file creation with all required variables
- **Alternative configuration methods**: Instructions for updating existing `.env.local.public`

### 🛠️ Comprehensive Troubleshooting Section
- **8 common setup issues** with exact error messages and copy-paste solutions:
  1. Volta yarn version errors (`volta pin yarn`)
  2. Module resolution errors (kleros-app build dependency)
  3. Environment variable errors (missing API keys)
  4. Graph Node fulltext search errors (schema modification)
  5. GraphQL code generation failures (endpoint testing)
  6. Docker/Graph Node connection issues (port conflicts)
  7. Web frontend loading issues (browser debugging)
  8. Simulate task errors (working alternatives)

## Issues Addressed

This PR addresses real-world problems that block new contributors:

- **Missing environment variables** cause runtime errors with no clear guidance
- **Volta configuration issues** prevent yarn commands from working  
- **Missing build dependencies** cause module resolution failures
- **Broken simulation commands** (`simulate:all` task doesn't exist)
- **No troubleshooting guidance** when things go wrong
- **Port number discrepancies** between docs and actual behavior

## Testing

These improvements are based on actual setup experience where each documented issue was encountered and resolved during a fresh repository clone and setup process.

## Impact

This change will:
- ✅ **Reduce onboarding friction** for new developers
- ✅ **Save hours of debugging time** with ready solutions
- ✅ **Improve developer experience** with clear, actionable guidance
- ✅ **Prevent common setup failures** that discourage contributions

## Breaking Changes

None. This is purely additive documentation that enhances the existing setup process without changing any functionality.
Copy link

netlify bot commented Aug 15, 2025

👷 Deploy request for kleros-v2-testnet pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ee3eafc

Copy link

netlify bot commented Aug 15, 2025

👷 Deploy request for kleros-v2-neo pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ee3eafc

Copy link

netlify bot commented Aug 15, 2025

👷 Deploy request for kleros-v2-testnet-devtools pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ee3eafc

Copy link

netlify bot commented Aug 15, 2025

👷 Deploy request for kleros-v2-university pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit ee3eafc

Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Documentation update to README.md adding environment setup guidance, explicit environment variables, standardized command formatting, expanded deployment steps, a detailed troubleshooting checklist, and links for getting help.

Changes

Cohort / File(s) Change Summary
Documentation: Setup, Deployment, Troubleshooting
README.md
Added Environment Setup with API keys and .env examples; defined env var placeholders; standardized command examples; expanded local deployment steps and notes; added “wait until deployment is complete” instruction; introduced extensive Troubleshooting and Getting Help sections. No code/API changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

A rabbit taps keys with a careful hop,
Lining envs like carrots in a crop.
Curl checks thump, docker drums roll,
Subgraphs bloom from burrow to goal.
If yarn gets tangled, don’t you fear—
Follow the trail, help is near. 🥕

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai or @coderabbitai title anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@ManiBAJPAI22
Copy link
Author

@shalzz @clesaege

Hi Kleros Team! 👋

I just went through setting up Kleros v2 locally and hit several undocumented issues. This PR adds the missing setup steps and troubleshooting guidance that would have saved me (and future contributors) significant time.

Key additions:

  • Environment setup (missing API keys, .env configuration)
  • Troubleshooting section with 8 common issues + solutions

Every documented issue was actually encountered during fresh setup. Hope this helps make onboarding smoother for new contributors!

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
README.md (1)

226-226: Update network name: Arbitrum Goerli → Arbitrum Sepolia

Elsewhere you reference ArbSepolia (REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH). Goerli is deprecated; this label should reflect Sepolia to avoid confusion.

-##### Based on the ArbitrumGoerli deployment artifacts
+##### Based on the Arbitrum Sepolia deployment artifacts
🧹 Nitpick comments (5)
README.md (5)

65-77: Convert emphasized labels to actual subheadings for consistency and to satisfy MD036

Use proper Markdown headings instead of bold text used as headings. This improves navigability and fixes the markdownlint warning.

Apply this diff:

-### Environment Setup
+### Environment setup
@@
-**API Keys (Required):**
+#### API keys (required)
@@
-**Environment Configuration**
+#### Environment configuration

79-90: Add language to code fence and include a non-commit warning for secrets

  • Specify a language for fenced blocks (markdownlint MD040).
  • Explicitly warn not to commit .env.local, since it will contain secrets.
- - Create a `.env.local` file in `/web` (or update an existing `.env.local.public`):
+- Create a `.env.local` file in `/web` (or update an existing `.env.local.public`):
+
+> Do not commit `.env.local`; it contains secrets.
@@
- ```
+ ```bash
   cd web
   cat > .env.local << EOF
   REACT_APP_CORE_SUBGRAPH=http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local
   REACT_APP_DRT_ARBSEPOLIA_SUBGRAPH=http://localhost:8000/subgraphs/name/kleros/kleros-v2-drt-local
   ALCHEMY_API_KEY=your_alchemy_api_key_here
   WALLETCONNECT_PROJECT_ID=your_walletconnect_project_id_here
   EOF
@@
-```
+```

241-243: Add code fence languages to satisfy MD040 and improve readability

Several fenced blocks are missing language specifiers. Add bash for shell snippets.

-    ```
+    ```bash
     volta pin yarn
     ```
-    ```
+    ```bash
     yarn workspace @kleros/kleros-app build
     ```
-  ```
+  ```bash
   cd subgraph/core
   # Remove @fulltext directives from schema.graphql
   sed -i '/@fulltext(/,/)/d' schema.graphql
   rm -rf build/
   yarn build

```diff
-  ```
+  ```bash
     curl -X POST -H "Content-Type: application/json" \
     -d '{"query": "{ _meta { block { number } } }"}' \
     http://localhost:8000/subgraphs/name/kleros/kleros-v2-core-local

```diff
-  ```
+  ```bash
   docker system prune -f


Also applies to: 248-250, 261-267, 275-279, 287-289

---

`258-267`: **Clarify scope of schema edits and advise on reverting changes**

Removing @fulltext directives is a local workaround. Add a note that these changes should not be committed and how to revert them, to prevent accidental drift.


```diff
   # Remove @fulltext directives from schema.graphql
   sed -i '/@fulltext(/,/)/d' schema.graphql
   rm -rf build/
   yarn build
+  # Note: Do not commit these local schema changes. Revert with:
+  # git restore subgraph/core/schema.graphql

281-289: Use targeted cleanup before resorting to docker system prune

docker system prune -f is destructive. Prefer targeted cleanup first; reserve prune for last resort.

-  docker system prune -f
+  # Prefer targeted cleanup:
+  yarn workspace @kleros/kleros-v2-subgraph stop-local-indexer
+  # Or, from the subgraph package directory:
+  # docker compose down -v
+  # As a last resort:
+  # docker system prune -f
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 257870c and ee3eafc.

📒 Files selected for processing (1)
  • README.md (7 hunks)
🧰 Additional context used
🪛 LanguageTool
README.md

[grammar] ~69-~69: There might be a mistake here.
Context: ... API Key** (for blockchain connectivity) - Sign up at [alchemy.com](https://www.alc...

(QB_NEW_EN)


[grammar] ~73-~73: There might be a mistake here.
Context: ...ct Project ID** (for wallet connections) - Sign up at [cloud.walletconnect.com](htt...

(QB_NEW_EN)


[grammar] ~238-~238: There might be a mistake here.
Context: ...Solutions - Volta Yarn Version Errors - Pin yarn version in the project root. ...

(QB_NEW_EN)


[grammar] ~245-~245: There might be a mistake here.
Context: ...rn ``` - Module Resolution Errors - Build the kleros-app package first. ...

(QB_NEW_EN)


[grammar] ~252-~252: There might be a mistake here.
Context: ... ``` - Environment Variable Errors - Ensure all required variables are presen...

(QB_NEW_EN)


[grammar] ~258-~258: There might be a mistake here.
Context: ... - **Graph Node Fulltext Search Errors** - Remove@fulltext` directives from the s...

(QB_NEW_EN)


[grammar] ~296-~296: There might be a mistake here.
Context: ...ost:8000/). - Simulate Task Not Found - Run tests: `yarn workspace @kleros/klero...

(QB_NEW_EN)


[grammar] ~297-~297: There might be a mistake here.
Context: ...imulate Task Not Found** - Run tests: yarn workspace @kleros/kleros-v2-contracts test - Use dispute bot: `yarn workspace @kleros...

(QB_NEW_EN)


[grammar] ~298-~298: There might be a mistake here.
Context: ...v2-contracts test - Use dispute bot:yarn workspace @kleros/kleros-v2-contracts bot:disputor` - Or simulate disputes via the web interfa...

(QB_NEW_EN)

🪛 markdownlint-cli2 (0.17.2)
README.md

77-77: Emphasis used instead of a heading

(MD036, no-emphasis-as-heading)


81-81: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


94-94: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


241-241: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


248-248: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


261-261: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


275-275: Fenced code blocks should have a language specified

(MD040, fenced-code-language)


287-287: Fenced code blocks should have a language specified

(MD040, fenced-code-language)

🔇 Additional comments (2)
README.md (2)

65-109: Great doc expansion: setup, env, deployment, and troubleshooting are much clearer

This is a substantial improvement in onboarding, with actionable steps and copy-paste commands. The troubleshooting matrix is especially helpful.

Also applies to: 123-193, 194-234, 236-309


245-251: Workspace name confirmed: @kleros/kleros-app
The script listed all workspaces and showed that kleros-app/package.json defines the package as @kleros/kleros-app. The README instruction is correct—no change needed.

@ManiBAJPAI22 ManiBAJPAI22 marked this pull request as ready for review August 16, 2025 19:06
@ManiBAJPAI22 ManiBAJPAI22 requested a review from a team as a code owner August 16, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant