Skip to content

Add public read API slice#10

Merged
wauputr4 merged 2 commits intomainfrom
codex/public-read-api
May 10, 2026
Merged

Add public read API slice#10
wauputr4 merged 2 commits intomainfrom
codex/public-read-api

Conversation

@wauputr4
Copy link
Copy Markdown
Contributor

Summary

  • Add repository modules for public organizations, posts, and impact reports.
  • Add public read endpoints for organization profiles, organization posts, organization impact reports, global posts, and post detail.
  • Add kelompok seed demo plus Makefile/docs updates so the public MVP has data to render.

Public endpoints

GET /api/v1/organizations
GET /api/v1/organizations/{slug}
GET /api/v1/organizations/{slug}/posts
GET /api/v1/organizations/{slug}/impact-reports
GET /api/v1/posts
GET /api/v1/posts/{slug}

Validation

  • make test
  • go mod tidy
  • go run ./cmd/kelompok help
  • git diff --check
  • Ran kelompok seed demo against the dev database
  • Smoke-tested /readyz, /api/v1/organizations?limit=1, /api/v1/organizations/gerakan-hijau-nusantara/posts, /api/v1/organizations/gerakan-hijau-nusantara/impact-reports, and /api/v1/posts/first-neighborhood-climate-lab against the local API connected to dev DB

Refs #3

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces the initial public read API for organizations, posts, and impact reports, including new repository layers, HTTP handlers with pagination, and a CLI command for seeding demo data. Documentation and the Makefile have been updated to reflect these additions. The review feedback suggests several technical refinements: using COALESCE in SQL queries to prevent scanning errors on NULL values, pre-allocating slice capacities to optimize memory usage, and refactoring a duplicated helper function into a shared package to improve maintainability.

Comment thread internal/organizations/repository.go Outdated
Comment thread internal/organizations/repository.go Outdated
Comment thread internal/posts/repository.go Outdated
Comment thread internal/impact/repository.go Outdated
Comment thread internal/organizations/repository.go Outdated
Comment thread internal/organizations/repository.go Outdated
Comment thread internal/posts/repository.go Outdated
Comment thread internal/posts/repository.go Outdated
Comment thread internal/impact/repository.go Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 78bb3ee14e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/posts/repository.go Outdated
Comment thread internal/httpapi/server.go
@wauputr4 wauputr4 merged commit 9fda86b into main May 10, 2026
1 check passed
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