{"id":13395012,"url":"https://github.com/madhums/node-express-mongoose-demo","last_synced_at":"2025-05-14T02:04:56.711Z","repository":{"id":37502951,"uuid":"1442637","full_name":"madhums/node-express-mongoose-demo","owner":"madhums","description":"A simple demo app using node and mongodb for beginners (with docker)","archived":false,"fork":false,"pushed_at":"2024-12-06T07:46:15.000Z","size":2575,"stargazers_count":5124,"open_issues_count":12,"forks_count":1370,"subscribers_count":187,"default_branch":"main","last_synced_at":"2025-05-12T17:14:42.735Z","etag":null,"topics":["demo","docker","express","mongodb","mongoose","node","passport","pug"],"latest_commit_sha":null,"homepage":"https://nodejs-express-demo.fly.dev","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/madhums.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["madhums"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2011-03-05T08:52:32.000Z","updated_at":"2025-04-26T16:49:59.000Z","dependencies_parsed_at":"2024-04-11T14:02:53.639Z","dependency_job_id":"524e8fb9-4bb3-4778-9f9f-a96206a66c1a","html_url":"https://github.com/madhums/node-express-mongoose-demo","commit_stats":{"total_commits":708,"total_committers":28,"mean_commits":"25.285714285714285","dds":0.3121468926553672,"last_synced_commit":"5ebb9319ac75134f0e67f519ff31928a5239c6cd"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madhums%2Fnode-express-mongoose-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madhums%2Fnode-express-mongoose-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madhums%2Fnode-express-mongoose-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/madhums%2Fnode-express-mongoose-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/madhums","download_url":"https://codeload.github.com/madhums/node-express-mongoose-demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254052692,"owners_count":22006716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demo","docker","express","mongodb","mongoose","node","passport","pug"],"created_at":"2024-07-30T17:01:39.098Z","updated_at":"2025-05-14T02:04:56.680Z","avatar_url":"https://github.com/madhums.png","language":"JavaScript","funding_links":["https://github.com/sponsors/madhums"],"categories":["JavaScript","例子","⚙️ Backend \u0026 APIs"],"sub_categories":[],"readme":"[![tests](https://github.com/madhums/node-express-mongoose-demo/actions/workflows/test.yml/badge.svg)](https://github.com/madhums/node-express-mongoose-demo/actions/workflows/test.yml)\n\n# Nodejs Express Mongoose Demo\n\nThis 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.\n\nTable of contents:\n\n\u003c!-- TOC depthFrom:2 depthTo:6 withLinks:1 updateOnSave:1 orderedList:0 --\u003e\n\n- [Boilerplate](#boilerplate)\n- [Install](#install)\n- [Tests](#tests)\n- [Docker](#docker)\n- [License](#license)\n\n\u003c!-- /TOC --\u003e\n\n## Boilerplate\n\nWant to build something from scratch? use the [boilerplate](https://github.com/madhums/node-express-mongoose)\n\n* Checkout the [apps that are built using this approach](https://github.com/madhums/node-express-mongoose/wiki/Apps-built-using-this-approach)\n* The [wiki](https://github.com/madhums/node-express-mongoose/wiki) is wip, it has some information about the way application is setup.\n\n## Install\n\n```sh\ngit clone git://github.com/madhums/node-express-mongoose-demo.git\nnpm install\ncp .env.example .env\nnpm start\n```\n\nThen visit [http://localhost:3000/](http://localhost:3000/)\n\n**NOTE:** Do not forget to set the twitter, google, linkedin and github `CLIENT_ID`s and `SECRET`s. 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](https://devcenter.heroku.com/articles/config-vars).\n\n## Tests\n\n```sh\nnpm test\n```\n\n## Docker\n\nYou can also use docker for development. Make sure you run npm install on your host machine so that code linting and everything works fine.\n\n```sh\nnpm i\ncp .env.example .env\n```\n\nStart the services\n\n```sh\ndocker-compose up -d\n```\n\nView the logs\n\n```sh\ndocker-compose logs -f\n```\n\nIn 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\n\n```sh\ndocker-compose exec node npm i\n```\n\nIf you make any changes to the file, nodemon should automatically pick up and restart within docker (you can see this in the logs)\n\nTo run tests\n\n```sh\ndocker-compose exec -e MONGODB_URL=mongodb://mongo:27017/noobjs_test node npm test\n```\n\nNote that we are overriding the environment variable set in `.env` file because we don't want our data erased by the tests.\n\nNote: 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`\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadhums%2Fnode-express-mongoose-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmadhums%2Fnode-express-mongoose-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmadhums%2Fnode-express-mongoose-demo/lists"}