Conventions Structure - cilerler/cilerler.github.io GitHub Wiki

Opinionated Folder Structures

Workspace

[!CAUTION] Do not use AI on the /local/archives, /local/_git-bare, and /local/docs folders. They probably contain sensitive, private information that must not be processed or shared with any AI models.

/Source                                     // Root directory located at %USERPROFILE%\Source
  /local                                    // Local and machine-specific files
    /!nuget                                 // Private offline NuGet packages
    /archives                              // Repository backups (settings, tool data, user secrets)
      /_temp                                // Temporary extraction folder for packed backups (should not be visible unless an error occurs)
      /local__git-bare_UserSecrets.$timestamp.bundle                   // Bundled user secrets repository
      /local__git-bare_local_knowledgebase_personal.$timestamp.bundle  // Bundled knowledgebase repository
      /local__git-bare_local_docs_personal.$timestamp.bundle           // Bundled local notes repository
      /local_sandbox_$pocName1.bundle                                  // Bundled sandbox repository for PoC 1
      /local_sandbox_$pocName2.bundle                                  // Bundled sandbox repository for PoC 2
      /github_$user_$repository.bundle                                 // Bundled GitHub repository
      /vsts_$organization_$repository.bundle                           // Bundled Azure DevOps repository
      /vsts_$organization_DefaultCollection_$repository.zip            // Zipped Azure DevOps repository
      /assembla_$organization_$repository.zip                          // Zipped Assembla repository
      /bitbucket_$organization_$repository.bundle                      // Bundled BitBucket repository
    /_git-bare
      /local
        /knowledgebase                      // Bare repository for knowledgebase
        /docs
          /personal                         // Bare repository for personal notes
          /...
      /UserSecrets                          // Bare repository for user secrets
    /sandbox                                // Experimental code and Proof-of-Concepts (PoCs)
    /knowledgebase                          // Knowledgebase organized by unit
      /personal                             // personal knowledgebase
        .editorconfig                       // Editor configuration for coding style
        .gitignore                          // Git ignore patterns for this repository
        .gitattribute                       // Git attributes configuration

        /home
          /trash                            // Staging area for files pending deletion
          /dump                             // Unsorted notes requiring classification or relocation
          /temp                             // Temporary scratch files with limited lifespan
          /private                          // Private notes, not for external distribution
            /<private subject 1>
          /public                           // Snippets suitable for sharing
            /<public subject 1>
          /global                           // Snippets relevant across multiple units
            /dev                            // General development-related snippets
              /powershell
                README.md                   // Markdown-formatted code snippets
                ...
              /...
              /notebook
                README.md                   // Markdown-formatted code snippets
                .env                        // Environment variables for notebook execution
                sample.dib                  // Example polyglot notebook (.dib)
                sample.ipynb                // Example Jupyter notebook (.ipynb)
              /...
            /...
          /...

    /docs
      /personal                             // Personal notes repository
        .editorconfig                       // Editor configuration for coding style
        .gitignore                          // Git ignore patterns for this repository
        .gitattribute                       // Git attributes configuration
        /.vscode                            // Visual Studio Code workspace settings
        /.workspaces                        // Visual Studio Code multi-root workspace definitions

        /home
          /trash                            // Staging area for files pending deletion
          /dump                             // Unsorted notes requiring classification or relocation
          /temp                             // Temporary scratch files with limited lifespan
          /private                          // Private notes, not for external distribution
            /<private subject 1>
          /public                           // Notes suitable for sharing
            /<public subject 1>
          /global                           // Notes relevant across multiple units
            Diary.md                        // Daily work log or journal
            /dev                            // General development-related notes
              Scratchpad.md                 // Quick code experiments and scratchpad
              /tickets                      // Notes specific to support tickets
                /<ticket1>
                  00-ActionPlan.md                                     // Summary of objectives, scope, and sequence of actions
                  01-ValidationChecklist.md                            // Validations to confirm expected outcomes
                  02-RollbackInstructions.md                           // Fallback steps in case execution needs to be reverted

                  11-PepareEnvironment.ps1                             // Pre-task infra adjustments (e.g., scale down services)
                  12-PreChecks.md                                      // Verify pre-conditions (schema state, data quality)
                  13-Step1_TransformData.cs                            // First logical unit of data manipulation or migration
                  14-Step2.1_ModifySchemaForX.sql                      // Schema or structural changes (e.g., indexes, tables) for reason X
                  15-Step2.2_ModifySchemaForY.sql                      // Schema or structural changes (e.g., indexes, tables) for reason Y
                  16-Step3_TransformData.cs                            // Second logical unit of data manipulation or migration
                  17-Cleanup.md                                        // Post-processing cleanup (temporary tables, flags, etc.)
                  18-RestoreEnvironment.ps1                            // Infra restoration steps (e.g., scale up services again)
                  // ...

                  99-ExecutionSummary.md                               // Notes, logs, and summary from the task execution
                /...
              /projects                     // Notes specific to ongoing projects
                /<project1>
                /...
              /repositories                 // Notes specific to code repositories
                /<repo1>
                /...
              /middleware                   // Middleware, integration scripts, and helper utilities
                /certificates               // Certificates, keys, and security credentials
                /...
            /...
      /...

  /github
    /<username>                             // User-specific GitHub repositories
      /<repository>                         // Specific repository directory
    /dotnet                                 // Repositories related to .NET
      /dotnet-architecture                  // Repository for .NET architecture resources
    /OData                                  // Repositories related to OData
      /RESTier                              // Repository for the RESTier project
    /...

  /vsts                                     // Azure DevOps (formerly VSTS) repositories
    /<organization>                         // Azure DevOps organization
      /<repository>                         // Specific repository directory
    /...

  /...
