Express Mongodb Rest Api Boilerplate

A boilerplate for Node.js apps / Rest API / Authentication from scratch - express, mongodb (mongoose). Typescript
Alternatives To Express Mongodb Rest Api Boilerplate
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Mongoose25,731181,20311,41217 hours ago758September 14, 2022267mitJavaScript
MongoDB object modeling designed to work in an asynchronous environment.
Node Elm11,215
a year ago62gpl-2.0JavaScript
基于 node.js + Mongodb 构建的后台系统
Node Express Boilerplate5,409
a month ago10September 28, 202075mitJavaScript
A boilerplate for building production-ready RESTful APIs using Node.js, Express, and Mongoose
Node Express Mongoose Demo5,070125 days ago1January 18, 20163mitJavaScript
A simple demo app using node and mongodb for beginners (with docker)
Bulletproof Nodejs4,954
5 months ago68mitTypeScript
Implementation of a bulletproof node.js API 🛡️
Builderbook3,486
4 months ago69mitJavaScript
Open source web application to learn JS stack: React, Material-UI, Next.js, Node.js, Express.js, Mongoose, MongoDB database.
Saas3,322
4 months ago11mitTypeScript
Build your own SaaS business with SaaS boilerplate. Productive stack: React, Material-UI, Next, MobX, WebSockets, Express, Node, Mongoose, MongoDB. Written with TypeScript.
Express Mongoose Es6 Rest Api2,908
3 years ago1September 03, 201668mitJavaScript
:collision: A boilerplate application for building RESTful APIs Microservice in Node.js using express and mongoose in ES6 with code coverage and JsonWebToken Authentication
Thal2,268
3 years agomitJavaScript
Getting started with Puppeteer and Chrome Headless for Web Scraping
Mongodb Memory Server2,227619546a day ago282September 25, 202218mitTypeScript
Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config).
Alternatives To Express Mongodb Rest Api Boilerplate
Select To Compare


Alternative Project Comparisons
Readme

express-mongodb-rest-api-typescript-boilerplate

GitHub license

Authentication from scratch TypeScript

  • Sign In
  • Sign Up,
  • Reset Password
  • Update Profile
  • Update Password
  • Update Email
  • Update User Avatar
  • Delete Profile
  • Reset Password by E-mail
  • Verification Profile by E-mail
  • Signed Out Access Token blacklisting by Redis
  • Image Upload (public storage, Many-to-many relationships)
  • Multi language by i18Next
  • E-mail notifications

Package list

Package Description
ts-node TypeScript execution and REPL for node.js, with source map and native ESM support.
ts-node-dev It restarts target node process when any of required files changes (as standard node-dev) but shares Typescript compilation process between restarts. This significantly increases speed of restarting comparing to node-dev -r ts-node/register ..., nodemon -x ts-node ... variations because there is no need to instantiate ts-node compilation each time.
tsc-alias Replace alias paths with relative paths after typescript compilation. You can add aliases that reference other projects outside your tsconfig.json project by providing a relative path to the baseUrl.
tsconfig-paths Use this to load modules whose location is specified in the paths section of tsconfig.json or jsconfig.json. Both loading at run-time and via API are supported.
typescript TypeScript is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS
cross-env Run scripts that set and use environment variables across platforms
express Fast, unopinionated, minimalist web framework for Node.js.
email-templates Create, preview (browser/iOS Simulator), and send custom email templates for Node.js. Made for Forward Email and Lad.
nodemailer Easy as cake e-mail sending from your Node.js applications
ejs Embedded JavaScript templates
cors CORS is a node.js package for providing a Connect/Express middleware that can be used to enable CORS with various options.
bcrypt A library to help you hash passwords.
dotenv Dotenv is a zero-dependency module that loads environment variables from a .env file into process.env. Storing configuration in the environment separate from code is based on The Twelve-Factor App methodology.
http-status-codes Constants enumerating the HTTP status codes. Based on the Java Apache HttpStatus API.
i18next i18next is a very popular internationalization framework for browser or any other javascript environment (eg. Node.js, Deno).
i18next-http-middleware This is a middleware to be used with Node.js web frameworks like express or Fastify and also for Deno.
jsonwebtoken An implementation of JSON Web Tokens.
mongoose Mongoose is a MongoDB object modeling tool designed to work in an asynchronous environment. Mongoose supports Node.js and Deno (alpha).
randomstring A module for generating random strings
redis A modern, high performance Redis client
validator A library of string validators and sanitizers.
winston A logger for just about everything.
eslint An AST-based pattern checker for JavaScript.
eslint-config-prettier Turns off all rules that are unnecessary or might conflict with Prettier.
eslint-plugin-import This plugin intends to support linting of ES2015+ (ES6+) import/export syntax, and prevent issues with misspelling of file paths and import names. All the goodness that the ES2015+ static module syntax intends to provide, marked up in your editor.
eslint-plugin-prettier Runs Prettier as an ESLint rule and reports differences as individual ESLint issues.
eslint-plugin-unicorn More than 100 powerful ESLint rules
prettier Prettier is an opinionated code formatter

