{"id":21186615,"url":"https://github.com/fetchte/loopback-mysql-docker-boilerplate","last_synced_at":"2025-07-10T01:31:27.880Z","repository":{"id":89445589,"uuid":"98363499","full_name":"fetchTe/loopback-mysql-docker-boilerplate","owner":"fetchTe","description":"Loopback \u0026 MySQL Docker Boilerplate","archived":false,"fork":false,"pushed_at":"2019-04-11T22:58:59.000Z","size":60,"stargazers_count":5,"open_issues_count":2,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-06T23:17:55.228Z","etag":null,"topics":["boilerplate","docker","loopback","mysql"],"latest_commit_sha":null,"homepage":null,"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/fetchTe.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-26T01:04:26.000Z","updated_at":"2023-07-02T12:32:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"f31978d6-3b7b-432a-ba13-9a94a9aec9f0","html_url":"https://github.com/fetchTe/loopback-mysql-docker-boilerplate","commit_stats":null,"previous_names":["fetchte/loopback-mysql-docker-boilerplate"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Floopback-mysql-docker-boilerplate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Floopback-mysql-docker-boilerplate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Floopback-mysql-docker-boilerplate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fetchTe%2Floopback-mysql-docker-boilerplate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fetchTe","download_url":"https://codeload.github.com/fetchTe/loopback-mysql-docker-boilerplate/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225608541,"owners_count":17495934,"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":["boilerplate","docker","loopback","mysql"],"created_at":"2024-11-20T18:24:49.659Z","updated_at":"2024-11-20T18:24:50.265Z","avatar_url":"https://github.com/fetchTe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Loopback \u0026 MySQL Docker Boilerplate\n\n## About\n\n__Description__:\n\nA Base docker project to get up and running with [Loopback](http://loopback.io) and [MySQL](https://www.mysql.com/). This project also includes boot scripts located in `server/boot` to automatically do database migration/update so that you can move a bit quicker with your schema, tables, and data structures. Apart from the migration scripts this project is a fresh sheet of ice, in that, there are no models, widgets, relations, or permissions set up.\n\n__Tech Specifications__:\n\nNode: `6.11.1` -\u003e Latest LTS: Boron\nStrongLoop: `3.x`\nMySQL: `5.6` -\u003e [Amazon Aurora DB](https://aws.amazon.com/rds/aurora/) drop-in at 1/10th of the cost!\n\n## Install/Set Up\n\n__Prerequisites__:\n\nYou need to have both [docker](https://docs.docker.com/engine/installation/) and [docker-compose](https://docs.docker.com/compose/install/) installed.\n\n__Notes__:\n\nNumber one, I've created a make file to make life a bit easier. Number two, if you wish to do a complete fresh install, as in, remove all the current loopback scaffolding you can do so via:\n\n```bash\n   # deletes all loopback scaffolding\n   make NUKE\n   # loopback-cli scaffolding\n   make setup-loopback\n```\n\n__1) Install Dependencies__:\n\nFirst task of business is to install the npm dependencies:\n\n```bash\n   npm install\n   # or use the make script\n   make install-deps\n```\n\n__2) Start docker-compose__\n\nLast task of business is to boot up the docker containers:\n\n```bash\n   make start # runs -\u003e docker-compose up\n```\n\n__3) Open Browser__\n\nTo make sure everything worked according to plan open open [`localhost:3002`](http://localhost:3002/). It should display a simple JSON Object with a `\"started\"` and `\"uptime\"` property. To view the api cruz on over to [`localhost:3002/explorer/`](http://localhost:3002/explorer/).\n\n\n## Create Model\n\nTo create a new loopback model:\n\n```bash\n   make model a=Widget\n```\n\nIMPORTANT: After you create a new model you will have to perform a db migration which you can read about bellow.\n\n## Database Migration\n\nFor the most part db migration is automated through the boot scripts but you'll have to update the script accordingly. Let's say we create a new model, then we will have to edit the `/server/boot/migration.custom.js` file and add the new model to the `MODELS` Array in String format. However, if you add a alter/add the `properties` on a model the migration script will automaticaly sync up the new schema.\n\nYou can also do a db migration via `/__scripts__/migrate.js` and like the automated scripts you will have to add your custom models to the `MODELS` Array. You can then run this script via: `make migrate`.\n\n## Loopback Make Commands\n\nThere are a few Makefile commands to make life a bit easier. Nothing magical just a wrapper around `docker-compose run api lb`. You must pass an argument to the `api` and `model` command.\n\n__api__\n\n```bash\n   make api a=middleware\n   make api a='Model Widget'\n```\n\n__model__\n\n```bash\n   make model a=Widget\n```\n\n\n__Relation -\u003e (no arguments)__\n\n```bash\n   make relation\n```\n\n\n## Debug Node\n\nTo spawn a node inspect debugger within the container you must un-comment the debug port and debug command in the `docker-compose.yml` file like so:\n\n```yaml\napi:\n  ports:\n    - 3002:3000\n    # Debug port\n    - 9229:9229\n  # command: nodemon . -\u003e comment out default command\n  command: nodemon -L --inspect .\n```\n\n## MySQL Environment\n\nThe MySQL docker image is setup via `environment` variables to set up the the db. These variables are set in the root `.env` file. Remember, these variables must correspond with `/server/datasources.json`.\n\n\n---\n\nBest, te\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffetchte%2Floopback-mysql-docker-boilerplate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffetchte%2Floopback-mysql-docker-boilerplate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffetchte%2Floopback-mysql-docker-boilerplate/lists"}