{"id":18895165,"url":"https://github.com/coffezilla/docker-mongo-api-boilerplate","last_synced_at":"2026-06-09T23:02:23.178Z","repository":{"id":236564216,"uuid":"460197585","full_name":"coffezilla/docker-mongo-api","owner":"coffezilla","description":"Simple Docker running mongo DB with node for API creation","archived":false,"fork":false,"pushed_at":"2022-02-16T22:22:35.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-31T07:42:37.869Z","etag":null,"topics":["docker-nodejs","heroku","mongo-api","mongodb","nodejs","react-app","react-native"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/coffezilla.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":"support/Insomnia_endpoints.json","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-02-16T22:22:32.000Z","updated_at":"2022-02-16T22:23:32.000Z","dependencies_parsed_at":"2024-04-27T20:24:31.527Z","dependency_job_id":"af71a047-22a4-4445-8027-2e9df50863f8","html_url":"https://github.com/coffezilla/docker-mongo-api","commit_stats":null,"previous_names":["coffezilla/docker-mongo-api"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coffezilla%2Fdocker-mongo-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coffezilla%2Fdocker-mongo-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coffezilla%2Fdocker-mongo-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/coffezilla%2Fdocker-mongo-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/coffezilla","download_url":"https://codeload.github.com/coffezilla/docker-mongo-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239869616,"owners_count":19710554,"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":["docker-nodejs","heroku","mongo-api","mongodb","nodejs","react-app","react-native"],"created_at":"2024-11-08T08:26:53.653Z","updated_at":"2026-02-27T20:30:17.049Z","avatar_url":"https://github.com/coffezilla.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Boilerplate\nThis is a boilerplate for MongoDB + Nodejs api project. This is a simple structure to set everything organized in one single repository.\n## Features\n- Docker\n- MongoDB (Docker)\n- NodeJS (Docker)\n- React Native\n- React JS\n\n## Folder structure\n- api: Backend content. This is the root for the endpoint. It can be hosted.\n- react-app: Frontend React JS app.\n- app: Frontend React Native app.\n\n## Dev notes\n\n### Docker config\nFirst of all, create a .env file in the root of the project. This is important if you wanna run the API locally inside the Docker container.\n\nFill the variables with data:\n\n```dot\nCONTAINER_PREFIX=mongo-api\nMONGO_USER=admin\nMONGO_PASS=admin\nMONGO_PORT=27017\nEXPRESS_PORT=8081\n```\n- `CONTAINER_PREFIX`: The prefix of the container in the Docker\n- `MONGO_USER` / `MONGO_PASS`: Respectively the user and password of the mongo db inside the Docker container.\n- `MONGO_PORT`: The port of the mongoDB.\n- `EXPRESS_PORT`: The port of the Express.\n\nAdd another .env file inside the `/api/v1/` folder. This should contain important variables for the NodeJS API.\n\n```dot\nDB_CONNECTION=mongodb://admin:admin@localhost:27017\nAUTH=123\n```\n- `DB_CONNECTION`: The uri for the connection. By default your DB will be set to `test`.\n- `AUTH`: Just a simple token for authentication. For production you probably should implement this using another method.\n\n\n### Heroku config\nInside the `/api` folder you will find a `Procfile`. This file is essencial for the Heroku in order to run a command inside de Heroku container.\n\n### Running the Docker container\nEverything set, go to the root and run `docker-compose up`. This will set your Docker container with MongoDB and NodeJS running locally.\n\n**MAKE SURE YOU HAVE DOCKER INSTALLED!!!**\n\n### Insomnia Rest\nI recommend you to get the Insomnia rest app to fill your workflow. If you're running the insomnia, import the `insomnia_enpoints.json` inside de `support` folder to get all the endpoint samples.\n\n### Showtime\nNow you have a Docker container running, you can go to the `/api/v1/` folder and start coding your new API.\n\nIn order to run the api locally, just go to the terminal and run `npm start`.\nThe command will run your config file in the `package.json`.\n\n```json\n\t...\n\t\"scripts\": {\n\t\t\"start\": \"nodemon app.js\"\n\t},\n\t...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoffezilla%2Fdocker-mongo-api-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoffezilla%2Fdocker-mongo-api-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoffezilla%2Fdocker-mongo-api-boilerplate/lists"}