You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A ready-to-use boilerplate for REST API Development with Node.js, Express, and MongoDB
6
6
7
7
## Getting started
8
8
9
-
10
9
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).
11
10
12
11
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.
13
12
14
-
## Some Great Stuff
15
-
16
-
<ahref="https://tracking.gitads.io/?campaign=gitads&repo=rest-api-nodejs-mongodb&redirect=gitads.io"target="_blank"><imgsrc="https://images.gitads.io/rest-api-nodejs-mongodb"alt="Some Great Stuff"style="height: auto!important;width: auto!important;" ></a>
17
-
<br><i>This advert was placed by <ahref="https://tracking.gitads.io/?campaign=gitads&repo=rest-api-nodejs-mongodb&redirect=gitads.io"rel="gitads">GitAds</a> </i>
18
-
19
13
## Advertise for Job/Work Contract
20
14
21
-
I am looking for a good job or work contract. You can contact me directly on my email ([maitraysuthar@gmail.com](mailto:maitraysuthar@gmail.com"maitraysuthar@gmail.com")) or you can download my CV from my personal [website](https://maitraysuthar.github.io/portfolio/). Looking forward. Thanks :smile:
15
+
I am open for a good job or work contract. You can contact me directly on my email ([maitraysuthar@gmail.com](mailto:maitraysuthar@gmail.com"maitraysuthar@gmail.com")) or you can download my CV from my personal [website](https://maitraysuthar.github.io/portfolio/).
22
16
23
17
## Buy me a Coffee
24
18
25
-
If you consider my project as helpful stuff, You can appreciate me or my hard work and time spent to create this helpful structure with buying a coffee for me. I would be very thankful if you buy me a coffee, please buy me a coffee :smile:.
19
+
If you consider my project as helpful stuff, You can appreciate me or my hard work and time spent to create this helpful structure with buying me a coffee.
26
20
27
21
<ahref="https://www.buymeacoffee.com/36GgOoQ2f"target="_blank"><imgsrc="https://bmc-cdn.nyc3.digitaloceanspaces.com/BMC-button-images/custom_images/orange_img.png"alt="Buy Me A Coffee"style="height: auto!important;width: auto!important;" ></a>
28
22
29
23
## Features
30
24
31
-
- Basic Authentication (Register/Login with hashed password)
32
-
- Account confirmation with 4 (Changeable) digit OTP.
33
-
- Email helper ready just import and use.
34
-
- JWT Tokens, make requests with a token after login with `Authorization` header with value `Bearer yourToken` where `yourToken` will be returned in Login response.
35
-
- Pre-defined response structures with proper status codes.
36
-
- Included CORS.
37
-
-**Book** example with **CRUD** operations.
38
-
- Validations added.
39
-
- Included API collection for Postman.
40
-
- Light-weight project.
41
-
- Test cases with [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/).
42
-
- Code coverage with [Istanbuljs (nyc)](https://istanbul.js.org/).
43
-
- Included CI (Continuous Integration) with [Travis CI](https://travis-ci.org).
44
-
- Linting with [Eslint](https://eslint.org/).
25
+
- Basic Authentication (Register/Login with hashed password)
26
+
- Account confirmation with 4 (Changeable) digit OTP.
27
+
- Email helper ready just import and use.
28
+
- JWT Tokens, make requests with a token after login with `Authorization` header with value `Bearer yourToken` where `yourToken` will be returned in Login response.
29
+
- Pre-defined response structures with proper status codes.
30
+
- Included CORS.
31
+
-**Book** example with **CRUD** operations.
32
+
- Validations added.
33
+
- Included API collection for Postman.
34
+
- Light-weight project.
35
+
- Test cases with [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/).
36
+
- Code coverage with [Istanbuljs (nyc)](https://istanbul.js.org/).
37
+
- Included CI (Continuous Integration) with [Travis CI](https://travis-ci.org).
38
+
- Linting with [Eslint](https://eslint.org/).
45
39
46
40
## Software Requirements
47
41
48
-
- Node.js **8+**
49
-
- MongoDB **3.6+** (Recommended **4+**)
42
+
- Node.js **8+**
43
+
- MongoDB **3.6+** (Recommended **4+**)
50
44
51
45
## How to install
52
46
@@ -79,7 +73,9 @@ npm install
79
73
```
80
74
3. The file `.env` is already ignored, so you never commit your credentials.
81
75
4. Change the values of the file to your environment. Helpful comments added to `.env.example` file to understand the constants.
82
-
## Project structure
76
+
77
+
## Project structure
78
+
83
79
```sh
84
80
.
85
81
├── app.js
@@ -112,9 +108,10 @@ npm install
112
108
└── stylesheets
113
109
└── style.css
114
110
```
111
+
115
112
## How to run
116
113
117
-
### Running API server locally
114
+
### Running API server locally
118
115
119
116
```bash
120
117
npm run dev
@@ -128,7 +125,8 @@ App is running ...
128
125
129
126
Press CTRL + C to stop the process.
130
127
```
131
-
**Note:**`YOUR_DB_CONNECTION_STRING` will be your MongoDB connection string.
128
+
129
+
**Note:**`YOUR_DB_CONNECTION_STRING` will be your MongoDB connection string.
132
130
133
131
### Creating new models
134
132
@@ -144,7 +142,7 @@ If you need to add more controllers to the project just create a new file in `/c
144
142
145
143
## Tests
146
144
147
-
### Running Test Cases
145
+
### Running Test Cases
148
146
149
147
```bash
150
148
npm test
@@ -158,7 +156,7 @@ If you need to add more test cases to the project just create a new file in `/te
158
156
159
157
## ESLint
160
158
161
-
### Running Eslint
159
+
### Running Eslint
162
160
163
161
```bash
164
162
npm run lint
@@ -172,4 +170,4 @@ Every project needs improvements, Feel free to report any bugs or improvements.
172
170
173
171
## License
174
172
175
-
This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.
173
+
This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.
0 commit comments