node-express-mongoose

A boilerplate application for building web apps using node and mongodb

Github stars Tracking Chart

Build Status
Dependencies
Code Climate
Gitter

Node Express Mongoose

A boilerplate application for building web apps using express, mongoose and passport.

Read the wiki to understand how the application is structured.

Usage

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

Checkout the apps that are built using this approach

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/my_app_test node npm test

License

MIT

Main metrics

Overview
Name With Ownermadhums/node-express-mongoose
Primary LanguageJavaScript
Program languageJavaScript (Language Count: 6)
Platform
License:MIT License
所有者活动
Created At2013-06-22 09:37:38
Pushed At2024-12-06 07:48:28
Last Commit At2024-09-21 12:32:21
Release Count0
用户参与
Stargazers Count1.4k
Watchers Count42
Fork Count388
Commits Count266
Has Issues Enabled
Issues Count19
Issue Open Count1
Pull Requests Count96
Pull Requests Open Count9
Pull Requests Close Count97
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private