1
Answer

Create Nugget Package of .NET Core Web API and angular frontend

Atul Sharma

Atul Sharma

Sep 26
349
1

I have developed Web (CRUD operation and other functionality) in .NET core and I wanted to distribute that code with other country developers so that they can extend/modify the functionality like they can add addiotional property in entity class, can add additional API end points in controller, can modify business rule for that country. The problem is that client don't wants to share code base reposiorty to other country developers and  asking to  Nugget package of Web API and share the package with other country developers. Similarly he is asking to create Nugget of Angular fonted application as well.

I wanted to know that creating a Nugget package for such type requirement is good idea? Conceptually how much it would be feasible to achive extend/modify requirement and long term aspect of maintainbility? 

Experts please advice me on that and please share your approach as well to achive this requirement.

Thanks. 

Answers (1)
1
Adarsh Nigam

Adarsh Nigam

439 3.3k 36.9k Sep 27

Yes, creating NuGet packages for your .NET Core web application is a good idea for distributing and managing your codebase. This approach offers several advantages:

  • Isolation: Packages create a clear separation between your core components and the customizations made by different teams or regions. This helps prevent conflicts and makes it easier to manage changes.
  • Version Control: NuGet packages can be versioned, allowing you to track changes and easily revert to previous versions if needed.
  • Reusability: Packages can be reused across multiple projects, saving development time and effort.
  • Dependency Management: NuGet handles dependencies between packages, ensuring that your application has the correct versions of all required components.

To achieve your goal of allowing other teams to extend and modify your application, you can create separate NuGet packages for the following components:

  1. Core API: This package should contain the core API endpoints, entity classes, and business logic that is common to all regions.
  2. Region-Specific API: This package can contain additional API endpoints, entity properties, or business rules that are specific to a particular region.
  3. Angular Frontend: Create a separate NuGet package for the Angular frontend application. This will allow teams to customize the UI and add region-specific features without affecting the core application.

When creating these packages, consider the following best practices:

  • Modularization: Break down your code into smaller, well-defined modules that can be easily packaged and reused.
  • Dependency Injection: Use dependency injection to make your code more flexible and easier to test.
  • Versioning: Follow a consistent versioning scheme (e.g., Semantic Versioning) to manage changes and dependencies.
  • Documentation: Provide clear and concise documentation for your packages, including usage instructions, API references, and any specific requirements.

By following these guidelines, you can create NuGet packages that are easy to distribute, maintain, and extend, meeting your client's requirements while also promoting code reusability and collaboration.

Accepted