The Problem

Hiring teams need a quick way to visualise open tech roles worldwide, while job‑seekers want an interactive map to explore opportunities by location, company and title. Maintaining a custom UI and data pipeline for this purpose is time‑consuming and error‑prone.

What This Does

map delivers a dark‑mode, Mapbox‑driven web UI that lists jobs from a curated set of tech companies. The UI lives under src/app/ (pages, API routes, layout) and the map component is src/components/job‑map.tsx. Data fetching is performed by helpers in src/utils/data‑queries.ts and src/utils/data‑processor*.ts, which query the SQLite‑based DB defined in src/db/ (db.ts, schema.ts). The API endpoints (src/app/api/og/company/route.tsx, src/app/api/og/job/route.tsx) expose Open Graph images and raw job JSON for external consumption.

How It Is Wired

Execution starts with Next.js when npm run dev launches next dev. The framework reads src/app/layout.tsx as the root component, then routes requests to page files under src/app/.

  • Page rendering – e.g. src/app/companies/page.tsx imports src/components/companies-list.tsx, which in turn uses src/utils/data-queries.ts to pull company data.
  • Map displaysrc/components/job-map.tsx imports src/utils/map-helpers.ts and src/utils/map-control.ts to configure Mapbox, then renders markers based on results from src/utils/data-processor-server.ts.
  • API routessrc/app/api/og/company/route.tsx and src/app/api/og/job/route.tsx each import src/utils/data-queries.ts and src/utils/data-processor-edge.ts to format OG images and JSON payloads. These routes are the only modules with outgoing imports (Ce = 3) and no incoming imports, making them isolated entry points for external callers.
  • Shared utilitiessrc/components/logo.tsx is imported by two modules (Ca = 2) and contains no further imports, giving it the lowest instability.
  • Data layersrc/db/db.ts creates a Prisma‑like client (via Drizzle) that the query utils use; no other module writes to the DB, so write‑side impact is confined to the utils.

The import graph shows 68 internal modules with 11 import edges and no circular dependencies, so most code paths are short‑hopped. The most “connected” modules (src/components/logo.tsx, src/utils/data-queries.ts) have the widest blast radius because many UI components depend on them.

How To Use It

# clone
git clone https://github.com/moses-y/map.git
cd map

# install
npm install

# copy env template and set required vars
cp env.example .env.local
# edit .env.local → set NEXT_PUBLIC_MAPBOX_TOKEN and NEXT_PUBLIC_BASE_URL

# start dev server
npm run dev   # runs `next dev` on http://localhost:3000

No Dockerfile or CI scripts are present, so local Node execution is the only supported workflow.

Real‑World Use

A recruiting dashboard can embed the map at https://your‑domain.com/companies. When a user selects “OpenAI”, the page component (src/app/company/[name]/page.tsx) calls data-queries.getJobsByCompany() which runs a single DB query, formats results via data-processor-server.ts, and feeds them to job-map.tsx. The map instantly shows all OpenAI openings as clickable markers.

Code Health & Issues

  • HIGH – Duplicated code – 25 files contain 281 repeated 6‑line blocks (e.g., src/app/api/og/company/route.tsx, src/components/all-jobs-list.tsx). Extract shared helpers.
  • HIGH – Deep nesting – 18 occurrences (max depth 9) in routes and page components make logic hard to follow; refactor with guard clauses.
  • MEDIUM – High branching density – 6 files (data-processor-edge.ts, fuzzy-match.ts, etc.) contain >40 branch points in <100 lines; consider strategy tables.
  • MEDIUM – No test suite – repository lacks any *.test.* files; untested paths increase regression risk.
  • MEDIUM – No CI/CD – no .github/workflows or other pipeline configuration; automated quality gates are absent.
  • License – MIT present; lockfile (package-lock.json) is committed; no secrets detected.

The Bottom Line

map provides a functional, Next.js‑based job‑visualisation UI with a clean import graph but suffers from duplicated logic, deep nesting and a complete lack of automated testing or CI. It is suitable for teams that need a quick prototype and are comfortable adding their own test harness and refactoring the identified hotspots. Engineers planning extensive customisation should address the code‑health issues early to keep future changes manageable.