diff --git a/README.md b/README.md index d5e1f1d..34f1d41 100644 --- a/README.md +++ b/README.md @@ -1,51 +1,46 @@ # Nodejs Expressjs MongoDB Ready-to-use API Project Structure -[![Author](http://img.shields.io/badge/author-@maitraysuthar-blue.svg)](https://www.linkedin.com/in/maitray-suthar/) [![GitHub license](https://img.shields.io/github/license/maitraysuthar/rest-api-nodejs-mongodb.svg)](https://github.com/maitraysuthar/rest-api-nodejs-mongodb/blob/master/LICENSE) ![GitHub repo size](https://img.shields.io/github/repo-size/maitraysuthar/rest-api-nodejs-mongodb) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b3eb80984adc4671988ffb22d6ad83df)](https://www.codacy.com/manual/maitraysuthar/rest-api-nodejs-mongodb?utm_source=github.com&utm_medium=referral&utm_content=maitraysuthar/rest-api-nodejs-mongodb&utm_campaign=Badge_Coverage) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b3eb80984adc4671988ffb22d6ad83df)](https://www.codacy.com/manual/maitraysuthar/rest-api-nodejs-mongodb?utm_source=github.com&utm_medium=referral&utm_content=maitraysuthar/rest-api-nodejs-mongodb&utm_campaign=Badge_Grade) ![Travis (.com)](https://img.shields.io/travis/com/maitraysuthar/rest-api-nodejs-mongodb) -A ready-to-use boilerplate for REST API Development with Node.js, Express, and MongoDB +[![Author](http://img.shields.io/badge/author-@maitraysuthar-blue.svg)](https://www.linkedin.com/in/maitray-suthar/) [![GitHub license](https://img.shields.io/github/license/maitraysuthar/rest-api-nodejs-mongodb.svg)](https://github.com/maitraysuthar/rest-api-nodejs-mongodb/blob/master/LICENSE) ![GitHub repo size](https://img.shields.io/github/repo-size/maitraysuthar/rest-api-nodejs-mongodb) [![Codacy Badge](https://api.codacy.com/project/badge/Coverage/b3eb80984adc4671988ffb22d6ad83df)](https://www.codacy.com/manual/maitraysuthar/rest-api-nodejs-mongodb?utm_source=github.com&utm_medium=referral&utm_content=maitraysuthar/rest-api-nodejs-mongodb&utm_campaign=Badge_Coverage) [![Codacy Badge](https://api.codacy.com/project/badge/Grade/b3eb80984adc4671988ffb22d6ad83df)](https://www.codacy.com/manual/maitraysuthar/rest-api-nodejs-mongodb?utm_source=github.com&utm_medium=referral&utm_content=maitraysuthar/rest-api-nodejs-mongodb&utm_campaign=Badge_Grade) ![Travis (.com)](https://img.shields.io/travis/com/maitraysuthar/rest-api-nodejs-mongodb) +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 - ## 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](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: +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/). ## Buy me a Coffee -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:. +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. Buy Me A Coffee ## Features -- Basic Authentication (Register/Login with hashed password) -- Account confirmation with 4 (Changeable) digit OTP. -- Email helper ready just import and use. -- JWT Tokens, make requests with a token after login with `Authorization` header with value `Bearer yourToken` where `yourToken` will be returned in Login response. -- Pre-defined response structures with proper status codes. -- Included CORS. -- **Book** example with **CRUD** operations. -- Validations added. -- Included API collection for Postman. -- Light-weight project. -- Test cases with [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/). -- Code coverage with [Istanbuljs (nyc)](https://istanbul.js.org/). -- Included CI (Continuous Integration) with [Travis CI](https://travis-ci.org). -- Linting with [Eslint](https://eslint.org/). +- Basic Authentication (Register/Login with hashed password) +- Account confirmation with 4 (Changeable) digit OTP. +- Email helper ready just import and use. +- JWT Tokens, make requests with a token after login with `Authorization` header with value `Bearer yourToken` where `yourToken` will be returned in Login response. +- Pre-defined response structures with proper status codes. +- Included CORS. +- **Book** example with **CRUD** operations. +- Validations added. +- Included API collection for Postman. +- Light-weight project. +- Test cases with [Mocha](https://mochajs.org/) and [Chai](https://www.chaijs.com/). +- Code coverage with [Istanbuljs (nyc)](https://istanbul.js.org/). +- Included CI (Continuous Integration) with [Travis CI](https://travis-ci.org). +- Linting with [Eslint](https://eslint.org/). ## Software Requirements -- Node.js **8+** -- MongoDB **3.6+** (Recommended **4+**) +- Node.js **8+** +- MongoDB **3.6+** (Recommended **4+**) ## How to install @@ -78,7 +73,9 @@ npm install ``` 3. The file `.env` is already ignored, so you never commit your credentials. 4. Change the values of the file to your environment. Helpful comments added to `.env.example` file to understand the constants. -## Project structure + +## Project structure + ```sh . ├── app.js @@ -111,9 +108,10 @@ npm install └── stylesheets └── style.css ``` + ## How to run -### Running API server locally +### Running API server locally ```bash npm run dev @@ -127,7 +125,8 @@ App is running ... Press CTRL + C to stop the process. ``` -**Note:** `YOUR_DB_CONNECTION_STRING` will be your MongoDB connection string. + +**Note:** `YOUR_DB_CONNECTION_STRING` will be your MongoDB connection string. ### Creating new models @@ -143,7 +142,7 @@ If you need to add more controllers to the project just create a new file in `/c ## Tests -### Running Test Cases +### Running Test Cases ```bash npm test @@ -157,7 +156,7 @@ If you need to add more test cases to the project just create a new file in `/te ## ESLint -### Running Eslint +### Running Eslint ```bash npm run lint @@ -171,4 +170,4 @@ Every project needs improvements, Feel free to report any bugs or improvements. ## License -This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information. \ No newline at end of file +This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.