Skip to content

mongodb-developer/typescript-movie-watchlist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

movie-reviews

REST API for searching movies with MongoDB Atlas Search, managing a watchlist in the same cluster, and assigning 1–5 star ratings. Built with Node.js, TypeScript, Express, and the official MongoDB Node.js driver. There is no web UI—call the API with Bruno (see bruno/), Postman, or any HTTP client.

For endpoint behavior, data model notes, and implementation details, see AGENTS.md.

Prerequisites

  • Node.js (LTS recommended; the companion tutorial targets Node.js 22+)
  • MongoDB Atlas with the sample_mflix database loaded (e.g. Atlas sample dataset), including the movies collection used for search and watchlist lookups
  • Atlas Search on that cluster: a search index on sample_mflix.movies whose name matches SEARCH_INDEX_NAME (or default). The app does not create the index. Use resources/atlas-search-index.json and the short UI checklist in resources/atlas-search-setup.txt.

Quick start

  1. Install dependencies (this repo uses pnpm):

    pnpm install
  2. Configure environment — create a .env file in the project root (do not commit secrets):

    MONGODB_URI=mongodb+srv://<USER>:<PASSWORD>@<HOST>/
    PORT=3000
    SEARCH_INDEX_NAME=default

    MONGODB_URI is required. PORT defaults to 3000 if omitted. SEARCH_INDEX_NAME must match your Atlas Search index name; omit it to use default.

  3. Ensure Atlas Search is ready — index title and plot on movies as described in resources/. Until the index exists and is active, GET /movies/search will fail at query time.

  4. Run the server

    • Development (watch mode):

      pnpm run dev
    • Production-style: pnpm run build then pnpm start.

  5. Smoke test — open http://localhost:3000/health (or your PORT). You should see { "ok": true }.

  6. Try the API — import the Bruno collection from bruno/ (collection name Movie Ratings) or call routes listed in AGENTS.md.

Scripts

Command Description
pnpm run dev Run src/app.ts with tsx in watch mode
pnpm run build Compile TypeScript to dist/
pnpm start Run node dist/app.js

Documentation

  • AGENTS.md — Configuration, HTTP API summary, watchlist semantics, and Atlas Search pipeline overview.

Author Information

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors