{"id":19408706,"url":"https://github.com/4lessandrodev/mono-repo-example","last_synced_at":"2026-04-12T22:03:31.674Z","repository":{"id":105007003,"uuid":"342901569","full_name":"4lessandrodev/mono-repo-example","owner":"4lessandrodev","description":"Monorepo example","archived":false,"fork":false,"pushed_at":"2021-02-27T16:22:50.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-07T14:23:58.671Z","etag":null,"topics":[],"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/4lessandrodev.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":"2021-02-27T16:21:37.000Z","updated_at":"2021-02-27T16:22:52.000Z","dependencies_parsed_at":null,"dependency_job_id":"9246552b-7984-4bb5-9cda-9b4b25a0757d","html_url":"https://github.com/4lessandrodev/mono-repo-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fmono-repo-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fmono-repo-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fmono-repo-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4lessandrodev%2Fmono-repo-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4lessandrodev","download_url":"https://codeload.github.com/4lessandrodev/mono-repo-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240587481,"owners_count":19825005,"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-10T12:07:28.445Z","updated_at":"2026-04-12T22:03:31.581Z","avatar_url":"https://github.com/4lessandrodev.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Monorepo concepts\n\n## What is monorepo?\n\nA monorepo is a single repository. A monolith is a massive codebase.\n\n#### Monorepo vs Multirepo\n\nA monorepo keeps everything in one repository. A multirepo (multiple repositories) typically has one repository for each project. The more projects, the more repositories. A multirepo is also known as polyrepo.\n\n#### How do it?\n\n-    Create a main root folder `mkdir foldername`\n-    Entery on root folder `cd foldername`\n-    Create a packages folder `mkdir packages`\n-    Create a package.json file `touch package.json`\n-    On package.json put the code bellow\n\n```json\n{\n     \"private\": \"true\",\n     \"name\": \"mono-repo\",\n     \"workspaces\": [\"packages/*\"]\n}\n```\n\n-    On package folder create a folder for each resource\n\n#### example\n\nOn my case I created `api` folder for backend code and `web`for frontend one\n\n-    On my `api` folder I created a `package.json` with the code bellow\n\n```json\n{\n     \"name\": \"@mono-repo/api\",\n     \"version\": \"1.0.0\",\n     \"description\": \"api backend\",\n     \"main\": \"app.js\",\n     \"author\": \"Alessandro\",\n     \"license\": \"MIT\",\n     \"private\": false\n}\n```\n\nNote On `name` I used conventional name with `@` referencing my main `package.json` on root folder\n\n-    At `web`folder I created a `package.json`with the code bellow\n\n```json\n{\n     \"name\": \"@mono-repo/web\",\n     \"version\": \"1.0.0\",\n     \"description\": \"Site frontend\",\n     \"main\": \"index.js\",\n     \"author\": \"Alessandro\",\n     \"license\": \"MIT\",\n     \"private\": false,\n     \"dependencies\": {\n          \"@mono-repo/api\": \"1.0.0\"\n     }\n}\n```\n\n-    On root folder run the command `yarn install` or `npm install`\n-    On `web` folder run the command `yarn install` or `npm install` to install `api`resources\n\nThe most important is `dependencies` I am importing resources from my `api` folder\nOn my `api`I created an index.js with a simple exported function\nOn my `web`I created an index.js importing the `api` function\n\nif you run the web index you will see that we can use api resources\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fmono-repo-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4lessandrodev%2Fmono-repo-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4lessandrodev%2Fmono-repo-example/lists"}