E R
Engage Rank
Technical Deep Dive

How Janamat
Engage Works.

An end-to-end pipeline that converts on-chain Solana votes into gamified civic points transparently and in real-time.

⚡The Vote-to-Points Pipeline

01

Vote on Janamat

The user submits a vote via the Janamat app. This calls the cast_vote instruction on the vote_program Anchor program deployed on Solana devnet.

cast_vote · vote_program · Solana Devnet
02

VoteCasted Event Emitted

The program emits a VoteCasted event in transaction logs with voter pubkey, poll index, and vote type (YesNo, SingleChoice, Ranked, MultipleChoice).

VoteCasted · Anchor BorshCoder · Program Logs
03

Backend Listener Decodes

Our Express backend subscribes to program logs via connection.onLogs. It decodes the event using the vote_program IDL and extracts voter details.

connection.onLogs · @solana/web3.js · Express
04

engage_registry Awards Points

The backend calls award_points on our engage_registry Anchor program. This updates the voter's on-chain EngageProfile PDA. Points accumulate with streak bonuses (base 1 pt + up to 2 bonus pts for consecutive daily votes).

engage_registry · EngageProfile PDA · Streak Logic
05

Leaderboard Direct from Chain

GET /leaderboard fetches all EngageProfile accounts directly from Solana using program.account.engageProfile.all(). No database the chain IS the source of truth. Sorted by totalPoints.

engageProfile.all() · GET /leaderboard · Next.js ISR

🔧Tech Stack

Purposefully chosen for the Superteam Earn Mini Hack scope.

Solana
Anchor 0.32
engage_registry
Express.js
Next.js 16
Tailwind v4
Space Grotesk
EngageProfile PDA

🛡️Integrity Guarantees

The system is designed to be trustworthy, fair, and resilient.

🔒

Fully On-Chain

Points are stored in EngageProfile PDAs on Solana not in any database. Anyone can independently verify any voter's score using the program's public key.

⚡

Real-Time Updates

The backend listener runs 24/7 via connection.onLogs. VoteCasted events are decoded and awarded on-chain within seconds of finality.

🔥

Streak Bonuses

The engage_registry program tracks daily voting streaks on-chain. Base 1 pt per vote + up to 2 bonus pts for consistent voting every 24-48 hours. Maximum 3 points per vote.

🛡️

Immutable Rewards

Points earned are permanent and cannot be revoked. Once you vote and earn points, they're yours forever building trust and fairness into the system.

⛓️On-Chain Data Schema

Two on-chain Anchor accounts replace the database entirely.

EngageProfile PDA

voterPubkey (PDA seed)
total_pointsu64
vote_countu64
current_streaku32
longest_streaku32
last_vote_timestampi64

GlobalState PDA

authorityPubkey
total_votersu64
total_votes_recordedu64

Ready to participate?

Every vote you cast on Janamat is verified on-chain and earns you points.