{"id":21140423,"url":"https://github.com/govalta/dcp-monorepo","last_synced_at":"2025-06-11T14:35:59.087Z","repository":{"id":148531561,"uuid":"620504325","full_name":"GovAlta/dcp-monorepo","owner":"GovAlta","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-02T20:24:43.000Z","size":8267,"stargazers_count":1,"open_issues_count":5,"forks_count":2,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-02T21:28:31.269Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/GovAlta.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/contributing.md","funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2023-03-28T20:14:47.000Z","updated_at":"2025-04-04T17:09:20.000Z","dependencies_parsed_at":"2023-09-22T00:30:46.163Z","dependency_job_id":"1f66e390-f109-4c85-802a-9e72f1746c4f","html_url":"https://github.com/GovAlta/dcp-monorepo","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/GovAlta%2Fdcp-monorepo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovAlta%2Fdcp-monorepo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovAlta%2Fdcp-monorepo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovAlta%2Fdcp-monorepo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GovAlta","download_url":"https://codeload.github.com/GovAlta/dcp-monorepo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GovAlta%2Fdcp-monorepo/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280663,"owners_count":22833434,"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-20T07:15:38.812Z","updated_at":"2025-06-11T14:35:59.064Z","avatar_url":"https://github.com/GovAlta.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Digital Content Platform (DCP)\n\nDCP is a platform for digital content products. It includes shared libraries and micro-apps for rapid authoring and publishing of content with workflows for technical and non-technical writers.\n\nThis monorepo uses the [Nx](https://nx.dev) tool-stack with the [@nxtensions/astro](https://github.com/nxtensions/nxtensions) extension for [Astro](https://astro.build/) support.\n\n\n## Getting started\nThe @nxtensions/astro extension generates projects that use targets matching the Astro CLI.\n\nFor example, use the following command to to run a project in a development server:\n```\nnpx nx dev dcp-guide\n```\n\nThis aligns to the `dev` Astro CLI command instead of the nx convention `serve` target. Similarly the `check` target is included, instead of the `lint` target, for static checks.\n\n## Generating an astro starter app using pre-built generator\n\nTo generate an Astro app, use the following command, which utilizes a custom generator to create an Astro app starter kit and generate the necessary deployment files:\n\n```\n npx nx run dcp-common:gen-astro --args=\"--title=app-title --integrations=react,mdx\"\n ```\n \nAfter executing the command, a basic Astro app structure will be set up in the \"app/app-title\" directory. You can proceed with customizing and developing your Astro app based on your specific requirements.\n\n### Generating micro-apps on your own\n@nxtensions/astro extension includes generators for applications and libraries.\n\nRun the nx `list` command to see what is available:\n```\nnpx nx list @nxtensions/astro\n```\n\nRun the `application` generator to create a new micro-app:\n```\nnpx nx g @nxtensions/astro:application\n```\n\n### Adding custombuild command\n\nThe `buildcustom` target has been introduced to provide flexibility in adding custom post-build steps to the build process. This allows for tasks such as indexing the app for search to be executed after the build is complete.\n\nOnce the app is generated it is important to add this command to `project.json` file in our project. Otherwise the build will fail.\n\n```javascript\n\"buildcustom\": {\n  \"executor\": \"nx:run-commands\",\n  \"dependsOn\": [\n    {\n      \"target\": \"build\",\n      \"projects\": \"self\"\n    }\n  ],\n  \"options\": {\n    \"commands\": []\n  }\n}\n```\n\n### Adding Custom Post-Build Steps\n\nTo add custom post-build steps, simply add commands to the commands array in the options section of the buildcustom target. For example:\n\n```javascript\n\"buildcustom\": {\n  \"executor\": \"nx:run-commands\",\n  \"dependsOn\": [\n    {\n      \"target\": \"build\",\n      \"projects\": \"self\"\n    }\n  ],\n  \"options\": {\n    \"commands\": [\n      \"npx pagefind --site dist/apps/app_name\"\n    ]\n  }\n}\n```\n\nafter the build is complete. It will start executing the commands under the `commands` array. In this case, it will index the site.\n\n## Deployment\n\nOpenShift manifests and deployments are maintained in source control and the pipeline automatically applies them during deployment stages. This is convention based and new applications can follow the existing files to adhere to conventions.\n\nApplication specific manifests and supporting files are maintained under `.openshift/\u003csub_project_name\u003e` with a main template in `\u003csub_project_name\u003e.yml`.\n\nApply the manifests for one environment to create the BuildConfig and ImageStream. For example:\n```\noc login ...\noc process -f .openshift/dcp-guide/dcp-guide.yml -p PROJECT=dcp-dev -p DEPLOY_TAG=dev | oc apply -f -\n```\n\nCreation of resources in downstream environments is handled by the pipeline when promoting new builds.\n\n## Accessing the deployed app\n\nUpon app deployment, you can employ the provided URL structure to access it within specific environments. Please note that these URLs are exclusively accessible via an internal network.\n\ndev:  https://{app_name}-dcp-dev.apps.aro.gov.ab.ca\n\nuat:  https://{app_name}-dcp-uat.apps.aro.gov.ab.ca\n\nprod:  https://{app_name}-dcp-prod.apps.aro.gov.ab.ca\n\nAs an illustration, to access the \"common-capabilities\" app within the development environment, you would use the following URL: https://common-capabilities-dcp-dev.apps.aro.gov.ab.ca\n\n## Implementing Search component in your app\n\nRefer to `digital-standards` app for example on the setup\n\n### Overview\n\nThe Search component is a reusable feature that can be easily integrated into various apps within our ecosystem. To utilize this component, we need to follow a simple implementation process and add a crucial step to our build process.\n\n### Implementation Steps\n\n1. **Import the Search component**: Import the Search component into your app's codebase.\n\n```javascript\nimport { Search as DCPSearch} from \"@abgov/dcp-common\"\n```\n    \n2. **Use the Search component**: Use the Search component in your app's JSX/HTML.\n```jsx\n\u003cDCPSearch title=\"Digital Standards\"/\u003e\n```\n\n### Build Process Update\n\nTo enable the Search component to function correctly, we need to add an additional step to our build process. After building the app, we need to index the site using Pagefind.\n\n**Add the following command to your `buildcustom` step under `options.commands`**:\n```bash\nnpx pagefind --site dist/apps/app_name\n```\nReplace `app_name` with the actual name of your app.\n\nThis command will index your app's site, making it searchable using the Search component after the build stage.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovalta%2Fdcp-monorepo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgovalta%2Fdcp-monorepo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgovalta%2Fdcp-monorepo/lists"}