DEV Community

Cover image for Build an API using Node, Express, MongoDB, and Docker

Build an API using Node, Express, MongoDB, and Docker

Mangabo Kolawole on October 17, 2021

In this tutorial, we'll be using TypeScript and Docker to build a Menu Restaurant API app from scratch with Node, Express, and MongoDB. The Docker ...
Collapse
 
racribeiro profile image
Rui Ribeiro

Why mongoose and not just mongodb library? (document models?)

An API should always provide OpenAPI schema, how can you add it to this project? If you have models, it should be straight forward...

Collapse
 
koladev profile image
Mangabo Kolawole

Yes. I went with mongoose because of the abstraction it provides to define schema and make queries.

About the OpenAPI schema, I think that there are swagger packages for Nodejs you can use to document your API. I haven't try it yet.

Let me know if you have some suggestions

Collapse
 
andrewbaisden profile image
Andrew Baisden

This was great I was planning to write an article like this eventually 😄

Collapse
 
koladev profile image
Mangabo Kolawole

Interesting.

I would love to read it :)

Collapse
 
juni profile image
Junaid Anwar

Would be great if you improve this article to cover the authenticated/protected routes.

Collapse
 
meo3w profile image
Phil Hasenkamp

Well done!

Collapse
 
koladev profile image
Mangabo Kolawole

Thank you Phil :)

Collapse
 
godswillumukoro profile image
Godswill Umukoro

Great article bro

Collapse
 
koladev profile image
Mangabo Kolawole

Thank you man

Collapse
 
juni profile image
Junaid Anwar

Great article! What would you do to protect the crud routes?

Collapse
 
koladev profile image
Mangabo Kolawole

Looking to add JWT authentication to these routes.

I'll write something on it. Stay tuned :)