{"id":20810953,"url":"https://github.com/exposedcat/express-mongodb-template","last_synced_at":"2025-03-12T04:41:04.756Z","repository":{"id":40789033,"uuid":"500596402","full_name":"ExposedCat/express-mongodb-template","owner":"ExposedCat","description":"Express.JS + MongoDB API template","archived":false,"fork":false,"pushed_at":"2022-08-25T11:21:20.000Z","size":201,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-18T14:34:17.627Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ExposedCat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-06T21:18:30.000Z","updated_at":"2022-06-23T22:04:25.000Z","dependencies_parsed_at":"2023-01-16T16:01:22.847Z","dependency_job_id":null,"html_url":"https://github.com/ExposedCat/express-mongodb-template","commit_stats":null,"previous_names":[],"tags_count":1,"template":true,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExposedCat%2Fexpress-mongodb-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExposedCat%2Fexpress-mongodb-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExposedCat%2Fexpress-mongodb-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ExposedCat%2Fexpress-mongodb-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ExposedCat","download_url":"https://codeload.github.com/ExposedCat/express-mongodb-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243158973,"owners_count":20245669,"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":[],"created_at":"2024-11-17T20:29:10.208Z","updated_at":"2025-03-12T04:41:04.738Z","avatar_url":"https://github.com/ExposedCat.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n    \u003ch1\u003eHTTP API template on Express + MongoDB\u003c/h1\u003e\n\n[![Developer](https://img.shields.io/badge/Heroku-Compatible-gray?style=for-the-badge\u0026logo=heroku\u0026labelColor=purple)](https://github.com/ExposedCat/express-mongodb-template#via-heroku)\n[![Developer](https://img.shields.io/badge/Docker-Support-gray?style=for-the-badge\u0026logo=docker\u0026labelColor=blue\u0026logoColor=white)](https://github.com/ExposedCat/express-mongodb-template#-running)\n[![Developer](https://img.shields.io/badge/Swagger-Docs-green?style=for-the-badge\u0026logo=swagger)](https://app.swaggerhub.com/apis-docs/artem-prokop/express-mongodb-template/1.0.0)\n\n\u003cimg src=\"https://chpic.su/_data/stickers/g/gloomycat/gloomycat_023.webp\" alt=\"App preview\"\u003e\n\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003e⭐️ Features\u003c/h2\u003e\n\u003c/div\u003e\n\u003cul\u003e\n    \u003cli\u003eConvenient for frontend usage\u003c/li\u003e\n    \u003cli\u003eStrict code formatting rules\u003c/li\u003e\n    \u003cli\u003eScalable file architecture\u003c/li\u003e\n    \u003cli\u003e100% of API \u003ca href=\"https://app.swaggerhub.com/apis-docs/artem-prokop/express-mongodb-template/1.0.0\"\u003edocumented\u003c/a\u003e\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://github.com/ExposedCat/express-mongodb-template#-running\"\u003eDocker\u003c/a\u003e support\u003c/li\u003e\n    \u003cli\u003e\u003ca href=\"https://heroku.com\"\u003eHeroku\u003c/a\u003e support\u003c/li\u003e\n    \u003cli\u003eAutomatic tests\u003c/li\u003e\n    \u003cli\u003eWell-readable git repository with beautiful README\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003e⚙️ Stack\u003c/h2\u003e\n\u003c/div\u003e\n\u003cul\u003e\n    \u003cli\u003eProgramming language: Node.JS\u003c/li\u003e\n    \u003cli\u003eAPI: Express.JS\u003c/li\u003e\n    \u003cli\u003eUsers storage: Mongodb, Mongoose.JS\u003c/li\u003e\n    \u003cli\u003eTesting tools: Mocha, Chai\u003c/li\u003e\n    \u003cli\u003eRunning tools: Nodemon, Docker, Heroku\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003e🔌 Running\u003c/h2\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003evia Docker\u003c/h2\u003e\n\u003c/div\u003e\n\n0. Install [Docker](https://docs.docker.com/get-docker/)\n1. Clone this repo:\n\n```bash\ngit clone https://github.com/ExposedCat/express-mongodb-template.git\n```\n\n2. Go to project root:\n\n```bash\ncd express-mongodb-template\n```\n\n3. Create copy of `.env-example` called `.env` and replace example data with yours\n4. Build app image:\n\n```bash\ndocker build -t express-mongodb-api .\n```\n\n5.\n\n-   Start app (map local port 3000 to the same in container):\n\n```bash\ndocker run -dp 3000:3000 express-mongodb-api\n```\n\n-   Start app with local DB image:\n\n1. Add `DB_NAME` in `.env` file and put local db name there, for instance `express-mongodb-users`\n2. Use `express-mongodb-db:27017` as database URI in `DB_CONNECTION_STRING`\n3. Build and run app and local DB:\n\n```bash\ndocker-compose up -d --build\n```\n\n**Done**.\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003evia Nodemon\u003c/h2\u003e\n    \u003ch4\u003efor development\u003c/h4\u003e\n\u003c/div\u003e\n\n0. Install and run \u003ca href=\"https://www.mongodb.com/try/download/community\"\u003eMongoDB server\u003c/a\u003e\n1. Clone this repo:\n\n```bash\ngit clone https://github.com/ExposedCat/express-mongodb-template.git\n```\n\n2. Go to project root:\n\n```bash\ncd express-mongodb-template\n```\n\n3. Create copy of `.env-example` called `.env` and replace example data with yours\n4. Install dependencies:\n\n```bash\nnpm install\n```\n\n5. Start app:\n\n```bash\nnpm run dev\n```\n\n**Done**.\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003evia Heroku\u003c/h2\u003e\n\u003c/div\u003e\n\n0. Get any cloud database, for ex. \u003ca href=\"https://www.mongodb.com/cloud/atlas\"\u003eMongoDB Atlas\u003c/a\u003e\n1. Clone this repo:\n\n```bash\ngit clone https://github.com/ExposedCat/express-mongodb-template.git\n```\n\n2. Go to project root:\n\n```bash\ncd express-mongodb-template\n```\n\n3. At \u003ca href=\"https://heroku.com\"\u003eHeroku\u003c/a\u003e → `App` → `Settings` → `Config vars`  \n   Set environment variables:  \n    Connection string of MongoDB database\n\n    ```bash\n    DB_CONNECTION_STRING\n    ```\n\n    Secret for generating JWT\n\n    ```bash\n    JWT_SECRET\n    ```\n\n    Port for API to run on\n\n    ```bash\n    PORT\n    ```\n\n    Secret for Express.JS session\n\n    ```bash\n    SESSION_SECRET\n    ```\n\n4. Follow instructions at \u003ca href=\"https://heroku.com\"\u003eHeroku\u003c/a\u003e → `App` → `Deploy`\n\n**Done**.\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003e🐛 Testing\u003c/h2\u003e\n\u003c/div\u003e\n\n1. Create copy of `.env-example` called `.env-test` and replace example data with your test data\n2. Run tests:\n\n```bash\nnpm run test\n```\n\n\u003cdiv align=\"center\"\u003e\n    \u003ch2\u003e🔩 Dependencies\u003c/h2\u003e\n\u003c/div\u003e\n\u003ch4\u003eProduction\u003c/h4\u003e\n\u003cul\u003e\n    \u003cli\u003eExpress.JS, Express-Session\u003c/li\u003e\n    \u003cli\u003eAsync Json-Web-Token\u003c/li\u003e\n    \u003cli\u003eMongoose.JS\u003c/li\u003e\n    \u003cli\u003eDotEnv\u003c/li\u003e\n    \u003cli\u003eHelmet\u003c/li\u003e\n    \u003cli\u003eBcrypt\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch4\u003eDevelopment\u003c/h4\u003e\n\u003cul\u003e\n    \u003cli\u003eNodemon\u003c/li\u003e\n    \u003cli\u003ePrettier\u003c/li\u003e\n\u003c/ul\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexposedcat%2Fexpress-mongodb-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexposedcat%2Fexpress-mongodb-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexposedcat%2Fexpress-mongodb-template/lists"}