|
| 1 | +# Clean Architecture Docker Angular Template |
| 2 | + |
| 3 | +This template provides a starting point for creating a Clean Architecture solution with Docker and Angular. Follow the instructions below to use the template. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- [.NET SDK 9.0](https://dotnet.microsoft.com/download/dotnet/9.0) |
| 8 | +- [Node.js](https://nodejs.org/) (for Angular) |
| 9 | +- [Docker](https://www.docker.com/get-started) |
| 10 | + |
| 11 | +## Getting Started |
| 12 | + |
| 13 | +1. **Install the template:** |
| 14 | + |
| 15 | + ```bash |
| 16 | + dotnet new install <path-to-template> |
| 17 | + ``` |
| 18 | + |
| 19 | +2. **Create a new project using the template:** |
| 20 | + |
| 21 | + ```bash |
| 22 | + dotnet new cleanarch --projectName MyTestApp --namespacePrefix NitinSoft. |
| 23 | + ``` |
| 24 | + |
| 25 | +3. **Navigate to the project directory:** |
| 26 | + |
| 27 | + ```bash |
| 28 | + cd MyTestApp |
| 29 | + ``` |
| 30 | + |
| 31 | +4. **Build and run the project:** |
| 32 | + |
| 33 | + ```bash |
| 34 | + docker-compose up |
| 35 | + ``` |
| 36 | + |
| 37 | +## Template Parameters |
| 38 | + |
| 39 | +- `--projectName`: The name of the project. Default is `MyApp`. |
| 40 | +- `--namespacePrefix`: Optional namespace prefix (e.g., `MyOrg.`). Default is an empty string. |
| 41 | + |
| 42 | +## Directory Structure |
| 43 | + |
| 44 | +The template creates the following directory structure: |
| 45 | + |
| 46 | +``` |
| 47 | +MyTestApp/ |
| 48 | +├── backend/ |
| 49 | +│ ├── src/ |
| 50 | +│ ├── tests/ |
| 51 | +│ └── ... |
| 52 | +├── frontend/ |
| 53 | +│ ├── src/ |
| 54 | +│ ├── e2e/ |
| 55 | +│ └── ... |
| 56 | +├── docker-compose.yml |
| 57 | +└── README.md |
| 58 | +``` |
| 59 | + |
| 60 | +## Customizing the Template |
| 61 | + |
| 62 | +You can customize the template by modifying the `template.json` file located in the `template-src` directory. Refer to the [Microsoft documentation](https://docs.microsoft.com/en-us/dotnet/core/tools/custom-templates) for more information on creating custom templates. |
| 63 | + |
| 64 | +## Contributing |
| 65 | + |
| 66 | +If you would like to contribute to this template, please follow the steps below: |
| 67 | + |
| 68 | +1. **Create a new branch:** |
| 69 | + |
| 70 | + ```bash |
| 71 | + git checkout -b template-generator |
| 72 | + ``` |
| 73 | + |
| 74 | +2. **Add the folder structure:** |
| 75 | + |
| 76 | + - Add the `template-src/` folder with: |
| 77 | + - `CreateTemplate.ps1` |
| 78 | + - `template.json` |
| 79 | + - `README.template.md` |
| 80 | + - `.github/workflows/dotnet-template-publish.yml` (if you’re automating) |
| 81 | + |
| 82 | +3. **Test locally:** |
| 83 | + |
| 84 | + ```bash |
| 85 | + cd template-src |
| 86 | + ./CreateTemplate.ps1 |
| 87 | + ``` |
| 88 | + |
| 89 | +4. **Install and try the template:** |
| 90 | + |
| 91 | + ```bash |
| 92 | + dotnet new install ../src/ProjectTemplate |
| 93 | + dotnet new cleanarch --projectName MyTestApp --namespacePrefix NitinSoft. |
| 94 | + ``` |
| 95 | + |
| 96 | +5. **Check generated output:** |
| 97 | + |
| 98 | + Validate if: |
| 99 | + - Project files are renamed |
| 100 | + - Namespaces are updated |
| 101 | + - It builds and runs |
| 102 | + |
| 103 | +6. **Commit and push:** |
| 104 | + |
| 105 | + ```bash |
| 106 | + git add . |
| 107 | + git commit -m "Add dynamic template generation" |
| 108 | + git push origin template-generator |
| 109 | + ``` |
| 110 | + |
| 111 | +Once you’re happy, you can either: |
| 112 | +- Merge into main, or |
| 113 | +- Keep it as a separate maintained branch for template packaging |
| 114 | + |
| 115 | +## License |
| 116 | + |
| 117 | +This project is licensed under the MIT License. See the [LICENSE](../LICENSE) file for details. |
0 commit comments