Skip to content

Commit 003477f

Browse files
committed
feat: initialize .NET 8 Lambda solution with Central Package Management
Implements complete solution structure with Clean Architecture and centralized package versioning. ## Project Initialization - Created 7 projects: Domain, Application, Infrastructure, Lambda, UnitTests, IntegrationTests, TestHelpers - Configured Clean Architecture dependency flow (Lambda → Infrastructure → Application → Domain) - All projects target .NET 8.0 with nullable reference types enabled ## Central Package Management - Implemented CPM via Directory.Packages.props for centralized version control - Removed version attributes from all PackageReference elements in .csproj files - Organized 17 packages by layer: Application, Infrastructure, Lambda, Testing - Prevents version drift and simplifies dependency updates across solution ## Package Versions Application: - MediatR 12.4.1 (CQRS pattern) - FluentValidation 11.10.0 (input validation) Infrastructure: - Microsoft.EntityFrameworkCore 8.0.10 - Pomelo.EntityFrameworkCore.MySql 8.0.2 - AWSSDK.SecretsManager 3.7.400.57 - AWSSDK.SQS 3.7.400.57 Lambda: - Amazon.Lambda.Core 2.4.0 - Amazon.Lambda.SQSEvents 2.2.0 - Amazon.Lambda.Serialization.SystemTextJson 2.4.3 Testing: - xUnit 2.4.2, Moq 4.20.72 - Testcontainers.MySql 3.10.0 ## CI/CD Pipeline - GitHub Actions workflow for automated build and test on push/PR to main/develop - Separate unit (Category=Unit) and integration (Category=Integration) test execution - Lambda deployment package creation with artifact upload - Test results publishing via dorny/test-reporter ## Development Standards - .editorconfig with C# coding conventions (4-space indent, var preferences, naming rules) - Comprehensive .gitignore for .NET projects (build artifacts, IDE files, packages) - README.md with architecture overview, CPM documentation, and getting started guide
0 parents  commit 003477f

File tree

17 files changed

+1026
-0
lines changed

17 files changed

+1026
-0
lines changed