.NET Solution
/.vscode                                    // Visual Studio Code settings
  - settings.json                           // Workspace settings
  - launch.json                             // Debugging configuration
  - tasks.json                              // Task configuration
  - extensions.json                         // Recommended extensions
/.git                                       // Git configuration
  - config                                  // Git configuration file
/.github                                    // GitHub configuration
  - CODEOWNERS                              // Code owners for the repository
  - PULL_REQUEST_TEMPLATE.md                // Pull request template
  /ISSUE_TEMPLATE                           // Issue templates
    - bug_report.yml                        // Bug report template
    - feature_request.yml                   // Feature request template
    - custom_template.yml                   // Custom template
  /workflows                                // GitHub Actions workflows
    - ci.yml                                // CI/CD pipeline for continuous integration
    - checks.yml                            // CI/CD pipeline for running checks and tests
/docs
  - README.md                               // Documentation for the project  
  /diagrams
    - Diagram1.puml                         // PlantUML diagram
    - Diagram2.puml
    - ...
  /notebooks
    - Notebook1.dib                         // Notebook for the project
    - Notebook2.dib
    - ...

/tools
  /Kubernetes
    - kustomization.yaml                    // Kustomize configuration for Kubernetes
    /base
      - kustomization.yaml                  // Base kustomize configuration for Kubernetes
      - deployment.yaml                     // Base deployment configuration for Kubernetes
      - service.yaml                        // Base service configuration for Kubernetes
    /overlays
      /integration
        /base                               // Base configuration for Integration environment
          - kustomization.yaml              // Base kustomize configuration for Integration environment
          - deployment.yaml                 // Base deployment configuration for Integration environment
          - service.yaml                    // Base service configuration for Integration environment
        /default                            // Default configuration for Integration environment
          - kustomization.yaml              // Default kustomize configuration for Integration environment
          - deployment.yaml                 // Default deployment configuration for Integration environment
          - service.yaml                    // Default service configuration for Integration environment
        /alternative                        // Alternative configuration for Integration environment
          - kustomization.yaml              // Alternative kustomize configuration for Integration environment
          - deployment.yaml                 // Alternative deployment configuration for Integration environment
          - service.yaml                    // Alternative service configuration for Integration environment
      /testing
        /base
          - kustomization.yaml
          - deployment.yaml
          - service.yaml
        /default
          - kustomization.yaml
          - deployment.yaml
          - service.yaml
        /alternative
          - kustomization.yaml
          - deployment.yaml
          - service.yaml
      /staging
        /base
          - ...
        /default
          - ...
        /alternative
          - ...
      /production
        /...
/test
  - Test.http                               // HTTP request test file for REST API testing
  /Company.Project.Host.Tests
    - Company.Project.Host.Tests.csproj     // Test project
  /Company.Project.Domain.Tests
    - Company.Project.Domain.Tests.csproj   // Test project
  /...
