-
Notifications
You must be signed in to change notification settings - Fork 2
chore: rename backend endpoints #74
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe server documentation was significantly expanded, detailing environment variables, API endpoints, and database models. On the code side, HTTP route paths were reorganized to introduce new, more descriptive endpoint paths, while maintaining backward compatibility through temporary redirects from old endpoints to the new ones. No changes were made to exported code entities. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant Server
Client->>Server: Request to old endpoint (e.g., /getRepositories)
Server-->>Client: HTTP 307 Redirect to new endpoint (e.g., /repositories)
Client->>Server: Request to new endpoint (/repositories)
Server-->>Client: Response from handler (unchanged)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~7 minutes Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
server/README.md (2)
36-36
: LGTM! Consider fixing markdown formatting.The endpoint URL change from
/getStats
to/stats
aligns with the RESTful naming convention.Fix the bare URL formatting as flagged by markdownlint:
-- get stats (curl http://localhost:3333/stats?time=x): where x in (daily|weekly|monthly|yearly) +- get stats (`curl http://localhost:3333/stats?time=x`): where x in (daily|weekly|monthly|yearly)
53-53
: LGTM! Consider fixing markdown formatting.The endpoint URL change from
/getIssues
to/issues
follows the RESTful naming convention.Fix the bare URL formatting as flagged by markdownlint:
-- get issues (curl http://localhost:3333/issues?label=help wanted): +- get issues (`curl http://localhost:3333/issues?label=help wanted`):
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
server/README.md
(2 hunks)server/main.go
(1 hunks)src/app/actions.ts
(3 hunks)src/hooks/use-link-github.ts
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/app/actions.ts (1)
server/handler/stats.go (1)
HandleGetNewestContributors
(149-207)
🪛 markdownlint-cli2 (0.17.2)
server/README.md
36-36: Bare URL used
(MD034, no-bare-urls)
53-53: Bare URL used
(MD034, no-bare-urls)
🔇 Additional comments (6)
src/hooks/use-link-github.ts (1)
193-193
: LGTM! Improved API organization.The endpoint change from
/getGithubUserAndTokenByCode
to/github/oauth/exchange
improves API organization by grouping GitHub-related endpoints under the/github/
prefix and uses more descriptive naming.src/app/actions.ts (3)
24-24
: LGTM! Cleaner RESTful endpoint.The endpoint change from
/getStats
to/stats
removes redundant "get" prefix and follows REST conventions where the HTTP method implies the action.
42-42
: LGTM! Improved endpoint naming.The endpoint change from
/getIssues
to/issues
follows RESTful naming conventions by removing the redundant "get" prefix.
69-69
: LGTM! Consistent with REST conventions.The endpoint change from
/getRepositories
to/repositories
aligns with the other endpoint updates to use cleaner, more RESTful URLs.server/main.go (2)
102-104
: LGTM! Excellent RESTful API improvement.The endpoint renaming from
/getRepositories
to/repositories
,/getStats
to/stats
, and/getIssues
to/issues
follows REST conventions by removing redundant "get" prefixes. The HTTP method already indicates the action.
108-109
: LGTM! Improved GitHub endpoint organization.The restructuring of GitHub-related endpoints with
/github/verify
and/github/oauth/exchange
creates better API organization by:
- Grouping related functionality under the
/github/
namespace- Using more descriptive endpoint names (
oauth/exchange
vs the verbose original)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You change them all, perfect !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (5)
server/README.md (5)
18-33
: Fix MD034 & MD058: wrap bare URL and add blank lines around the.env
tablemarkdownlint flags the bare URL on Line 23 and the absence of blank lines before/after the table (MD058).
Applying the patch below eliminates both issues without affecting rendered output.- - Create a `.env` file in the `/server` folder with the following variables: - -| Variable Name | Required | Example / Description | + - Create a `.env` file in the `/server` folder with the following variables: + +| Variable Name | Required | Example / Description | |----------------------------|----------|-----------------------------------------------------------------------| | GITHUB_API_TOKEN | Yes | GitHub API token for authentication | -| GITHUB_GRAPHQL_ENDPOINT | Yes | GitHub GraphQL endpoint (commonly: https://api.github.com/graphql) | +| GITHUB_GRAPHQL_ENDPOINT | Yes | GitHub GraphQL endpoint (commonly: <https://api.github.com/graphql>) | | GNO_GRAPHQL_ENDPOINT | Yes | Gno blockchain GraphQL endpoint | | GNO_RPC_ENDPOINT | Yes | Gno blockchain RPC endpoint | @@ -| DISCORD_WEBHOOK_URL | No | Discord webhook for leaderboard notifications | +| DISCORD_WEBHOOK_URL | No | Discord webhook for leaderboard notifications | + +<!-- blank line required after table for MD058 -->
131-133
: Endpoint prefix inconsistency – consider namespacing/link
under/github
Every other GitHub-related route is grouped under
/github/*
, yet the wallet–linking call sits at the root path. Moving it to/github/link
(or similar) keeps the surface RESTful and predictable.- `POST /link` + `POST /github/link`
144-165
:/api/onchain/*
prefix breaks overall URL symmetryAll other resource groups live at the root (e.g.
/contributors
,/stats
). Introducing an extra/api
segment only for on-chain endpoints is surprising for consumers. Unless a gateway or versioning requirement mandates it, consider dropping the extra segment:- `GET /api/onchain/namespaces` + `GET /onchain/namespaces`…apply similarly for the other three on-chain routes.
38-42
: Minor log typo: “exiting” → “existing”-issues: All updated exiting... +issues: All updated existing…
180-316
: Surround all model tables with blank lines (MD058)markdownlint flags every table in the “Database Models” section for missing blank lines. Add a blank line before and after each table header to silence the warnings and keep the formatting consistent.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
server/README.md
(2 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
server/README.md
23-23: Bare URL used
(MD034, no-bare-urls)
183-183: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
207-207: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
215-215: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
227-227: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
243-243: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
260-260: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
267-267: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
275-275: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
291-291: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
302-302: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
310-310: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
server/README.md (4)
20-32
: Add blank lines before & after the environment-variables table.
markdownlint
(MD058) flags every table in this document. Inserting one blank line before and after each table silences the linter and improves readability.- -| Variable Name | Required | Example / Description | + + +| Variable Name | Required | Example / Description | ... -| DISCORD_WEBHOOK_URL | No | Discord webhook for leaderboard notifications | - +| DISCORD_WEBHOOK_URL | No | Discord webhook for leaderboard notifications | + +See `.env.example` if present for more details.
46-57
: Document authentication / rate-limiting requirements for public endpoints.
The endpoint catalogue is comprehensive, but it omits whether calls require anAuthorization
header (bearer token), API key, or are completely open. This is crucial for client integration and for securing the service.Recommend adding a short “Authentication” subsection right before the “API Endpoints” heading that states:
- Supported auth schemes (GitHub token, cookie, etc.).
- Which routes are public vs. require auth.
- Expected HTTP status codes on auth failure (e.g. 401/403).
121-130
: Clarify success & error responses for/github/verify
+/github/link
.
These routes perform sensitive wallet linkage. The README should list:
- Expected success payload (fields & example).
- Common error status codes (
400
,409
,500
) and payload shapes.
This prevents client developers from reverse-engineering error semantics.
23-24
: Wrap the bare URL in angle brackets to satisfy MD034.
This small change silences markdownlint and renders consistently across Markdown engines.-| GITHUB_GRAPHQL_ENDPOINT | Yes | GitHub GraphQL endpoint (commonly: https://api.github.com/graphql) | +| GITHUB_GRAPHQL_ENDPOINT | Yes | GitHub GraphQL endpoint (commonly: <https://api.github.com/graphql>) |
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
server/README.md
(2 hunks)server/main.go
(1 hunks)src/hooks/use-link-github.ts
(2 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
- src/hooks/use-link-github.ts
- server/main.go
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
server/README.md
23-23: Bare URL used
(MD034, no-bare-urls)
183-183: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
207-207: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
215-215: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
227-227: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
243-243: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
260-260: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
267-267: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
275-275: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
291-291: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
302-302: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
310-310: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🔇 Additional comments (1)
server/README.md (1)
8-9
: Verify the stated Go version – 1.23.0 does not exist yet.
Go 1.22 is the latest stable release (Jul 2025). Requiring> 1.23.0
will confuse readers and automation scripts that parse prerequisites.-Prerequisites: -- Golang > 1.23.0 +Prerequisites: +- Golang ≥ 1.22.0
server/README.md
Outdated
|
||
| Parameter | In | Type | Required | Description | | ||
|--------------|-------|--------|----------|--------------------------------------------------------------------| | ||
| time | query | string | Yes | Time period: `daily`, `weekly`, `monthly`, or `yearly` | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| time | query | string | Yes | Time period: `daily`, `weekly`, `monthly`, or `yearly` | | |
| time | query | string | No | Time period: `daily`, `weekly`, `monthly`, or `yearly`. If omitted, returns all-time stats (no explicit all time value). | |
Are you reworking the frontend now ? |
I'll do it once it's merged and deployed so that it can hit the new endpoints. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (3)
server/README.md (3)
20-32
: Surround tables with blank lines to satisfy MD058 and improve readability
markdownlint
flags every table in this README because they are not preceded and followed by a blank line.
Adding a single blank line before and after each table silences MD058 and makes the raw Markdown easier to scan.Example fix (repeat for all tables):
-See `.env.example` if present for more details. -| Variable Name | Required | Example / Description | +See `.env.example` if present for more details. + +| Variable Name | Required | Example / Description | … -| DISCORD_WEBHOOK_URL | No | Discord webhook for leaderboard notifications | + +| DISCORD_WEBHOOK_URL | No | Discord webhook for leaderboard notifications | +Also applies to: 54-65, 72-77, 90-94, 105-110, 117-130, 136-140, 153-156, 167-170, 183-205, 207-213, 215-225, 227-241, 243-258, 260-265, 267-273, 275-289, 291-300, 302-308, 310-315
23-24
: Wrap bare URLs in angle brackets to silence MD034
https://api.github.com/graphql
is rendered as a bare link.
Wrap it (and any other bare URLs) in<…>
or convert to[text](url)
.-| GITHUB_GRAPHQL_ENDPOINT | Yes | GitHub GraphQL endpoint (commonly: https://api.github.com/graphql) | +| GITHUB_GRAPHQL_ENDPOINT | Yes | GitHub GraphQL endpoint (commonly: <https://api.github.com/graphql>) |
287-287
: Property name ‘Url’ breaks existing naming conventionEarlier entities use
URL
(all caps). Keeping a single style prevents bugs in generated code & ORMs.-| Url | string | Milestone URL | +| URL | string | Milestone URL |
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
server/README.md
(2 hunks)server/main.go
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- server/main.go
🧰 Additional context used
🪛 markdownlint-cli2 (0.17.2)
server/README.md
23-23: Bare URL used
(MD034, no-bare-urls)
183-183: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
207-207: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
215-215: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
227-227: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
243-243: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
260-260: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
267-267: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
275-275: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
291-291: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
302-302: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
310-310: Tables should be surrounded by blank lines
(MD058, blanks-around-tables)
🔇 Additional comments (1)
server/README.md (1)
74-75
: Nice: parameter description now clarifies “all-time” behaviourGood call adding the explicit note that omitting
time
returns all-time stats.
No further action required.
Summary by CodeRabbit
Documentation
Refactor