Phase 5: Public read API for resources
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- typescript
- 領域
- api, backend, databases, documentation
調査の方向性
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 の本文から書いたものです。
説明
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.tsfunctions
Implementation Plan
- Create API route:
src/app/api/resources/route.ts - 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)
- Add rate limiting:
- Use Vercel Edge Middleware or Upstash Redis
- Limit: 60 requests/minute per IP
- Response format:
{ "data": [...], "pagination": { "page": 1, "limit": 30, "total": 593, "totalPages": 20 }, "filters": { "category": "development-tools", ... } } - 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 paramssrc/middleware.tsor 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-openapifor auto-generation
- 主要言語
- TypeScript
- スター
- 1
- フォーク
- 6
- 平均マージ
- 11時間 16分
- マージ済み PR(30日)
- 16
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Your-Voldemort/StudentStack のほかの issue
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
Your-Voldemort/StudentStack#42 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
Your-Voldemort/StudentStack#41 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
Your-Voldemort/StudentStack#40 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 45/100
Your-Voldemort/StudentStack#38 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
Your-Voldemort/StudentStack#37 ·
メンテナーはふだん 1 日以内に返信
Your-Voldemort/StudentStack の issue をすべて見る
似ている issue
-
[Bug]: Server git tests sign fixture commits with the developer's key when run from the repo rootオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
melgarafael/DeskcommCRM#2657 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
MystenLabs/MemWal#1163 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
"Explore the letters"-button should read "Explore the papers"対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンMondriaan
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
knaw-huc/textannoviz#709 ·
メンテナーはふだん 1 日以内に返信
-
billion-context-pi
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
ranxianglei/billion-context#2521 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信