finds.dev← search

// the find

mosh-hamedani/vidly-api-node

★ 314 · JavaScript · updated Mar 2022

Course companion code for Mosh Hamedani's Node.js and React courses — a fake video rental API built with Express and MongoDB. It exists to be studied alongside paid course content, not to be used as a production starter or reference architecture.

Clean separation of concerns with startup/, middleware/, routes/, and models/ folders that a beginner can actually follow. Middleware composition is done right — auth, validation, and async error handling are each in their own file rather than inlined everywhere. Integration tests cover the auth and rental return flows with real DB calls, which is the correct instinct for this kind of app. JWT config is externalized via the node-config package with environment variable override support.

Last touched in early 2022 and dependencies are almost certainly years out of date — Express 4, old Mongoose, probably Joi from before the API stabilized. The README buries the jwtPrivateKey default-checked-into-source-control warning at the bottom under '(Optional)' — that's a bad habit to teach students. No pagination anywhere, which is fine for a toy but means anyone who cargo-cults this into a real project has a production incident waiting. Only three integration test files for seven route files; the customers, movies, and rentals routes are untested at that level.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →