GEMASocial application.

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.

Actual logged-out GEMA composer: posting is disabled until authentication.
Cropped from the repository-linked deployment, 15 October 2026. No other users’ posts are reproduced.
Inspect the ranking rule ↓

01 / THE RANKING FUNCTION

How age and likes
affect rank.

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.

(likes + 1)2age in hours + 2

Illustrative inputs · fixed at one instant

A
2 hours old · 1 like
4 / 4 = 1.000
B
24 hours old · 5 likes
36 / 26 ≈ 1.385
C
1 hour old · 0 likes
1 / 3 ≈ 0.333

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

Compare recency
and relevancy.

  1. C1 hour old · 0 likes01
  2. A2 hours old · 1 like02
  3. B24 hours old · 5 likes03

Chronology privileges the most recent post. The repository also contains a separate chronological hook for profile-oriented views.

Derived comparison for the same illustrative inputs. Selecting a view does not query or modify the live feed.

03 / KEEPING THE FEED RESPONSIVE

Receiving updates
without duplicate posts.

01

Listen to recent posts.

A Realtime Database query orders by createdAt and loads the latest 30 records. The listener supplies updated snapshots.

02

Merge by post ID.

A Map keyed by ID merges incoming records with existing posts before sorting. Older pages use endBefore(lastVisibleTimestamp), with a 30-record limit.

03

Respond before the write resolves.

The like handler updates the visible count and membership optimistically. A failed database write restores the previous values.

04 / AN IMAGE HAS A PIPELINE

From image selection
to a stored JPEG.

File

Selected image or camera capture

→
Sharp

Resize to width 800
JPEG quality setting 80

→
Storage

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.

05 / CONTRIBUTION & STATUS

Contributions to a
collaborative application.

My traced contributions

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.

Collaborative work

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.

Sources and evidence limits

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.