Meet Parekh Pmeet
π Working from home Follow Webflow | Python | Django | Open Source Enthusiast | Freelancer 0 followers Β· 2 following- Remote
- 00:42 (UTC +05:30)
- @meetprkh
Achievements



Achievements


Block or report Pmeet
Report abuseContact GitHub support about this userβs behavior. Learn more about reporting abuse.
Report abuse More Pmeet/README.mdβΉ Paisa Radar
A free India investing research web app for stocks and mutual funds β discover, filter, compare, and track without a paywalled screener.
Built on open, official data sources:
| Source | What it provides | How it's used |
|---|---|---|
| AMFI NAVAll.txt | Daily NAVs, scheme names, AMCs, SEBI categories for every MF scheme | Parsed on each refresh into the fund universe |
NSE index API (equity-stockIndices) |
Index constituents with price, change, volume, 52-week range | Fetched per configured index (NIFTY 50 / NEXT 50 / MIDCAP 50 by default) |
| mfapi.in (optional) | Free per-scheme NAV history | Computes 1Y/3Y/5Y returns during refresh |
| SEBI category rules | Riskometer-style classification | Fallback risk inference by scheme category |
No paid screener or subscription endpoint is used anywhere. Every source URL is an environment variable, so a moved endpoint is a config change, not a code change.
Features (MVP)
- Stock discovery β filter by sector, market-cap bucket, and index; sort by gainers, losers, volume, price, or P/E; paginated.
- Mutual fund discovery β filter by category, AMC, risk label, AUM floor, and minimum 1Y return; sort by returns or AUM.
- Unified search β one box searches symbols, company names, sectors, scheme names, AMCs, and sub-categories, ranked by match quality.
- Compare β 2 to 5 assets side by side (stocks and funds can be mixed; each group gets its own metric table). The best numeric value per row is highlighted. Comparisons are shareable URLs.
- Watchlist β save any asset with one tap (stored in
localStorage, shaped for a future account-backed API). Alerts are a visible phase-2 placeholder. - Plain-language metrics β hover/long-press any metric label for a simple explanation.
Architecture
Browser ββ pages (Next.js App Router, Tailwind)
β
βΌ
API routes (/api/stocks /funds /search /compare /meta /audits /refresh)
β
βΌ
store.ts β 3-tier data access
1. in-memory cache (5 min TTL, per instance)
2. Postgres (Supabase/Neon) when DATABASE_URL is set
3. bundled seed JSON (data/seed/) β zero-config fallback
β²
refresh.ts β scheduled ingestion (Vercel Cron β /api/refresh)
ββ sources/amfi.ts β transforms/amfi.ts (NAV dump β funds)
ββ sources/nse.ts β transforms/nse.ts (index payloads β stocks)
ββ sources/amfi.ts β computeReturns (NAV history β 1Y/3Y/5Y)
Design decisions:
- Transforms are pure functions (
src/lib/transforms/) with no I/O β they carry the test coverage and make the pipeline transparent and replayable. - Merging never destroys data. AMFI's dump has no AUM/returns; NSE payloads can be partial. Refreshes merge field-by-field, so a missing value never erases a known one.
- Every refresh is audited (
refresh_audittable,/api/audits) with source, timing, row counts, and error messages. Raw payloads are cached inraw_snapshots. - The API layer is the only data path the UI uses, so a future mobile app gets the same contract for free.
Getting started
npm install npm run dev # http://localhost:3000 β works immediately on seed data npm test # vitest: data-transform and query tests
No environment variables are required for local development: without DATABASE_URL the
app serves the bundled example data in data/seed/ (illustrative sample values, not live
quotes β regenerate with node scripts/generate-seed.mjs).
Environment variables
Copy .env.example to .env.local and fill in what you need:
| Variable | Required | Purpose |
|---|---|---|
DATABASE_URL |
no | Postgres (Supabase/Neon). Enables durable storage + audit log. |
CRON_SECRET |
in prod | Bearer token protecting /api/refresh. Vercel Cron sends it automatically. |
AMFI_NAV_URL |
no | AMFI NAV dump (defaults to the official URL). |
NSE_INDEX_URL, NSE_HOME_URL |
no | NSE API endpoint template + cookie-handshake origin. |
NSE_INDICES |
no | Comma-separated indices to ingest. |
MF_HISTORY_URL |
no | NAV-history API template for returns enrichment ({CODE} placeholder). |
Database setup (optional but recommended for production)
- Create a Postgres database (Supabase or Neon free tier is fine).
- Set
DATABASE_URL(use the pooled connection string on serverless). - Apply the schema:
DATABASE_URL=... npm run db:schema - Trigger a first refresh:
curl -H "Authorization: Bearer $CRON_SECRET" https://<app>/api/refresh?source=all
Refreshing data
GET/POST /api/refresh?source=all|amfi|nse|returns (Bearer-token protected):
amfiβ pulls the full NAV dump (~15k schemes) and merges NAVs/categories.nseβ pulls each configured index; partial failures are recorded, not fatal.returnsβ enriches up to 50 growth-plan schemes per run with 1Y/3Y/5Y returns from the NAV-history API (rate-limit friendly; coverage accumulates across runs).- Every run writes an audit row; inspect via
GET /api/audits.
vercel.json schedules a weekday refresh at 12:30 UTC (6 pm IST, after AMFI publishes
daily NAVs).
Live stock quotes during market hours
Stock prices update near-live (default: at most 3 minutes old) while NSE is open (09:15β15:30 IST, MonβFri), without needing high-frequency crons:
- Server: any stock request during market hours checks data age; if stale, a
background refresh (Next.js
after()) pulls fresh NSE quotes once β with per-instance locking and a 90-second attempt backoff so traffic spikes can't stampede NSE. - Client: stock lists and detail pages re-poll every 60 seconds while the market is open and the tab is visible, and show a pulsing Live badge with the quote time (IST). When the market is closed, polling stops and the badge shows "Market closed".
- A 15-minute grace window after the close captures closing prices.
- Tune with
LIVE_REFRESH_SECONDS; list NSE holidays inNSE_HOLIDAYSto skip polling.
This is polling of NSE's public API, not exchange tick data β quotes can lag by a couple of minutes and NSE may throttle data-center IPs. When a refresh fails, the app keeps serving the last good data, the failure lands in the audit log, and the badge's timestamp makes the data age visible.
Known constraint: NSE's API sits behind a cookie handshake and rate-limits aggressively
from data-center IPs. The fetcher does the handshake and degrades gracefully (partial
data + audit entry); if it is blocked entirely, the app keeps serving the last good data
(DB or seed). For production-grade stock coverage, point NSE_INDEX_URL at your own
mirror/proxy of the official data.
Deploying to Vercel
- Push this repo to GitHub and import it in Vercel (framework auto-detected: Next.js).
- Add environment variables:
DATABASE_URL,CRON_SECRET(and any source overrides). - Deploy. The cron in
vercel.jsonis picked up automatically (Hobby plan allows daily crons; the default schedule works on all plans). - Apply the DB schema once from your machine:
DATABASE_URL=... npm run db:schema. - Hit
/api/refresh?source=allonce with the bearer token to populate real data.
API reference
| Endpoint | Query params | Notes |
|---|---|---|
GET /api/stocks |
q, sector, cap, index, sort, page, pageSize |
sort prefix - = descending |
GET /api/funds |
q, category, subCategory, amc, risk, minAum, maxAum, minReturn1y, sort, page, pageSize |
|
GET /api/search |
q, limit |
Unified, ranked across both types |
GET /api/compare |
ids=stock:RELIANCE,fund:120465 |
2β5 ids; unknown ids reported in missing |
GET /api/meta |
β | Distinct sectors/categories/AMCs for filter UIs |
GET /api/audits |
β | Recent refresh audit log |
GET /api/refresh |
source |
Bearer-token protected |
Roadmap (built for, not yet built)
- Alerts β the watchlist already reserves a per-item
alertslot; a cron route can evaluate rules and notify. - Account-backed watchlists β the
localStorageshape (kind+id) imports directly into awatchliststable keyed by user. - Portfolio tracking β buy/sell transactions on top of the same normalized tables.
- More sources β additional indices via
NSE_INDICES; AMFI AUM downloads; SEBI statistics for validation.
Disclaimer
Data may be delayed, incomplete, or (in seed mode) illustrative sample data. This is a research tool, not investment advice. Verify with official sources β AMFI, NSE, SEBI, and AMC pages β before making investment decisions.
Pinned Loading
-
dash dash Public
Forked from plotly/dash
Analytical Web Apps for Python, R, Julia, and Jupyter. No JavaScript Required.
Python
-
client-python client-python Public
Forked from civo/client-python
Python package to interact with Civo's API
Python
-
chalice chalice Public
Forked from aws/chalice
Python Serverless Microframework for AWS
Python
-
cookiecutter cookiecutter Public
Forked from cookiecutter/cookiecutter
A cross-platform command-line utility that creates projects from cookiecutters (project templates), e.g. Python package projects, C projects.
Python
-
Gooey Gooey Public
Forked from chriskiehl/Gooey
Turn (almost) any Python command line program into a full GUI application with one line
Python
-
openverse-catalog openverse-catalog Public
Forked from WordPress/openverse-catalog
Identifies and collects data on cc-licensed content across web crawl data and public apis.
Python
If the problem persists, check the GitHub status page or contact support.
Uh oh!
There was an error while loading. Please reload this page.