Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Phase 5: Public read API for resources

クローズ
#39 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
45/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
typescript

調査の方向性

Start by reading src/lib/resources.ts and src/lib/directory-filters.ts, then inspect the PRD §8.13 requirements. Use src/app/api/resources/route.ts, src/lib/api-validation.ts, and the middleware entry point as the implementation map; resolve the rate-limiting approach and database-level filter behavior. Done means the documented endpoint supports the listed filters, pagination, caching, rate limiting, and response format.

索引モデルが issue の本文から書いたものです。

説明

enhancement

Description

Implement public read API as specified in PRD §8.13. This is a P2 requirement for Phase 5.

Acceptance Criteria (from PRD §8.13)

  • GET /api/resources (paginated, filterable by category/tag) for campus ambassador bots/Discord integrations
  • Rate-limited, no auth required for reads

Current State

  • No public API exists
  • All data fetching is done via Server Components
  • Resources are fetched via src/lib/resources.ts functions

Implementation Plan

  1. Create API route: src/app/api/resources/route.ts
  2. Implement query parameters:
    • page / limit (pagination)
    • category (filter by category slug)
    • tag (filter by tag)
    • region (IN / Global)
    • costType (free, discount, etc.)
    • status (active only by default)
    • search (optional fuzzy search - may be heavy, consider exact match)
  3. Add rate limiting:
    • Use Vercel Edge Middleware or Upstash Redis
    • Limit: 60 requests/minute per IP
  4. Response format:
    {
      "data": [...],
      "pagination": { "page": 1, "limit": 30, "total": 593, "totalPages": 20 },
      "filters": { "category": "development-tools", ... }
    }
    
  5. Documentation: Add API docs to README or separate docs file

Files to Create

  • src/app/api/resources/route.ts (new)
  • src/lib/api-validation.ts (new) - Zod schemas for query params
  • src/middleware.ts or Edge Function - rate limiting (or use Upstash)

Rate Limiting Options

  • Option A: Upstash Redis (recommended for serverless)
    • npm install @upstash/ratelimit @upstash/redis
    • Edge-compatible
  • Option B: Vercel Edge Middleware with in-memory (not persistent across invocations)
  • Option C: Custom middleware with KV store

Query Implementation

Reuse existing applyFilters logic from src/lib/directory-filters.ts but on the database level (SQL WHERE clauses) for performance.

Caching

  • Add Cache-Control: public, s-maxage=60, stale-while-revalidate=300
  • Resources don't change frequently (admin CRUD + weekly cron)

OpenAPI/Swagger

  • Consider adding OpenAPI spec for documentation
  • Could use @asteasolutions/zod-to-openapi for auto-generation
主要言語
TypeScript
スター
1
フォーク
6
平均マージ
11時間 16分
マージ済み PR(30日)
16

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Your-Voldemort/StudentStack のほかの issue

Your-Voldemort/StudentStack の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。