This is the backend for a TMDB-powered media tracking application. It allows users to search for movies and TV shows, add them to their personal lists, track progress, and manage their media library. The backend is built with Node.js, Express, and MongoDB.
- User Authentication: Register, login, JWT-based authentication, and protected routes.
- Media Management: Add, update, delete, and fetch user-specific media (movies, TV, anime, etc.).
- TMDB Integration: Search and fetch details for movies and TV shows using the TMDB API, with caching and rate limiting.
- User Media Tracking: Track status, rating, progress, favorites, and episode/season progress for each user/media pair.
- Validation & Error Handling: Input validation and centralized error handling for robust API responses.
- Rate Limiting: Protects TMDB endpoints from abuse.
POST /users- Register a new userPOST /users/login- Login and receive a JWT
POST /media- Add media to user listGET /media- Get all media for the current userGET /media/:id- Get all media for a specific user (if authorized)GET /media/:id/my-media- Get all media for the current user (alias)PUT /media/:id- Update a user's media entryDELETE /media/:id- Delete a user's media entryDELETE /media/all/:id- Delete all media for a user
GET /movie/search?query=...- Search for moviesGET /movie/:id- Get movie detailsGET /movie/popular- Get popular moviesGET /movie/trending- Get trending moviesGET /tv/search?query=...- Search for TV showsGET /tv/:id- Get TV show details
- Node.js, Express
- MongoDB (Mongoose)
- TMDB API (v3/v4)
- JWT for authentication
- Joi for validation
- Clone the repo
- Run
npm install - Create a
.envfile with your MongoDB URI, TMDB API key, and other secrets - Start the server:
npm start
- All protected routes require a valid JWT in the
Authorizationheader. - Rate limiting is applied to TMDB endpoints.
- Caching is used for TMDB search results to reduce API calls.
Feel free to extend this README as you add more features or endpoints!