@@ 4,6 4,28 @@
> Backend for cosmic
The core concept around the cosmic API is the module. At a high level, a Module
is a class that an abstract java project/program may implement, then this
project may be added to cosmics classpath, then at runtime cosmic will detect
And serve the module.
A module is essentually a rest API entry point to some abstract java
application. To create a module, the application must do two things.
Annotate the module with the [`@Module`](https://git.sr.ht/~skiqqy/libCosmic/tree/master/item/src/main/java/xyz/skiqqy/cosmic/lib/module/Module.java) annotation. This allows cosmic to detect
and load the module. The other is the module must extend and implement a
[`ModuleConf`](https://git.sr.ht/~skiqqy/libCosmic/tree/master/item/src/main/java/xyz/skiqqy/cosmic/lib/module/ModuleConf.java) class. This conf is then pass to the single constructor used
to instantiate the Module.
The config should then be given to cosmic so that it may instantaite the module
at start up.
I have left out alot of detail to try condense this, it is best to read the
source code directly to see how this happens (I will soon have a demo out
showing this in action).