diff --git a/docs/index.md b/docs/index.md new file mode 100644 index 0000000..27c2893 --- /dev/null +++ b/docs/index.md @@ -0,0 +1,38 @@ +# Documentation for Miniweb + +## Rear + +### The Repository Concept + +The idea is, that whatever datasource you have, you implement the AdminRepository Trait to make it usable in the Administration overview. + +Your Repository Implementation can then be used to either instance multiple different datasources compatible to your implementation, or just to a specific one. + +Adjusting the List, View and Edit Forms of the admin on the other hand is done with using the namespacing of the templates. + +Finally, expanding the Administration with new urls should be possible as well, to adjust the admin to your projects' needs. + +You can see an AdminRepository like a ModelAdmin in Django, however without the automatic binding to an internal ORM. + +The goal later on is also to provide Macros for major ORMs to quickly create such Repositories + +The idea is to have a backend platform to build on, without binding you to a specific solution overall. + +However, obviously, the chosen libraries of tokio, axum and minijinja, and the primary ORM with sea-orm most likely will work best. + +### Writing an Admin Repository + +To implement an Admin Repository, you can look at the empty_repository example. + +the AdminRepository trait requires you to implement: + + - an associated type Key, that implements PrimaryKeyType + - key_from_string, which transforms a String into your Key + - info, which produces an instance of RepositoryInformation for the Registry + - list, listing entries of your repository, with optional pagination + - create, creating a new entry into your repository (data is json serialized) + - get, getting a single entry of your repository + - update, updating an entry in your repository partially (patch) + - replace, updating an entry in your repository (put) + - delete, deleting a single entry in your repository +