.editorconfig

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# EditorConfig is awesome: https://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# All files
7+
[*]
8+
charset = utf-8
9+
indent_style = space
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
# Code files
14+
[*.{cs,csx,vb,vbx}]
15+
indent_size = 4
16+
17+
# XML project files
18+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
19+
indent_size = 2
20+
21+
# XML config files
22+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
23+
indent_size = 2
24+
25+
# JSON files
26+
[*.json]
27+
indent_size = 2
28+
29+
# YAML files
30+
[*.{yml,yaml}]
31+
indent_size = 2
32+
33+
# Markdown files
34+
[*.md]
35+
trim_trailing_whitespace = false
36+
37+
# Dotnet code style settings
38+
[*.{cs,vb}]
39+
40+
# Sort using and Import directives with System.* appearing first
41+
dotnet_sort_system_directives_first = true
42+
dotnet_separate_import_directive_groups = false
43+
44+
# Avoid "this." and "Me." if not necessary
45+
dotnet_style_qualification_for_field = false:warning
46+
dotnet_style_qualification_for_property = false:warning
47+
dotnet_style_qualification_for_method = false:warning
48+
dotnet_style_qualification_for_event = false:warning
49+
50+
# Use language keywords instead of framework type names for type references
51+
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
52+
dotnet_style_predefined_type_for_member_access = true:warning
53+
54+
# Suggest more modern language features when available
55+
dotnet_style_object_initializer = true:suggestion
56+
dotnet_style_collection_initializer = true:suggestion
57+
dotnet_style_coalesce_expression = true:warning
58+
dotnet_style_null_propagation = true:warning
59+
dotnet_style_explicit_tuple_names = true:warning
60+
61+
# Prefer using var
62+
csharp_style_var_for_built_in_types = true:suggestion
63+
csharp_style_var_when_type_is_apparent = true:suggestion
64+
csharp_style_var_elsewhere = true:suggestion
65+
66+
# Prefer method-like constructs to have a block body
67+
csharp_style_expression_bodied_methods = false:none
68+
csharp_style_expression_bodied_constructors = false:none
69+
csharp_style_expression_bodied_operators = false:none
70+
71+
# Prefer property-like constructs to have an expression-body
72+
csharp_style_expression_bodied_properties = true:suggestion
73+
csharp_style_expression_bodied_indexers = true:suggestion
74+
csharp_style_expression_bodied_accessors = true:suggestion
75+
76+
# Suggest more modern language features when available
77+
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
78+
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
79+
csharp_style_inlined_variable_declaration = true:suggestion
80+
csharp_style_throw_expression = true:suggestion
81+
csharp_style_conditional_delegate_call = true:suggestion
82+
83+
# Newline settings
84+
csharp_new_line_before_open_brace = all
85+
csharp_new_line_before_else = true
86+
csharp_new_line_before_catch = true
87+
csharp_new_line_before_finally = true
88+
csharp_new_line_before_members_in_object_initializers = true
89+
csharp_new_line_before_members_in_anonymous_types = true
90+
csharp_new_line_between_query_expression_clauses = true
91+
92+
# Indentation preferences
93+
csharp_indent_case_contents = true
94+
csharp_indent_switch_labels = true
95+
csharp_indent_labels = flush_left
96+
csharp_indent_block_contents = true
97+
csharp_indent_braces = false
98+
csharp_indent_case_contents_when_block = false
99+
100+
# Space preferences
101+
csharp_space_after_cast = false
102+
csharp_space_after_keywords_in_control_flow_statements = true
103+
csharp_space_between_method_call_parameter_list_parentheses = false
104+
csharp_space_between_method_declaration_parameter_list_parentheses = false
105+
csharp_space_between_parentheses = false
106+
csharp_space_before_colon_in_inheritance_clause = true
107+
csharp_space_after_colon_in_inheritance_clause = true
108+
csharp_space_around_binary_operators = before_and_after
109+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
110+
csharp_space_between_method_call_name_and_opening_parenthesis = false
111+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
112+
113+
# Wrapping preferences
114+
csharp_preserve_single_line_statements = false
115+
csharp_preserve_single_line_blocks = true
116+
117+
# Naming conventions
118+
dotnet_naming_rule.interfaces_should_be_prefixed_with_i.severity = warning
119+
dotnet_naming_rule.interfaces_should_be_prefixed_with_i.symbols = interface
120+
dotnet_naming_rule.interfaces_should_be_prefixed_with_i.style = begins_with_i
121+
122+
dotnet_naming_rule.types_should_be_pascal_case.severity = warning
123+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
124+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
125+
126+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = warning
127+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
128+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
129+
130+
# Symbol specifications
131+
dotnet_naming_symbols.interface.applicable_kinds = interface
132+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
133+
dotnet_naming_symbols.interface.required_modifiers =
134+
135+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
136+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
137+
dotnet_naming_symbols.types.required_modifiers =
138+
139+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
140+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
141+
dotnet_naming_symbols.non_field_members.required_modifiers =
142+
143+
# Naming styles
144+
dotnet_naming_style.begins_with_i.required_prefix = I
145+
dotnet_naming_style.begins_with_i.required_suffix =
146+
dotnet_naming_style.begins_with_i.word_separator =
147+
dotnet_naming_style.begins_with_i.capitalization = pascal_case
148+
149+
dotnet_naming_style.pascal_case.required_prefix =
150+
dotnet_naming_style.pascal_case.required_suffix =
151+
dotnet_naming_style.pascal_case.word_separator =
152+
dotnet_naming_style.pascal_case.capitalization = pascal_case
153+

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI Pipeline
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
build-and-test:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup .NET
18+
uses: actions/setup-dotnet@v4
19+
with:
20+
dotnet-version: '8.0.x'
21+
22+
- name: Restore dependencies
23+
run: dotnet restore
24+
25+
- name: Build solution
26+
run: dotnet build --configuration Release --no-restore
27+
28+
- name: Run unit tests
29+
run: dotnet test --filter "Category=Unit" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=unit-test-results.trx"
30+
continue-on-error: true
31+
32+
- name: Run integration tests
33+
run: dotnet test --filter "Category=Integration" --configuration Release --no-build --verbosity normal --logger "trx;LogFileName=integration-test-results.trx"
34+
continue-on-error: true
35+
36+
- name: Publish test results
37+
uses: dorny/test-reporter@v1
38+
if: always()
39+
with:
40+
name: Test Results
41+
path: '**/TestResults/*.trx'
42+
reporter: dotnet-trx
43+
fail-on-error: false
44+
45+
- name: Package Lambda function
46+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
47+
run: |
48+
dotnet publish src/LeadProcessor.Lambda/LeadProcessor.Lambda.csproj \
49+
--configuration Release \
50+
--runtime linux-x64 \
51+
--self-contained false \
52+
--output ./publish
53+
cd ./publish
54+
zip -r ../lambda-deployment.zip .
55+
56+
- name: Upload Lambda deployment package
57+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/develop')
58+
uses: actions/upload-artifact@v4
59+
with:
60+
name: lambda-deployment-package
61+
path: lambda-deployment.zip
62+
retention-days: 30
63+

0 commit comments

Comments
 (0)