GEMA is a collaborative social application for text and image posts. My contributions examined here are feed ranking and the server-side image-processing endpoint.
01 / THE RANKING FUNCTION
The home feed scores a post using its age in hours and its like count. The implementation squares the like term, so enough engagement can outweigh the age penalty.
Illustrative inputs · fixed at one instant
Chronological order is C → A → B. The score produces B → A → C. These are derived examples, not captured posts or engagement measurements.
src/hooks/usePostSystem.js · calculateRelevancyScore · TIME_WEIGHT = 1, LIKE_WEIGHT = 2.
02 / COMPARE THE ORDERS
Chronology privileges the most recent post. The repository also contains a separate chronological hook for profile-oriented views.
The scoring rule privileges the balance of age and engagement encoded in its formula. It is a heuristic, not a learned recommendation model.
Derived comparison for the same illustrative inputs. Selecting a view does not query or modify the live feed.
03 / KEEPING THE FEED RESPONSIVE
A Realtime Database query orders by createdAt and loads the latest 30 records. The listener supplies updated snapshots.
A Map keyed by ID merges incoming records with existing posts before sorting. Older pages use endBefore(lastVisibleTimestamp), with a 30-record limit.
The like handler updates the visible count and membership optimistically. A failed database write restores the previous values.
04 / AN IMAGE HAS A PIPELINE
Selected image or camera capture
Resize to width 800
JPEG quality setting 80
Upload bytes, receive URL,
reference it in the post
posting.js sends a FormData file to /api/sharp before Firebase Storage upload. The endpoint returns JPEG bytes. The width and quality are implementation settings, not evidence of a particular compression ratio or visual-quality score.
The observed logged-out composer is disabled. Authentication is required to post; the walkthrough remains logged out.
The local development copy returned auth/invalid-api-key. The deployed screenshots establish visible states on the repository-linked website, not a verified match to the local commit.
05 / CONTRIBUTION & STATUS
Commit 88a3be82 introduces usePostSystem and the age/like scoring function. ab0d51f9 revises the hook. 3476cdd2 introduces the Sharp endpoint; eb5790c updates its resize and quality settings.
Git history also records substantial work by Rafli and other authors. Notification handling and camera/photo changes include collaborator commits. The source contains group credits; this is not presented as a solo-built application.
Current package metadata: 0.9.0-dev, Next.js 15.0.2 and a React 19 release candidate. Inspected source: usePostSystem.js, useChronologicalPosts.js, posting.js, api/sharp/route.js and Git history/blame. Repository: github.com/haritsrs/gema.
Public deployment inspected 15 October 2026: gema-610a4.web.app. Cropped composer and account screenshots exclude other users’ content and contain no credentials. Some deployed images failed to load. No production reliability, moderation effectiveness, adoption or ranking-quality claim is made.
The native sorting Scene is visually editable. Other compositions and the explanatory ordering control use supported Custom markup and a shared bundled runtime. All illustrated posts and scores are expressly derived examples.