Content: public read endpoints, Meilisearch posts index, ISR revalidation (Phase 4.4)
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 42/100
Hướng nghiên cứu
Bắt đầu với các mẫu của module CommunityPro.Search, lệnh reindex hiện có và các test sử dụng những search fake hiện có; Members/MembersTestHarness.cs cho thấy các quy ước về test harness của project. Theo dõi event PostPublished được phát ra bởi #4 và các quy ước nhóm public endpoint. Được xem là hoàn tất khi tất cả tiêu chí chấp nhận đều đạt, bao gồm lọc các post chưa publish, đồng bộ và revalidation có khả năng chống lỗi, mã lỗi ổn định và reindex theo batch.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Scope
Public read surface + search sync + frontend cache invalidation for the blog.
Endpoints (anonymous)
| Method | Path | Notes |
|---|---|---|
| GET | /posts |
published only, tag filter, paginated, newest first |
| GET | /posts/{slug} |
published only; feeds the ISR post page |
| GET | /posts/featured |
the single featured published post |
Meilisearch posts index
- Follow the
CommunityPro.Searchmodule patterns exactly (hand-rolled REST client, index+settings ensured at boot, sync-on-write handler that logs failures and never throws). - Document shape mirrors public card data only: id, slug, title, excerpt, tags, authorId, publishedAt. Searchable:
title, excerpt, tags; filterable:tags; sortable:publishedAt. Never index drafts/submitted/rejected posts — publish adds, unpublish/reject removes. - Extend the existing
reindexcommand (dotnet run -- reindex) to rebuildpostsalongsidemembersin 500-doc batches.
ISR revalidation
On PostPublished: POST {FRONTEND_URL}/api/revalidate?tag=post-{slug} with a shared secret header (REVALIDATE_SECRET — treat like any credential). Best-effort with logging; never fail the pipeline.
Error codes
content.not_found, search.unavailable (degrade like members search does)
Dependencies
Blocked by #3; consumes the PostPublished event emitted by #4.
Acceptance criteria
- Unpublished posts are unreachable via every public endpoint and absent from the index (query-level filtering, tested)
-
PostPublishedhandler upserts the search doc; failure is logged, not thrown - Revalidation call sends the secret and swallows/logs failures
-
reindexrebuilds posts (test via the existing search fakes)
Conventions (project-wide, non-negotiable)
- .NET 9, records for immutable shapes, file-scoped namespaces, primary constructors where they read well. Minimal-API endpoints grouped per module via
IEndpointModule.MapEndpoints. Result<T>(SharedKernel) instead of exception-driven control flow. Endpoint results map failures to ProblemDetails with the stable error codes listed above — the frontend keys off them.- Module owns its EF Core
DbContextmapped to its own Postgres schema. Modules never reference each other's internals — cross-module needs go through a public contract interface or an in-process domain event (IEventPublisher). - All external calls (GitHub, Stripe, Brevo, Cloudinary, Meilisearch) behind interfaces owned by the consuming module.
- Every list endpoint paginated (offset is fine). xUnit tests in
tests/CommunityPro.Tests/<Module>/following the existing harness patterns (seeMembers/MembersTestHarness.cs).
- Ngôn ngữ chính
- C#
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của CommunityPro/community-pro-api
-
cross-cutting decision
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
cross-cutting
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 58/100
-
admin
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
admin
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
-
sponsorship
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 48/100
Tất cả issue của CommunityPro/community-pro-api
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
stryker-mutator/stryker-net#3892 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
MobiFlight/MobiFlight-Connector#3419 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
`Source` with an `avares://` URI and a `#fragment` throws instead of scrolling to the anchorĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Kryptos-FR/MarkView.Avalonia#105 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[辞書]Đang mở提案 辞書
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
microsoft/fluentui-blazor#5410 ·
Maintainer thường phản hồi trong vòng 1 ngày