Back to rankings

madhums/node-express-mongoose-demo

JavaScript

A simple demo app using node and mongodb for beginners (with docker)

expressmongoosepassportmongodbdockernodedemopug
Star Growth
Stars
5.1k
Forks
1.3k
Weekly Growth
Issues
1
2k4k
Mar 2011Apr 2016Jun 2021Jul 2026
Artifactsnpmnpm install node-express-mongoose-demo
README

tests

Nodejs Express Mongoose Demo

This is a demo application illustrating various features used in everyday web development, with a fine touch of best practices. The demo app is a blog application where users can signup, create an article, delete an article and add comments etc.

Table of contents:

Boilerplate

Want to build something from scratch? use the boilerplate

Install

git clone git://github.com/madhums/node-express-mongoose-demo.git
npm install
cp .env.example .env
npm start

Then visit http://localhost:3000/

NOTE: Do not forget to set the twitter, google, linkedin and github CLIENT_IDs and SECRETs. In development env, you can set the env variables in .env and replace the values there. In production env, it is not safe to keep the ids and secrets in a file, so you need to set it up via commandline. If you are using heroku checkout how environment variables are set here.

Tests

npm test

Docker

You can also use docker for development. Make sure you run npm install on your host machine so that code linting and everything works fine.

npm i
cp .env.example .env

Start the services

docker-compose up -d

View the logs

docker-compose logs -f

In case you install a npm module while developing, it should also be installed within docker container, to do this first install the module you want with simple npm i module name, then run it within docker container

docker-compose exec node npm i

If you make any changes to the file, nodemon should automatically pick up and restart within docker (you can see this in the logs)

To run tests

docker-compose exec -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test

Note that we are overriding the environment variable set in .env file because we don't want our data erased by the tests.

Note: The difference between exec and run is that, exec executes the command within the running container and run will spin up a new container to run that command. So if you want to run only the tests without docker-compose up, you may do so by running docker-compose run -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test

License

MIT

Related repositories
goldbergyoni/nodebestpractices

✅ The Node.js best practices list (July 2026)

DockerfileCreative Commons Attribution Share Alike 4.0 Internationalnodejsjavascript
twitter.com/nodepractices/
105.4k10.7k
expressjs/express

Fast, unopinionated, minimalist web framework for node.

JavaScriptnpmMIT Licensejavascriptnodejs
expressjs.com
69.2k24.3k
payloadcms/payload

Payload is the open-source, fullstack Next.js framework, giving you instant backend superpowers. Get a full TypeScript backend and admin panel instantly. Use Payload as a headless CMS or for building powerful applications.

TypeScriptnpmMIT Licenseheadless-cmscms
payloadcms.com
43.7k4k
gofiber/fiber

⚡️ Express inspired web framework written in Go

GoGo ModulesMIT Licensegogolang
gofiber.io
40k2k
goldbergyoni/javascript-testing-best-practices

📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2025)

JavaScriptnpmMIT Licensenodejstesting
testjavascript.com
24.6k2.1k
jaredhanson/passport

Simple, unobtrusive authentication for Node.js.

JavaScriptnpmMIT Licensenodejsexpress
passportjs.org
23.5k1.3k
nswbmw/N-blog

《一起学 Node.js》

JavaScriptnpmtutorialnodejs
15.4k4.5k
HabitRPG/habitica

A habit tracker app which treats your goals like a Role Playing Game.

JavaScriptnpmOtherhabiticajavascript
habitica.com
14k4.4k
apollographql/apollo-server

🌍  Spec-compliant and production ready JavaScript GraphQL server that lets you develop in a schema-first way. Built for Express, Connect, Hapi, Koa, and more.

TypeScriptnpmMIT Licensegraphqlgraphql-server
apollographql.com/docs/apollo-server/
13.9k2k
graphile/crystal

🔮 Graphile's Crystal Monorepo; home to Grafast, PostGraphile, pg-introspection, pg-sql2 and much more!

TypeScriptnpmMIT Licensegraphqlpostgres
graphile.org
12.9k620
bailicangdu/node-elm

Backend system based on node.js + Mongodb. 基于 node.js + Mongodb 构建的后台系统

JavaScriptnpmGNU General Public License v2.0nodeexpress
cangdu.org/elm/
12.3k3.7k
linnovate/mean

The MEAN stack uses Mongo, Express, Angular(6) and Node for simple and scalable fullstack js applications

TypeScriptnpmstackangular
mean.io
12.1k3.4k