Everytime I setup a new project, besides consideration on if I need microservice architecture or a good old monolithic application there are always simliar steps needed to get the project in a maintainable state.
Docker Compose
Regardless of the architecture, anything new needs to run in a container. This is just defacto now days. I built a simple demo a few years back which is still relavant. Today I’d add that compose locally should bring up a containerised local environment for everything your application needs to run.
- containerised database
- stubs of downstream internal dependencies, you can use tooling like wiremocks (.Net), Express (Node) or a simple JSON Server
- stubs of external dependencies, example AWS Localstack
- stubs of your authorisation service
This should be run from one file like Run_Local.ps1
, below is an example.
Example Run_Local.ps1
1 | <# |
Code Conventions
We want all members of the team rowing in the same direction. As there are many IDEs (Visual Studio, Ryder ect) the simplest way is to commit a .editorconfig
file with the source control. Check out https://editorconfig.org/
Example .editorconfig
1 | root = true |
Static Code Analysis
You have more than one option!
SonarScanner (Remote Server)
Its important to understand that sonarscanner doesnt run tests, it reports on static code and can be provided test coverage reports.
Run your own containerised Sonarqube server locally.
SonarAnalyzer (Local Static Code Analysis)
Although many large IT companies have a sonar server which can be used a a quality gate in PRs and Master builds its possible to do these checks locally.
Unit Test code coverage
- https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-code-coverage?tabs=linux
- https://www.jetbrains.com/help/rider/Analyzing_Coverage_NET.html
Logging
- Serilog
- App Insights
CI/CD pipeline
CI/CD pipeline for build & tests