Skip to content

This sample solution demonstrates modern .NET best practices—featuring clean architecture, robust testing, dependency injection, and Docker containerization—to help you build scalable, maintainable applications.

License

Notifications You must be signed in to change notification settings

jonathanperis/cpnucleo

Repository files navigation

Cpnucleo

Welcome to Cpnucleo – a cutting-edge sample solution that embodies the best practices for building robust and scalable .NET projects. This project is your blueprint for modern application development using C# and Docker, designed to help developers kickstart their journey with high-quality code, organized structure, and industry-standard patterns.


Table of Contents


Introduction

Cpnucleo is a sample solution that demonstrates how to implement industry best practices when developing .NET projects. The purpose of this repository is to serve as a learning tool and a reference implementation that covers everything from clean architecture principles and dependency injection to unit testing and containerization.


Project Overview

This repository is designed for:

  • Beginners aiming to learn best practices in modern .NET projects.
  • Experienced developers looking for a reliable reference implementation.
  • Teams seeking to set a standard for coding conventions, project structure, and CI/CD pipeline integration.

Highlights:

  • Clean and modular project structure
  • Robust error handling and logging
  • Comprehensive unit and integration tests
  • Docker integration for containerized deployments
  • Extensive documentation for ease of onboarding

Key Features

  • Modular Architecture: Clear separation of concerns using layered architecture, domain-driven design, and SOLID principles.
  • Extensible Design: Easily extend and customize the solution to fit your specific requirements.
  • Robust Error Handling: Integrated logging and detailed exception management.
  • Test Coverage: Extensive unit and integration tests ensuring high reliability.
  • Containerized Environment: Dockerfile provided for building and running the app in a containerized environment.
  • CI/CD Ready: Sample configurations and scripts for automated build, test, and deployment processes.

Architecture

The solution follows an organized structure that promotes:

  • Separation of Concerns: Clear distribution between UI, Business Logic, and Data Access layers.
  • Dependency Injection: Decoupled components for easy testing and maintainability.
  • Configuration Management: Centralized configuration that adapts to different environments.

A high-level diagram of the architecture is provided below:

+---------------------+
|  Client / Frontend  |
+---------------------+
          |
          v
+---------------------+
|     API Gateway     |
| (Controllers/Routes)|
+---------------------+
          |
          v
+---------------------+
| Business Logic Layer|
| (Services/Managers) |
+---------------------+
          |
          v
+---------------------+
|  Data Access Layer  |
|  (Repositories)     |
+---------------------+

Technologies Used

  • C# & .NET: Primary language and framework.
  • Docker: Containerization via provided Dockerfile.
  • Entity Framework Core: ORM for database interactions.
  • xUnit: For unit testing.
  • AutoMapper: Object-to-object mapping.
  • Logging Framework: Integrated logging (e.g., Serilog, NLog) for monitoring and troubleshooting.

Prerequisites

Before getting started, ensure you have the following installed:


Getting Started

Clone this repository to your local machine:

git clone https://github.com/jonathanperis/cpnucleo.git
cd cpnucleo

Installation

Restore the NuGet packages and build the solution:

dotnet restore
dotnet build

Configuration

All configuration settings are located in the appsettings.json file. Adjust connection strings and other environment-specific settings as needed.


Building and Running

To run the application locally, use the following command:

dotnet run --project WebApi

Alternatively, to build and run using Docker, execute:

docker build -t cpnucleo .
docker run -d -p 5000:80 cpnucleo

Testing

Run all tests using the following command:

dotnet test

Ensure that all tests pass and review the detailed test reports generated during the test run.


Deployment

The project supports multiple deployment strategies including:

  • Dockerized Deployment: Use the provided Dockerfile to package and deploy your application.
  • Cloud Providers: Suitable for Azure App Services, AWS Elastic Beanstalk, and more.
  • CI/CD Integration: Sample CI/CD configurations are included to facilitate automated pipelines.

Contribution Guidelines

We welcome contributions from the community! To contribute:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Write tests for your changes.
  4. Submit a pull request with a detailed description of your changes.

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute this software in accordance with the license terms.


Troubleshooting & FAQ

Q: How do I encounter a build error?
A: Please review the error logs and ensure that all dependencies are correctly installed. Check the configuration files for any mismatches.

Q: How do I run tests?
A: Run dotnet test in the root directory; detailed test results will be displayed in the terminal.


Contact & Support

If you have any questions, issues, or would like to contribute, please open an issue on GitHub.

Stay connected:


Acknowledgements

  • Inspiration from industry-leading projects and best practices.
  • Contributions from the open-source community.
  • Special thanks to all the developers and maintainers who helped shape this project.

Elevate your development process with Cpnucleo – where quality meets innovation.

About

This sample solution demonstrates modern .NET best practices—featuring clean architecture, robust testing, dependency injection, and Docker containerization—to help you build scalable, maintainable applications.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages