- HTML 95.4%
- C# 2.9%
- CSS 1.6%
| .vscode | ||
| coverage | ||
| CrashTest.Dev | ||
| CrashTest.Dev.AppHost | ||
| CrashTest.Dev.Client | ||
| CrashTest.Dev.Common | ||
| CrashTest.Dev.Components | ||
| CrashTest.Dev.DB | ||
| CrashTest.Dev.MigrationService | ||
| CrashTest.Dev.ServiceDefaults | ||
| docs | ||
| Tests | ||
| .gitignore | ||
| aspire.config.json | ||
| CrashTest.Dev.sln | ||
| LICENCE | ||
| README.md | ||
| tests.runsettings | ||
CrashTest.Dev
This serves as my personal blog and other general tools, a "Personal Repository of Information", see crashtest.dev.
Design and development
See High Level Design and Low Level Design.
Check Design Patterns for design patterns used in the application, and the Testing Strategy.
Run & debug
Follow the steps to install aspire, using the latest .NET SDK version.
Then from the project root, run:
aspire run
You should then get a web address for the aspire web dashboard, navigate to there, you should then see a list of resources, and their URLs.
$ aspire run
AppHost: CrashTest.Dev.AppHost/CrashTest.Dev.AppHost.csproj
Dashboard: https://localhost:17263/login?t=70e2e0727778403aaf8b910cef67e6da
Logs: ~/.aspire/logs/cli_20260415T074308_9ec3a937.log
Press CTRL+C to stop the apphost and exit.
Some resources will appear unhealthy initially, the app resource is the main web application in the CrashTest.Dev project, it is the last to start up, and should be available at https://localhost:7044 when it does.
Using
This is more or less a simple CRUD app in function, see (high level design)[docs/HLD.md], some pages will require authentication and will redirect you to the Keycloak instance aspire spun up.
Authenticating
Keycloak is used for authenticating which is needed to make any DB changes, aspire spins up an instance of Keycloak on localhost:8080.
Accessing an auth only page will redirect you to Keycloak, aspire will have also have configured a default username and password which are:
Username: foster
Password: daphone
These do not need to be changed for local dev purposes, but will not work for live deployments.
Database Migrations
Ensure you have EF Tools installed with
dotnet tool install --global dotnet-ef
Due to a quirk of the MySQL EF Core Aspire integration and EF Tools, you will need to explicitly set the connection string of the MySQL database in the CrashTest.Dev project, to do this, start the project with aspire run as above.
Wait for the MySQL resource to start and become healthy, once it is, click on the row to reveal the details, then you can view the connection string.
You will need to edit the port, as for whatever reason aspire uses a temporary port, you can get the port by checking the container for the exposed port.
$ [podman or docker] ps -f name=crashtest-mysql
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bd1866b0908d docker.io/library/mysql:9.6 mysqld 5 hours ago Up 5 hours 127.0.0.1:43247->3306/tcp, 33060/tcp crashtest-mysql
43247 is the port number in this case
Then in a command line in the CrashTest.Dev project directory, run:
SlnRoot/CrashTest.Dev$ dotnet user-secrets init
SlnRoot/CrashTest.Dev$ dotnet user-secrets set "Aspire:Pomelo:EntityFrameworkCore:MySql:ConnectionString" "[your connection string]"
Then you can make you changes to the models and context in CrashTest.Dev.DB, and then from the CrashTest.Dev project directory run:
SlnRoot/CrashTest.Dev$ dotnet ef migrations add NameOfEdit --project ../CrashTest.Dev.DB/CrashTest.Dev.DB.csproj
Once you run the project again, Aspire will apply this migration to the database automatically.
Testing
See testing strategy for more information specific to tests
To run all the available tests, from the project root run:
dotnet test
Tasks
In progress
- Build test & deploy to testing.crashtest.dev pipeline in Forgejo when merging into testing
- Complete NewPost page and models
For MVP
- Complete post view page
- Complete post edit page
- Create series create page
- Create series edit page
- Create series view page
- Add categories to models
- Create notes back end infrastructure and tests
- Create note create page
- Create note edit page
- Create note view page
- Create post search page
- Create note search page
- Build test & deploy to crashtest.dev pipeline in Forgejo when merging into main
Blocked
- Coverage report including DB migrations and fluent validators
Nice to haves
- RSS
- ActivityPub protocol
- OTEL and monitoring