.dockerignore                               // Docker ignore file
.editorconfig                               // Editor configuration file
.gitattributes                              // Git attributes file
.gitignore                                  // Git ignore file
LICENSE                                     // License file
README.md                                   // Readme file explains the project
CHANGELOG.md                                // Changelog file for the project
azure-pipelines.yml                         // Azure DevOps pipeline configuration
Company.Solution.sln                        // Visual Studio solution file
/src
  /Company.Project.Abstractions
  /Company.Project.Extensions
  /Company.Project.Domain  
  /Company.Project.Host
    - Program.cs                            // Entry point for the application
    - ProgramExtensions.cs                  // Extension methods for the program
    - StartupBackgroundService.cs           // Initial background service for the application
    - StartupHealthCheck.cs                 // Health check for the application
    - AppConfigurationExtensions.cs         // Configuration extensions for the application
    - appsettings.json                      // Configuration settings for the application
    - appsettings.Development.json          // Configuration settings for the development environment
    - appsettings.Integration.json          // Configuration settings for the integration environment
    - appsettings.Testing.json              // Configuration settings for the testing environment
    - appsettings.Staging.json              // Configuration settings for the staging environment
    - appsettings.Production.json           // Configuration settings for the production environment
    - Dockerfile                            // Docker configuration for containerization
    - Company.Project.Host.csproj           // Project file
    - Directory.Build.props                 // Common properties for all projects in the solution
    - Buildinfo.txt                         // Build information to show when the app starts
    - App.razor                             // Main application component
    - Routes.razor                          // Route configuration for the application

    /Properties
      - launchSettings.json                 // Debugging settings for the project, Visual Studio and .NET Core CLI    

    /Resources
      /SQL
        - Constants.cs
        - Query1.sql
        - Query2.sql
        - ...
      /...

    /wwwroot
      - index.html                          // Default HTML file for the application
      - favicon.ico                         // Favicon for the application
      - ...
      /css
        - app.css
        - ...

    /Pages
      - Page1.razor                         // Razor page for the application
      - Page2.razor
      - ...

    /PageComponents
      - PageComponent1.razor                // Page component for the application
      - PageComponent2.razor
      - ...

    /Layout
      - MainLayout.razor                    // Main layout component
      - NavMenu.razor                       // Navigation menu component
      - _Imports.razor                      // Import statements for the application

    /Modules
      /Common
        /Models
        - CommonModel1.cs                   // Shared DTOs or models for different modules
        - CommonModel2.cs
        - ...
        /Abstractions
        - CommonInterface1.cs               // Shared interfaces or common abstractions
        - CommonEnum1.cs                    // Common enums shared across modules
        - ...
        /Extensions
        - CommonExtensions1.cs              // Common extension methods for models, services, or utilities
        - ...

      /Module1
        - Api.cs                            // API Controller (exposes the service via HTTP)
        - Service.cs                        // Business logic/service implementation
        - Settings.cs                       // Module-specific configuration/settings (binds to appsettings)
        - Models.cs                         // Module-specific DTOs or request/response models
        - Abstractions.cs                   // Module-specific interfaces, enums, or abstract classes        
        - Worker.cs                         // Background task or worker logic for long-running processes
        - StartupExtensions.cs              // Module-specific startup configuration or service registration
        - Extensions.cs                     // Extension methods for the service or models within the module
        - Factory.cs                        // Factory class for creating instances of the service or models
        /Component1
          - Api.cs
          - Service.cs
          - Settings.cs
          - Models.cs
          - Abstractions.cs
          - Worker.cs
          - StartupExtensions.cs
          - Extensions.cs
          - Factory.cs
        /Component2
          - Api.cs
          - Service.cs
          - Settings.cs
          - Models.cs
          - Abstractions.cs
          - Worker.cs
          - StartupExtensions.cs
          - Extensions.cs
          - Factory.cs
        /...
          - ...
      /Module2
        - ...
        /Component1
          - ...
        /...
          - ...

Opinionated Artifact Naming Convention

Given the project name Company.Project.Descriptor.csproj, here are the recommended naming patterns for each artifact:

Artifact Naming Pattern Notes
NuGet Package Name Company.Project.Descriptor
Docker Image Name company-project-descriptor Replace each . with -
URL Public https://descriptor.project.environment.company.app
URL Private https://descriptor.project.environment.company.internal
URL Private (dev) https://descriptor.project.environment.company.local
URL Private K8S (dev) https://descriptor.project.environment.svc.cluster.local
URL Private K8S https://descriptor.project.environment.svc.cluster.internal

Opinionated Message Queue Naming Conventions

Component Naming Pattern Dead Letter Suffix
Exchange [myApp].[myModule].exchange .dlx
Routing Key [myApp].[myModule].[myEvent/myAction]
Queue [myApp].[myModule].[myConsumer].[myEvent/myAction].queue .dlq
⚠️ **GitHub.com Fallback** ⚠️