Darewise test, feedback API
This is an example architecture of what I would have done
Feedback API publishing message to a broker (Google PubSub, RabbitMQ...)
It would then go to several subscribers, for example, could be nice to have notification for bug reports on a discord channel through webhooks
It could be nice to have a KPI dashboard from the data generated by feedback
I made a simple JWT secured web application
About file upload, it does not upload directly to GCS because of what is not working), however, I made it working to your own file system (to show that it works and it's just about wrapping GCS to get it fully working, I did that wrapping in a class GcsBlobStorage
)
I made some basic unit tests, mainly technical ones. I believe (at least for microservices) that unit tests should be used for libraries or tricky scenarios, otherwise, it should be end-to-end tests to ensure everything works as defined in the protocol.
I did not pursue much more, I'm not learning anything and I can not reuse this code for another project.
- OpenAPI Spec generated from Swashbuckle
- Postman Collection Generated from OpenAPI Specs & tweaked for ease of use
- Start PostgreSQL
docker run -p 5432:5432 --name feedback-api-database -e POSTGRES_PASSWORD=strong_pass2018 --restart always -d postgres:13
- Start the API
dotnet run --project srcs/Darewise.Feedback
- Import Postman collection & start testing
- Upload files (it will get to your file system locally
- .NET 6 / C#
- JsonWebTokens - JWT for security
- EFCore.NpgSQL - SQL ORM with NoSQL columns capabilities
- MapsterMapper - Object Mapping to avoid manual mapping, just sugar syntax with negligible performance impact
- Moq - Mocking library
- NFluent - Fluent assertion library
- NBuilder - Fluent Fake Object creation library
- GCP related stuff (GCS is not plugged because I don't have GCP account unless I put my credit card there)
I would have added these things if I had more time:
- Integration Tests Postman collection with CLI based integration test
- CloudEvents CloudEvents specification should be implemented for inter services messages (broker)
- Prometheus metrics for software monitoring (qps, bytes uploaded count...)
- Grafana Dashboard for software metrics visualization & alerting (+ alert manager)
- Sentry Sentry to group up all software exceptions & faster fixing
- Superset dashboard with user related KPIs