Gathering detailed insights and metrics for express-mongo-spa-boilerplate
Gathering detailed insights and metrics for express-mongo-spa-boilerplate
npm install express-mongo-spa-boilerplate
Typescript
Module System
Node Version
NPM Version
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
614
Last Day
2
Last Week
4
Last Month
21
Last Year
146
Latest Version
1.3.2
Package Id
express-mongo-spa-boilerplate@1.3.2
Unpacked Size
20.02 kB
Size
6.90 kB
File Count
21
NPM Version
9.8.1
Node Version
20.5.0
Published on
Aug 23, 2023
Cumulative downloads
Total Downloads
Last Day
100%
2
Compared to previous day
Last Week
0%
4
Compared to previous week
Last Month
16.7%
21
Compared to previous month
Last Year
-68.8%
146
Compared to previous year
A full fledeged ExpressJS REST API Boilerplate! This repository serves as a foundation for kickstarting your Express.js + mongodb + SPA
projects. Features organized code structure, comprehensive API documentation, error handling, and more.
1git clone https://github.com/AbyerAli/express-mongodb-spa-boilerplate.git 2cd expressjs-starter-boilerplate 3yarn install 4yarn start
or
1npm i express-mongo-spa-boilerplate
or
1npx express-mongo-spa-boilerplate
Dotenv Validation: Environment variables are meticulously validated through the config.js
file, ensuring a robust configuration setup.
Graceful Error Handling: Easily craft false responses by utilizing the error throwing mechanism. For example:
1throw new Error('Some error XYZ occurred'); 2 3
dotenv variables are validated at config.js
throw error in the API to send false reponse e.g. throw new Error('some error xyz occured')
apidoc is generated at /public/apidoc, so remember to update docs before pushing to production with yarn run apidoc
yarn run apidoc
will generate the docs in /public/apidoc
apidocs usage:
1 2/** 3 * @api {post} /v1/users/login user login 4 * @apiVersion 1.0.0 5 * @apiName login user 6 * @apiGroup users 7 * @apiPermission authenticated user 8 * @apiBody {String} email should follow the email format. 9 * @apiBody {String} password should be at least 8 characters long. 10 * @apiExample {js} Example usage 1: 11 * const user = { 12 * "email": "John Doe", 13 * "password": "xyz" 14 * } 15 * $http.defaults.headers.common["Authorization"] = token; 16 * $http.post(url, data) 17 * .success((res, status) => doSomethingHere()) 18 * .error((err, status) => doSomethingHere()); 19 * @apiExample {js} Example usage 2: 20 * const user = { 21 * "email": "John Doe", 22 * "password": "xyz" 23 * } 24 * axios.defaults.headers.common["Authorization"] = token; 25 * axios.post(url, data) 26 * .then((res, status) => doSomethingHere()) 27 * .catch((err, status) => doSomethingHere()); 28 * 29 * @apiSuccess (Success 200) {String} token token to access the api 30 * @apiSuccessExample {json} Success response: 31 * HTTPS 200 OK 32 * { 33 * "status": true, 34 * "message": "Task saved successfully!", 35 * "data": { 36 * token: "xyz" 37 * }, 38 * } 39 * @apiUse UnauthorizedError 40*/ 41router.post('/login', validateUser, userController.userlogin);
S3, Multer, Mailer etc
.1{ 2 "status": true, 3 "message": "Task saved successfully!", 4 "data": { 5 "token": "xyz" 6 }, 7}
1{ 2 "status": false, 3 "message": "error message", 4 "error": { 5 "some error": "xyz" 6 }, 7}
express-validator
and joi
, before any route is hit, validation is done and if any error is found, express-vaidator is used to pluck out the error and send it to the user.logs
folder via use of logs middleware used in server.js
.env
file and are validated and exported at config.js
config.js
contains all the configuration for the application.server.js
is the entry point for the application.No vulnerabilities found.
No security vulnerabilities found.