DAGDA SEARCH | Back to results | Support

Pmeet (Meet Parekh) Β· GitHub

Source: https://github.com/Pmeet

@Pmeet Pmeet Follow More @Pmeet Pmeet Follow View Pmeet's full-sized avatar 🏠 Working from home

Meet Parekh Pmeet

🏠 Working from home Follow Webflow | Python | Django | Open Source Enthusiast | Freelancer 0 followers · 2 following

Achievements

Achievement: Pair ExtraordinaireAchievement: Pull SharkAchievement: Arctic Code Vault Contributor

Achievements

Achievement: Pair ExtraordinaireAchievement: Pull SharkAchievement: Arctic Code Vault Contributor

Block or report Pmeet

Report abuse

Contact 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)

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:

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)

  1. Create a Postgres database (Supabase or Neon free tier is fine).
  2. Set DATABASE_URL (use the pooled connection string on serverless).
  3. Apply the schema: DATABASE_URL=... npm run db:schema
  4. 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):

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:

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

  1. Push this repo to GitHub and import it in Vercel (framework auto-detected: Next.js).
  2. Add environment variables: DATABASE_URL, CRON_SECRET (and any source overrides).
  3. Deploy. The cron in vercel.json is picked up automatically (Hobby plan allows daily crons; the default schedule works on all plans).
  4. Apply the DB schema once from your machine: DATABASE_URL=... npm run db:schema.
  5. Hit /api/refresh?source=all once 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)

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

  1. dash dash Public

    Forked from plotly/dash

    Analytical Web Apps for Python, R, Julia, and Jupyter. No JavaScript Required.

    Python

  2. client-python client-python Public

    Forked from civo/client-python

    Python package to interact with Civo's API

    Python

  3. chalice chalice Public

    Forked from aws/chalice

    Python Serverless Microframework for AWS

    Python

  4. 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

  5. Gooey Gooey Public

    Forked from chriskiehl/Gooey

    Turn (almost) any Python command line program into a full GUI application with one line

    Python

  6. 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

Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.

Uh oh!

There was an error while loading. Please reload this page.