Redis

Download Redis for Windows from the official website.

Mac (using homebrew):

brew install redis

Linux:

sudo apt-get install redis-server

Setup

You can install Node modules using either npm or Yarn, which are both package managers for Node.js.

yarn install # or npm install

COPY .env.example to .env

cp .env.example .env

API Start

yarn start # or npm start
yarn watch # or npm run watch - watch mode
yarn build # or npm run build - production build

ESlint Start

yarn lint # or npm run link
yarn lint:write # or npm run lint:write - with prefix --fix

Prettier Start

yarn prettier # or npm run prettier
yarn prettier:write # or npm run prettier:write - with prefix --fix

API Endpoints

Mailcatcher

If you're looking for an easy-to-use tool to test your email SMTP functionality, I highly recommend using Mailcatcher. Mailcatcher is a simple SMTP server that catches all your outgoing emails and displays them in a web interface for easy viewing.

To install Prettier and ESLint in Visual Studio Code, you can follow these steps:

  • Open Visual Studio Code and navigate to your project folder.
  • Press Ctrl + Shift + P (Windows) or Cmd + Shift + P (Mac) to open the Command Palette.
  • Type "Extensions: Install Extensions" and select the first option that appears.
  • In the search bar, type "Prettier" and select the first result that appears.
  • Click the "Install" button to install Prettier.
  • Repeat step 4 and 5 to install ESLint.

API Structure

.
├── src
│  ├── @types
│  │  └── global.d.ts
│  ├── constants
│  │  └── index.ts
│  ├── contracts
│  │  ├── auth.ts
│  │  ├── jwt.ts
│  │  ├── media.ts
│  │  ├── request.ts
│  │  └── user.ts
│  ├── controllers
│  │  ├── authController.ts
│  │  ├── index.ts
│  │  ├── mediaController.ts
│  │  └── userController.ts
│  ├── dataSources
│  │  ├── index.ts
│  │  ├── mongoose.ts
│  │  └── redis.ts
│  ├── guards
│  │  ├── authGuard.ts
│  │  └── index.ts
│  ├── i18n
│  │  ├── index.ts
│  │  └── translations
│  │     ├── en.json
│  │     └── ka.json
│  ├── index.ts
│  ├── infrastructure
│  │  ├── image.ts
│  │  ├── logger.ts
│  │  └── upload.ts
│  ├── mailer
│  │  ├── index.ts
│  │  ├── mailer.ts
│  │  └── userMail.ts
│  ├── middlewares
│  │  ├── authMiddleware.ts
│  │  ├── corsMiddleware.ts
│  │  ├── index.ts
│  │  ├── notFoundMiddleware.ts
│  │  └── uploadSingleImageMiddleware.ts
│  ├── models
│  │  ├── index.ts
│  │  ├── media.ts
│  │  ├── resetPassword.ts
│  │  ├── user.ts
│  │  └── verification.ts
│  ├── routes
│  │  ├── auth.ts
│  │  ├── index.ts
│  │  ├── media.ts
│  │  └── users.ts
│  ├── services
│  │  ├── index.ts
│  │  ├── mediaService.ts
│  │  ├── resetPasswordService.ts
│  │  ├── userService.ts
│  │  └── verificationService.ts
│  ├── storage
│  │  └── public
│  ├── templates
│  │  ├── resetPassword
│  │  │  └── html.ejs
│  │  ├── signUp
│  │  │  └── html.ejs
│  │  ├── successfullyDeleted
│  │  │  └── html.ejs
│  │  ├── successfullyUpdatedEmail
│  │  │  └── html.ejs
│  │  ├── successfullyUpdatedPassword
│  │  │  └── html.ejs
│  │  ├── successfullyUpdatedProfile
│  │  │  └── html.ejs
│  │  ├── successfullyVerified
│  │  │  └── html.ejs
│  │  └── verification
│  │     └── html.ejs
│  ├── utils
│  │  ├── cryptoString.ts
│  │  ├── dates.ts
│  │  ├── hash.ts
│  │  ├── headers.ts
│  │  ├── jwt.ts
│  │  ├── maths.ts
│  │  └── paths.ts
│  └── validations
│     ├── authValidation.ts
│     ├── index.ts
│     └── userValidation.ts
├── .env
├── .env.example
├── .eslintrc
├── .gitignore
├── .nvmrc
├── .prettierrc
├── api-logs.log
├── LICENSE
├── package.json
├── README.md
├── tsconfig.json
└── yarn.lock

Note: For any question issues

License

This project is an open-source with an MIT License

Popular Mongoose Projects
Popular Mongodb Projects
Popular Data Processing Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Typescript
Node
Docker
Express
Expressjs
Mongodb
Authentication
Redis
Password
Jwt
Docker Compose
Mongoose
Authorization
Cors
Jwt Authentication
Nodemon