DEV Community

Maitray Suthar
Maitray Suthar

Posted on

Nodejs Expressjs MongoDB Ready-to-use API Project Structure

Hello Everyone,

I have created a boilerplate application for API development built with Nodejs, ExpressJs, MongoDB.

GitHub logo maitraysuthar / rest-api-nodejs-mongodb

A boilerplate for REST API Development with Node.js, Express, and MongoDB

Nodejs Expressjs MongoDB Ready-to-use API Project Structure

Author GitHub license GitHub repo size Codacy Badge Codacy Badge Travis (.com)

A ready-to-use boilerplate for REST API Development with Node.js, Express, and MongoDB

Getting started

This is a basic API skeleton written in JavaScript ES2015. Very useful to building a RESTful web APIs for your front-end platforms like Android, iOS or JavaScript frameworks (Angular, Reactjs, etc).

This project will run on NodeJs using MongoDB as database. I had tried to maintain the code structure easy as any beginner can also adopt the flow and start building an API. Project is open for suggestions, Bug reports and pull requests.

Some Great Stuff

Some Great Stuff
This advert was placed by GitAds

Advertise for Job/Work Contract

I am looking for a good job or work contract. You can contact me directly on my email (maitraysuthar@gmail.com) or you can download my CV from my personal website. Looking forward. Thanks 😄

Buy me a Coffee

If you consider…

This is a basic API skeleton written in JavaScript ES2015. Very useful to building a RESTful web APIs for your front-end platforms like Android, iOS or JavaScript frameworks (Angular, Reactjs, etc).

This project will run on NodeJs using MongoDB as a database. I had tried to maintain the code structure easy as any beginner can also adopt the flow and start building an API.

Any feedback or suggestions are very much appreciated. Pull requests are welcome!

Top comments (6)

Collapse
 
iceboss3d profile image
Ayebakuro Ombu

Great stuff! Exactly what I needed to keep off a project.

Collapse
 
maitraysuthar profile image
Maitray Suthar

Happy to hear that it helps you. :)

Collapse
 
iceboss3d profile image
Ayebakuro Ombu

I don't know if I should ask this here or on GitHub, but when I deploy to heroku, I have issues with the environment variables.

"expiresIn" should be a number of seconds or string representing a timespan eg: "1d", "20h", 60

A log of the environment variable shows that the variable in heroku settings is correct.

Collapse
 
iceboss3d profile image
Ayebakuro Ombu

The same applies to SendGrid's API in the node env, except it's hard coded it doesn't work.

Thread Thread
 
maitraysuthar profile image
Maitray Suthar

You can refer env.example file. Where you can find configured variables & its examples.

Collapse
 
iceboss3d profile image
Ayebakuro Ombu

never mind, figured it out. I wrapped the variables using ' ', i removed it and it works