Gathering detailed insights and metrics for node-express-mongodb-jwt-rest-api-skeleton
Gathering detailed insights and metrics for node-express-mongodb-jwt-rest-api-skeleton
Gathering detailed insights and metrics for node-express-mongodb-jwt-rest-api-skeleton
Gathering detailed insights and metrics for node-express-mongodb-jwt-rest-api-skeleton
cardano-express-web3-skeleton
Backend skeleton for Cardano Web3 dApps. This backend uses Express as server and MongoDB as user database. It provides a basic API Rest for authentication and authorization using CIP-0008 Signing spec and CIP-0030 Cardano dApp-Wallet Web Bridge.
node-skeleton
Application generator tool, to quickly create an node project skeleton.
fonttech_base_server
This is a core base project for Font Tech server projects using MongoDB and Redis.
This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API). Demo of frontend in VueJS here: https://github.com/davellanedam/vue-skeleton-mvp
npm install node-express-mongodb-jwt-rest-api-skeleton
Typescript
Module System
Node Version
NPM Version
38.2
Supply Chain
87.1
Quality
67.2
Maintenance
25
Vulnerability
95.1
License
JavaScript (99.2%)
HTML (0.48%)
Shell (0.32%)
Love this project? Help keep it running — sponsor us today! 🚀
Total Downloads
38,639
Last Day
5
Last Week
88
Last Month
339
Last Year
8,049
MIT License
902 Stars
374 Commits
286 Forks
46 Watchers
10 Branches
5 Contributors
Updated on Jan 28, 2025
Latest Version
9.0.5
Package Id
node-express-mongodb-jwt-rest-api-skeleton@9.0.5
Unpacked Size
162.84 kB
Size
38.24 kB
File Count
153
NPM Version
6.14.16
Node Version
12.22.12
Cumulative downloads
Total Downloads
Last Day
25%
5
Compared to previous day
Last Week
2.3%
88
Compared to previous week
Last Month
-18.5%
339
Compared to previous month
Last Year
81%
8,049
Compared to previous year
26
This is a basic API REST skeleton written on JavaScript using async/await. Great for building a starter web API for your front-end (Android, iOS, Vue, react, angular, or anything that can consume an API)
This project is created to help other developers create a basic REST API in an easy way with Node.js. This basic example shows how powerful and simple JavaScript can be. Do you want to contribute? Pull requests are always welcome to show more features.
Hi! I'm Daniel Avellaneda, I'm an open source enthusiast and devote my free time to building projects in this field.
I'm the creator and maintainer of node-express-mongodb-jwt-rest-api-skeleton and vue-skeleton-mvp
These projects are a "starter web app kit" for any developer who wants to build their own app without starting from scratch: API + Frontend
Both projects have been downloaded thousands of times by web developers around the world.
I'm doing my best to provide you a good experience when using my apps, so if you like what I'm doing and wish to say "thanks!", please buy me a coffee :coffee:
Feel free to send me a tweet https://twitter.com/davellanedam, share this with others or make a pull request
cf-ipcountry
that CloudFlare creates when protecting your website).Authorization
header with value Bearer yourToken
where yourToken
is the signed and encrypted token given in the response from the login process.A demo of this API is located at: https://api-demo.daniel-avellaneda.com
email: admin@admin.com
password: 12345
IMPORTANT: Database resets every 30 mins like "12:00am, 12:30am, 1:00am" and so on. So anything you do with the API will be lost after a short time.
API documentation
Postman API example collection
If you want to test it don´t forget to change the server variable to:
https://api-demo.daniel-avellaneda.com
Demo is also linked to a VueJS project that shows how this API can be integrated to a frontend that is able to consume an API.
Repo is here: https://github.com/davellanedam/vue-skeleton-mvp
Running demo is here: https://vue-demo.daniel-avellaneda.com
1git clone https://github.com/davellanedam/node-express-mongodb-jwt-rest-api-skeleton.git ./myproject
1cd myproject 2npm install 3npm update
.env.example
.env
.env
is already ignored, so you never commit your credentials..env
to your environment server(development or production)server
on your environment to the url of your server, for development mode use http://localhost:3000IMPORTANT: By default token expires in 3 days (4320 minutes set in .env.example). You can refresh token at endpoint GET /token. If everything it´s ok you will get a new token.
To ensure the deliverability of emails sent by this API, Mailgun
is used for mailing users when they sign up, so if you want to use that feature go sign up at their website https://www.mailgun.com
If you want to try a different method it´s ok, I used https://nodemailer.com for this API and they have different transport methods like: smtp.
Language is automatically detected from Accept-Language
header on the request. So either you send locale manually on the request or your browser will send its default, if Accept-Language
header is not sent then it will use en
locale as default.
There are 3 available commands for this: fresh
, clean
and seed
.
1npm run command
fresh
cleans and then seeds the database with dynamic data.clean
cleans the database.seed
seeds the database with dynamic data.1npm run dev
You will know server is running by checking the output of the command npm run dev
1**************************** 2* Starting Server 3* Port: 3000 4* NODE_ENV: development 5* Database: MongoDB 6* DB Connection: OK 7****************************
It´s a good practice to do tests at your code, so a sample of how to do that in mocha/chai
is also included in the /test
directory
1npm run test
Format your code with prettier by typing:
1npm run format
Format all your markdown files with remark by typing:
1npm run remark
Lint your code with ESLint by typing:
1npm run lint
Once everything is set up to test API routes either use Postman or any other api testing application. Default username/password combination for login is admin@admin.com/12345
.
https://documenter.getpostman.com/view/487539/RWaHwoLV
You can import the example collection to Postman. To import, click the import button located and select postman-example.json
located within the root directory.
Go to manage environments
to create environments for development, production, etc. On each of the environments you create you will need to:
Create a new key authToken
and within the /login
request this value is automatically updated after a successfull login through a script located in the tests
tab. Each time you make a request to the API it will send Authorization
header with the token
value in the request, you can check this on the headers of users or cities endpoints in the Postman example.
Create a second key server
with the url of your server, for development mode use http://localhost:3000
This is a REST API, so it works using the following HTTP methods:
If you need to add more models to the project just create a new file in /app/models/
and it will be loaded dynamically.
If you need to add more routes to the project just create a new file in /app/routes/
and it will be loaded dynamically.
When you create a new controller, try to also create another folder with validations and helpers. Ex. /countries
, /countries/validators
and /countries/helpers
. An example of this is included in the repository.
Feel free to report any bugs or improvements. Pull requests are always welcome.
This project is open-sourced software licensed under the MIT License. See the LICENSE file for more information.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 2/8 approved changesets -- score normalized to 2
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
47 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More